@@ -7402,7 +7402,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_md5_test(void)
74027402 testVector a, b, c, d;
74037403 testVector test_hmac[4];
74047404
7405- wc_test_ret_t ret;
7405+ wc_test_ret_t ret = WC_TEST_RET_ENC_NC ;
74067406 int times = sizeof(test_hmac) / sizeof(testVector), i;
74077407 WOLFSSL_ENTER("hmac_md5_test");
74087408
@@ -7543,7 +7543,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha_test(void)
75437543 testVector a, b, c, d;
75447544 testVector test_hmac[4];
75457545
7546- wc_test_ret_t ret;
7546+ wc_test_ret_t ret = WC_TEST_RET_ENC_NC ;
75477547 int times = sizeof(test_hmac) / sizeof(testVector), i;
75487548
75497549#if FIPS_VERSION3_GE(6,0,0)
@@ -7700,7 +7700,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha224_test(void)
77007700 testVector a, b, c, d;
77017701 testVector test_hmac[4];
77027702
7703- wc_test_ret_t ret;
7703+ wc_test_ret_t ret = WC_TEST_RET_ENC_NC ;
77047704 int times = sizeof(test_hmac) / sizeof(testVector), i;
77057705 WOLFSSL_ENTER("hmac_sha224_test");
77067706
@@ -7844,7 +7844,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha256_test(void)
78447844 testVector a, b, c, d, e;
78457845 testVector test_hmac[5];
78467846
7847- wc_test_ret_t ret;
7847+ wc_test_ret_t ret = WC_TEST_RET_ENC_NC ;
78487848 int times = sizeof(test_hmac) / sizeof(testVector), i;
78497849 WOLFSSL_ENTER("hmac_sha256_test");
78507850
@@ -8014,7 +8014,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha384_test(void)
80148014 testVector a, b, c, d;
80158015 testVector test_hmac[4];
80168016
8017- wc_test_ret_t ret;
8017+ wc_test_ret_t ret = WC_TEST_RET_ENC_NC ;
80188018 int times = sizeof(test_hmac) / sizeof(testVector), i;
80198019 WOLFSSL_ENTER("hmac_sha384_test");
80208020
@@ -8165,7 +8165,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha512_test(void)
81658165 testVector a, b, c, d;
81668166 testVector test_hmac[4];
81678167
8168- wc_test_ret_t ret;
8168+ wc_test_ret_t ret = WC_TEST_RET_ENC_NC ;
81698169 int times = sizeof(test_hmac) / sizeof(testVector), i;
81708170 WOLFSSL_ENTER("hmac_sha512_test");
81718171
@@ -8423,7 +8423,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha3_test(void)
84238423
84248424 int i = 0, iMax = sizeof(input) / sizeof(input[0]),
84258425 j, jMax = sizeof(hashType) / sizeof(hashType[0]);
8426- int ret;
8426+ wc_test_ret_t ret = WC_TEST_RET_ENC_NC ;
84278427 WOLFSSL_ENTER("hmac_sha3_test");
84288428
84298429 XMEMSET(&hmac, 0, sizeof(hmac));
@@ -19748,14 +19748,23 @@ static wc_test_ret_t _rng_test(WC_RNG* rng)
1974819748 !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || FIPS_VERSION3_GE(5,0,0))
1974919749 /* Test periodic reseed dynamics. */
1975019750
19751- ((struct DRBG_internal *)rng->drbg)->reseedCtr = WC_RESEED_INTERVAL;
19751+ #ifdef WOLF_CRYPTO_CB
19752+ if (wc_CryptoCb_RandomBlock(rng, block, sizeof(block)) ==
19753+ WC_NO_ERR_TRACE(CRYPTOCB_UNAVAILABLE))
19754+ {
19755+ #endif
19756+ ((struct DRBG_internal *)rng->drbg)->reseedCtr = WC_RESEED_INTERVAL;
1975219757
19753- ret = wc_RNG_GenerateBlock(rng, block, sizeof(block));
19754- if (ret != 0)
19755- return WC_TEST_RET_ENC_EC(ret);
19758+ ret = wc_RNG_GenerateBlock(rng, block, sizeof(block));
19759+ if (ret != 0)
19760+ return WC_TEST_RET_ENC_EC(ret);
19761+
19762+ if (((struct DRBG_internal *)rng->drbg)->reseedCtr == WC_RESEED_INTERVAL)
19763+ return WC_TEST_RET_ENC_NC;
19764+ #ifdef WOLF_CRYPTO_CB
19765+ }
19766+ #endif
1975619767
19757- if (((struct DRBG_internal *)rng->drbg)->reseedCtr == WC_RESEED_INTERVAL)
19758- return WC_TEST_RET_ENC_NC;
1975919768#endif /* HAVE_HASHDRBG && !CUSTOM_RAND_GENERATE_BLOCK && !HAVE_SELFTEST */
1976019769
1976119770#if defined(WOLFSSL_TRACK_MEMORY) && defined(WOLFSSL_SMALL_STACK_CACHE)
@@ -19870,7 +19879,7 @@ static wc_test_ret_t rng_seed_test(void)
1987019879 * SEED_BLOCK_SZ, which depend on which seed back end is configured.
1987119880 */
1987219881#if defined(HAVE_ENTROPY_MEMUSE) && defined(HAVE_AMD_RDSEED) && \
19873- !(defined(HAVE_FIPS) && FIPS_VERSION_LT (6,0))
19882+ !(defined(HAVE_FIPS) && FIPS_VERSION3_LT (6,0,0) && FIPS_VERSION3_NE(5,2,4 ))
1987419883 #ifdef HAVE_FIPS
1987519884 WOLFSSL_SMALL_STACK_STATIC const byte check[] =
1987619885 {
@@ -19908,7 +19917,7 @@ static wc_test_ret_t rng_seed_test(void)
1990819917 };
1990919918 #endif
1991019919#elif defined(HAVE_AMD_RDSEED) && \
19911- !(defined(HAVE_FIPS) && FIPS_VERSION_LT (6,0))
19920+ !(defined(HAVE_FIPS) && FIPS_VERSION3_LT (6,0,0) && FIPS_VERSION3_NE(5,2,4 ))
1991219921 WOLFSSL_SMALL_STACK_STATIC const byte check[] =
1991319922 {
1991419923 0x2c, 0xd4, 0x9b, 0x1e, 0x1e, 0xe7, 0xb0, 0xb0,
@@ -19917,7 +19926,7 @@ static wc_test_ret_t rng_seed_test(void)
1991719926 0xa2, 0xe7, 0xe5, 0x90, 0x6d, 0x1f, 0x88, 0x98
1991819927 };
1991919928#elif (defined(HAVE_INTEL_RDSEED) || defined(HAVE_INTEL_RDRAND)) && \
19920- !(defined(HAVE_FIPS) && FIPS_VERSION_LT (6,0))
19929+ !(defined(HAVE_FIPS) && FIPS_VERSION3_LT (6,0,0) && FIPS_VERSION3_NE(5,2,4 ))
1992119930 #ifdef HAVE_FIPS
1992219931 WOLFSSL_SMALL_STACK_STATIC const byte check[] =
1992319932 {
@@ -19936,7 +19945,7 @@ static wc_test_ret_t rng_seed_test(void)
1993619945 };
1993719946 #endif
1993819947#elif defined(HAVE_INTEL_RDSEED) && \
19939- defined(HAVE_FIPS) && FIPS_VERSION_LT (6,0)
19948+ defined(HAVE_FIPS) && FIPS_VERSION3_LT (6,0,0) && FIPS_VERSION3_NE(5,2,4 )
1994019949 WOLFSSL_SMALL_STACK_STATIC const byte check[] =
1994119950 {
1994219951 0x27, 0xdd, 0xff, 0x5b, 0x21, 0x26, 0x0a, 0x48,
0 commit comments