Skip to content

Commit 13900ec

Browse files
committed
Fix from review
1 parent ad05cb5 commit 13900ec

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

wolfcrypt/test/test.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27617,15 +27617,17 @@ static wc_test_ret_t dh_fips_generate_test(WC_RNG *rng)
2761727617
* GeneratePrivateDh186 writes (*privSz + 8) bytes of RNG output into the
2761827618
* stack-allocated cBuf (sized DH_MAX_SIZE + 8 in non-WOLFSSL_SMALL_STACK
2761927619
* builds). The key still has q set here, so the call dispatches through
27620-
* GeneratePrivateDh186. */
27620+
* GeneratePrivateDh186. Accept BAD_FUNC_ARG from src/dh.c's bound check
27621+
* or MP_VAL from the FIPS-validated module's own param validation. */
2762127622
{
2762227623
word32 hugePrivSz = (word32)DH_MAX_SIZE + 1;
2762327624
word32 outPubSz = sizeof(pub);
2762427625
ret = wc_DhGenerateKeyPair(key, rng, priv, &hugePrivSz, pub, &outPubSz);
2762527626
#if defined(WOLFSSL_ASYNC_CRYPT)
2762627627
ret = wc_AsyncWait(ret, &key->asyncDev, WC_ASYNC_FLAG_NONE);
2762727628
#endif
27628-
if (ret != WC_NO_ERR_TRACE(BAD_FUNC_ARG))
27629+
if (ret != WC_NO_ERR_TRACE(BAD_FUNC_ARG) &&
27630+
ret != WC_NO_ERR_TRACE(MP_VAL))
2762927631
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), exit_gen_test);
2763027632
}
2763127633
#endif /* !WOLFSSL_NO_DH186 */

0 commit comments

Comments
 (0)