Skip to content

Commit cdd02f9

Browse files
committed
Add check for reseed in ssl.c for HAVE_SELFTEST, similar to old FIPS bundles that do not have older random.c files
1 parent 9c35c0d commit cdd02f9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ssl.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25514,7 +25514,7 @@ static int wolfSSL_RAND_InitMutex(void)
2551425514
#ifdef OPENSSL_EXTRA
2551525515

2551625516
#if defined(HAVE_GETPID) && !defined(WOLFSSL_NO_GETPID) && \
25517-
defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)
25517+
((defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)) || defined(HAVE_SELFTEST))
2551825518
/* In older FIPS bundles add check for reseed here since it does not exist in
2551925519
* the older random.c certified files. */
2552025520
static pid_t currentRandPid = 0;
@@ -25533,7 +25533,9 @@ int wolfSSL_RAND_Init(void)
2553325533
ret = wc_InitRng(&globalRNG);
2553425534
if (ret == 0) {
2553525535
#if defined(HAVE_GETPID) && !defined(WOLFSSL_NO_GETPID) && \
25536-
defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)
25536+
((defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)) || \
25537+
defined(HAVE_SELFTEST))
25538+
2553725539
currentRandPid = getpid();
2553825540
#endif
2553925541
initGlobalRNG = 1;
@@ -26014,7 +26016,8 @@ int wolfSSL_RAND_bytes(unsigned char* buf, int num)
2601426016
*/
2601526017
if (initGlobalRNG) {
2601626018
#if defined(HAVE_GETPID) && !defined(WOLFSSL_NO_GETPID) && \
26017-
defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)
26019+
((defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)) || \
26020+
defined(HAVE_SELFTEST))
2601826021
pid_t p;
2601926022

2602026023
p = getpid();

0 commit comments

Comments
 (0)