DRBG: Remove 'randomness' buffer from 'RAND_DRBG'
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Fri, 25 Aug 2017 21:26:53 +0000 (23:26 +0200)
committerRich Salz <rsalz@openssl.org>
Mon, 28 Aug 2017 12:58:50 +0000 (08:58 -0400)
commit6969a3f49ae63c8a4fd543a121511a1f0eb64a5e
tree393a17111adc9be58b266cedc9ee9bbf87efdd99
parent4871fa49cdd0d4473b6a815fc01fbde3e6ced339
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)
crypto/rand/drbg_lib.c
crypto/rand/rand_lcl.h
crypto/rand/rand_lib.c
crypto/rand/rand_unix.c
include/internal/rand.h