From: Jakub Zelenka Date: Mon, 13 Jul 2026 18:50:32 +0000 (+0200) Subject: rand: pre-fetch JITTER seed when jitter used X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=96de7d164b7b7041bfcbfca82585673ea0df8896;p=thirdparty%2Fopenssl.git rand: pre-fetch JITTER seed when jitter used This fixes failing rand mfail test when jitter used Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz MergeDate: Wed Jul 15 16:18:29 2026 (Merged from https://github.com/openssl/openssl/pull/31938) --- diff --git a/test/rand_test.c b/test/rand_test.c index e5c889a9e9d..be3313fc6ef 100644 --- a/test/rand_test.c +++ b/test/rand_test.c @@ -15,6 +15,13 @@ #include "crypto/rand.h" #include "testutil.h" +/* For builds where OPENSSL_DEFAULT_SEED_SRC is explicitly set. */ +/* clang-format off */ +#ifndef OPENSSL_DEFAULT_SEED_SRC +#define OPENSSL_DEFAULT_SEED_SRC SEED-SRC +#endif +/* clang-format on */ + static char *configfile; static int test_rand(void) @@ -312,7 +319,11 @@ static int test_rand_bytes_mfail(int idx) goto end; /* The default seed source may be unavailable in some configurations */ ERR_set_mark(); - seed = EVP_RAND_fetch(ctx, "SEED-SRC", NULL); +#if !defined(OPENSSL_NO_FIPS_JITTER) + seed = EVP_RAND_fetch(ctx, "JITTER", NULL); +#else + seed = EVP_RAND_fetch(ctx, OPENSSL_MSTR(OPENSSL_DEFAULT_SEED_SRC), NULL); +#endif ERR_pop_to_mark(); MFAIL_start();