Use passed drbg, not global one

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/4097)
This commit is contained in:
Dr. Stephen Henson 2017-08-06 14:05:21 +01:00
parent afc901e0ec
commit 69a978d359

View File

@ -117,7 +117,7 @@ size_t drbg_entropy_from_system(RAND_DRBG *drbg,
min_len = drbg->size;
}
if (rand_drbg.filled) {
if (drbg->filled) {
/* Re-use what we have. */
*pout = drbg->randomness;
return drbg->size;
@ -136,7 +136,7 @@ size_t drbg_entropy_from_system(RAND_DRBG *drbg,
min_len = rand_bytes.curr;
if (min_len != 0) {
memcpy(drbg->randomness, rand_bytes.buff, min_len);
rand_drbg.filled = 1;
drbg->filled = 1;
/* Update amount left and shift it down. */
rand_bytes.curr -= min_len;
if (rand_bytes.curr != 0)