summaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2015-06-09 09:55:38 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2015-06-10 07:14:01 -0400
commit57225e6797885e31302e76fc5926c0bedd7e5ad4 (patch)
tree8cdb966886dcc891cb8c5dd8fd0a90a6f4437983 /include/crypto
parent205a525c334295e3cd4cc7755fd2c0398e3a787f (diff)
crypto: drbg - Use callback API for random readiness
The get_blocking_random_bytes API is broken because the wait can be arbitrarily long (potentially forever) so there is no safe way of calling it from within the kernel. This patch replaces it with the new callback API which does not have this problem. The patch also removes the entropy buffer registered with the DRBG handle in favor of stack variables to hold the seed data. Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/drbg.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/crypto/drbg.h b/include/crypto/drbg.h
index c3f208dc83ee..fad6450b99f9 100644
--- a/include/crypto/drbg.h
+++ b/include/crypto/drbg.h
@@ -121,12 +121,11 @@ struct drbg_state {
121 unsigned char *prev; /* FIPS 140-2 continuous test value */ 121 unsigned char *prev; /* FIPS 140-2 continuous test value */
122#endif 122#endif
123 struct work_struct seed_work; /* asynchronous seeding support */ 123 struct work_struct seed_work; /* asynchronous seeding support */
124 u8 *seed_buf; /* buffer holding the seed */
125 size_t seed_buf_len;
126 struct crypto_rng *jent; 124 struct crypto_rng *jent;
127 const struct drbg_state_ops *d_ops; 125 const struct drbg_state_ops *d_ops;
128 const struct drbg_core *core; 126 const struct drbg_core *core;
129 struct drbg_string test_data; 127 struct drbg_string test_data;
128 struct random_ready_callback random_ready;
130}; 129};
131 130
132static inline __u8 drbg_statelen(struct drbg_state *drbg) 131static inline __u8 drbg_statelen(struct drbg_state *drbg)