From: Dr. Matthias St. Pierre Date: Sat, 3 Feb 2018 20:13:19 +0000 (+0100) Subject: drbg_bytes: remove check for DRBG_UNINITIALIZED state X-Git-Tag: OpenSSL_1_1_1-pre1~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=58351fbd02e9960af199df99f6f003419c1487a4;p=thirdparty%2Fopenssl.git drbg_bytes: remove check for DRBG_UNINITIALIZED state This check not only prevented the automatic reinstantiation of the DRBG, which is implemented in RAND_DRBG_generate(), but also prevented an error message from being generated in the case of failure. Reviewed-by: Kurt Roeckx (Merged from https://github.com/openssl/openssl/pull/5251) --- diff --git a/crypto/rand/drbg_lib.c b/crypto/rand/drbg_lib.c index cb2f9e8d92..974e3bbd11 100644 --- a/crypto/rand/drbg_lib.c +++ b/crypto/rand/drbg_lib.c @@ -772,9 +772,6 @@ static int drbg_bytes(unsigned char *out, int count) return 0; CRYPTO_THREAD_write_lock(drbg->lock); - if (drbg->state == DRBG_UNINITIALISED) - goto err; - for ( ; count > 0; count -= chunk, out += chunk) { chunk = count; if (chunk > drbg->max_request)