From: Pauli Date: Wed, 9 Dec 2020 09:55:08 +0000 (+1000) Subject: rand: allow seed-src to be missing X-Git-Tag: openssl-3.0.0-alpha10~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d180bbe8e2103f35328cf82fbde7fd23602735a;p=thirdparty%2Fopenssl.git rand: allow seed-src to be missing Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/13640) --- diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c index 2ad3cf776fd..f0284aab089 100644 --- a/crypto/rand/rand_lib.c +++ b/crypto/rand/rand_lib.c @@ -561,8 +561,11 @@ EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx) if (!CRYPTO_THREAD_write_lock(dgbl->lock)) return NULL; #ifndef FIPS_MODULE - if (dgbl->seed == NULL) + if (dgbl->seed == NULL) { + ERR_set_mark(); dgbl->seed = rand_new_seed(ctx); + ERR_pop_to_mark(); + } #endif if (dgbl->primary == NULL) dgbl->primary = rand_new_drbg(ctx, dgbl->seed,