Use passed drbg, not global one
authorDr. Stephen Henson <steve@openssl.org>
Sun, 6 Aug 2017 13:05:21 +0000 (14:05 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 6 Aug 2017 13:05:21 +0000 (14:05 +0100)
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/4097)

crypto/rand/rand_lib.c

index 79b2cce249252b4618c0c334a80f87c98d24ebdc..e76ca2702d908b33e1828fbe5bae40ca0d3ecefc 100644 (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)