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)
#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)
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();