Skip to content

Commit 3b3ddd1

Browse files
committed
wolfcrypt/src/random.c: in wc_GenerateSeed(), move the gate closures for !FORCE_FAILURE_RDSEED and !ENTROPY_MEMUSE_FORCE_FAILURE to follow the /dev/urandom fallback method.
1 parent b487287 commit 3b3ddd1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

wolfcrypt/src/random.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3497,10 +3497,6 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
34973497
}
34983498
#endif
34993499

3500-
#endif /* (!HAVE_INTEL_RDSEED && !HAVE_AMD_RDSEED) || !FORCE_FAILURE_RDSEED */
3501-
3502-
#endif /*!HAVE_ENTROPY_MEMUSE || !ENTROPY_MEMUSE_FORCE_FAILURE */
3503-
35043500
#ifndef NO_FILESYSTEM
35053501
#ifndef NO_DEV_URANDOM /* way to disable use of /dev/urandom */
35063502
os->fd = open("/dev/urandom", O_RDONLY);
@@ -3548,6 +3544,11 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
35483544
#endif /* NO_FILESYSTEM */
35493545

35503546
return ret;
3547+
3548+
#endif /* (!HAVE_INTEL_RDSEED && !HAVE_AMD_RDSEED) || !FORCE_FAILURE_RDSEED */
3549+
3550+
#endif /*!HAVE_ENTROPY_MEMUSE || !ENTROPY_MEMUSE_FORCE_FAILURE */
3551+
35513552
}
35523553

35533554
#endif

0 commit comments

Comments
 (0)