diff options
author | Elena Petrova <lenaptr@google.com> | 2020-09-18 16:42:16 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-09-25 17:48:52 +1000 |
commit | 77ebdabe8de7c02f43c6de3357f79ff96f9f0579 (patch) | |
tree | e6f8fbb41137d2e27703a31083d6cf99762251af /include/crypto | |
parent | fcf5d2dcadde06f2c82eef460198e2f2f4b642f8 (diff) | |
download | linux-stable-77ebdabe8de7c02f43c6de3357f79ff96f9f0579.tar.gz linux-stable-77ebdabe8de7c02f43c6de3357f79ff96f9f0579.tar.bz2 linux-stable-77ebdabe8de7c02f43c6de3357f79ff96f9f0579.zip |
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>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/if_alg.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h index ee6412314f8f..a5db86670bdf 100644 --- a/include/crypto/if_alg.h +++ b/include/crypto/if_alg.h @@ -46,6 +46,7 @@ struct af_alg_type { void *(*bind)(const char *name, u32 type, u32 mask); void (*release)(void *private); int (*setkey)(void *private, const u8 *key, unsigned int keylen); + int (*setentropy)(void *private, sockptr_t entropy, unsigned int len); int (*accept)(void *private, struct sock *sk); int (*accept_nokey)(void *private, struct sock *sk); int (*setauthsize)(void *private, unsigned int authsize); |