]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
rand: allow seed-src to be missing
authorPauli <paul.dale@oracle.com>
Wed, 9 Dec 2020 09:55:08 +0000 (19:55 +1000)
committerPauli <paul.dale@oracle.com>
Wed, 9 Dec 2020 12:28:52 +0000 (22:28 +1000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13640)

crypto/rand/rand_lib.c

index 2ad3cf776fd6bd50ae59d6939dc57993431ba6e3..f0284aab0897fd84b111e525d33c17bacf961530 100644 (file)
@@ -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,