diff --git a/configure.ac b/configure.ac index 41750b74a..9d9afb3dd 100644 --- a/configure.ac +++ b/configure.ac @@ -221,17 +221,17 @@ then fi -AC_ARG_ENABLE([norng], - [ --enable-norng Enable Test Cert (default: disabled)], - [ ENABLED_NORNG=$enableval ], - [ ENABLED_NORNG=no ] +AC_ARG_ENABLE([rng], + [AS_HELP_STRING([ --enable-rng Enable compiling and using RNG (default: enabled)])], + [ ENABLED_RNG=$enableval ], + [ ENABLED_RNG=yes ] ) -if test "$ENABLED_NORNG" = "yes" +if test "$ENABLED_RNG" = "no" then AM_CFLAGS="$AM_CFLAGS -DWC_NO_RNG" fi -AM_CONDITIONAL([BUILD_RNG], [test "x$ENABLED_NORNG" = "xno"]) +AM_CONDITIONAL([BUILD_RNG], [test "x$ENABLED_RNG" = "xyes"]) # DTLS-SCTP diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 64198c0e9..8419fffe2 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -82,6 +82,7 @@ int wc_RNG_GenerateByte(WC_RNG* rng, byte* b) } #endif /* HAVE_HASHDRBG || NO_RC4 */ #else /* else build without fips */ +#ifndef WC_NO_RNG /* if not FIPS and RNG is disabled then do not compile */ #include /* Allow custom RNG system */ @@ -1671,5 +1672,6 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) #endif /* USE_WINDOWS_API */ #endif /* CUSTOM_RAND_GENERATE_BLOCK */ +#endif /* WC_NO_RNG */ #endif /* HAVE_FIPS */