From: Dr. Stephen Henson Date: Sun, 6 Aug 2017 13:05:21 +0000 (+0100) Subject: Use passed drbg, not global one X-Git-Tag: OpenSSL_1_1_1-pre1~890 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=69a978d35984bb27af336cffc252bdde51d36adb Use passed drbg, not global one Reviewed-by: Kurt Roeckx (Merged from https://github.com/openssl/openssl/pull/4097) --- diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c index 79b2cce249..e76ca2702d 100644 --- a/crypto/rand/rand_lib.c +++ b/crypto/rand/rand_lib.c @@ -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)