From: Rich Salz Date: Sat, 12 Aug 2017 22:19:50 +0000 (-0400) Subject: Instantiate when RAND_status() checks X-Git-Tag: OpenSSL_1_1_1-pre1~855 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bc5145e372db24e8382c34fd191614805164b28b;p=oweals%2Fopenssl.git Instantiate when RAND_status() checks Reviewed-by: Kurt Roeckx (Merged from https://github.com/openssl/openssl/pull/4150) --- diff --git a/crypto/rand/drbg_lib.c b/crypto/rand/drbg_lib.c index e9502db90d..0da4d48f55 100644 --- a/crypto/rand/drbg_lib.c +++ b/crypto/rand/drbg_lib.c @@ -403,6 +403,8 @@ static int drbg_status(void) int ret; CRYPTO_THREAD_write_lock(rand_drbg.lock); + if (rand_drbg.state == DRBG_UNINITIALISED) + RAND_DRBG_instantiate(&rand_drbg, NULL, 0); ret = rand_drbg.state == DRBG_READY ? 1 : 0; CRYPTO_THREAD_unlock(rand_drbg.lock); return ret;