]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: af_alg - add extra parameters for DRBG interface
authorElena Petrova <lenaptr@google.com>
Fri, 18 Sep 2020 15:42:16 +0000 (16:42 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 25 Sep 2020 07:48:52 +0000 (17:48 +1000)
commitb26639c69b941a089a4bf870f84a89bd21706c2d
treee6f8fbb41137d2e27703a31083d6cf99762251af
parent7975ed4280ea5acbd726ca71ebed6e0edd531a16
crypto: af_alg - add extra parameters for DRBG interface

Extend the user-space RNG interface:
  1. Add entropy input via ALG_SET_DRBG_ENTROPY setsockopt option;
  2. Add additional data input via sendmsg syscall.

This allows DRBG to be tested with test vectors, for example for the
purpose of CAVP testing, which otherwise isn't possible.

To prevent erroneous use of entropy input, it is hidden under
CRYPTO_USER_API_RNG_CAVP config option and requires CAP_SYS_ADMIN to
succeed.

Signed-off-by: Elena Petrova <lenaptr@google.com>
Acked-by: Stephan Müller <smueller@chronox.de>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Documentation/crypto/userspace-if.rst
crypto/Kconfig
crypto/af_alg.c
crypto/algif_rng.c
include/crypto/if_alg.h
include/uapi/linux/if_alg.h