diff options
author | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2017-08-25 23:26:53 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-08-28 14:58:50 +0200 |
commit | 6969a3f49ae63c8a4fd543a121511a1f0eb64a5e (patch) | |
tree | 393a17111adc9be58b266cedc9ee9bbf87efdd99 /crypto/rand/rand_unix.c | |
parent | RAND: Rename the RAND_poll_ex() callback and its typedef (diff) | |
download | openssl-6969a3f49ae63c8a4fd543a121511a1f0eb64a5e.tar.xz openssl-6969a3f49ae63c8a4fd543a121511a1f0eb64a5e.zip |
DRBG: Remove 'randomness' buffer from 'RAND_DRBG'
The DRBG callbacks 'get_entropy()' and 'cleanup_entropy()' are designed
in such a way that the randomness buffer does not have to be allocated
by the calling function. It receives the address of a dynamically
allocated buffer from get_entropy() and returns this address to
cleanup_entropy(), where it is freed. If these two calls are properly
paired, the address can be stored in a stack local variable of the
calling function, so there is no need for having a 'randomness' member
(and a 'filled' member) in 'RAND_DRBG'.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4266)
Diffstat (limited to 'crypto/rand/rand_unix.c')
-rw-r--r-- | crypto/rand/rand_unix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c index 8090987a2a..4f01e8aad5 100644 --- a/crypto/rand/rand_unix.c +++ b/crypto/rand/rand_unix.c @@ -178,11 +178,11 @@ int RAND_poll_ex(RAND_poll_cb rand_add, void *arg) # endif # ifdef OPENSSL_RAND_SEED_RDTSC - rand_read_tsc(cb, arg); + rand_read_tsc(rand_add, arg); # endif # ifdef OPENSSL_RAND_SEED_RDCPU - if (rand_read_cpu(cb, arg)) + if (rand_read_cpu(rand_add, arg)) goto done; # endif |