Commit 96de7d164b for openssl.org

commit 96de7d164b7b7041bfcbfca82585673ea0df8896
Author: Jakub Zelenka <jakub.zelenka@openssl.foundation>
Date:   Mon Jul 13 20:50:32 2026 +0200

    rand: pre-fetch JITTER seed when jitter used

    This fixes failing rand mfail test when jitter used

    Reviewed-by: Richard Levitte <levitte@openssl.org>
    Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
    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 e5c889a9e9..be3313fc6e 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();