Skip to content

Commit 7a80753

Browse files
committed
tests/rsa: guard wc_RsaFunction arg-check block against FIPS
wc_RsaFunction is declared WOLFSSL_API but the FIPS module does not export it, so test_wc_RsaDecisionCoverage's 7-condition wc_RsaFunction arg-check block fails to link (undefined reference) across the FIPS legs. Exclude the block under HAVE_FIPS; cipher/plain/key/rng stay used by the other checks, so no unused-variable. Not frozen under self-test, so it stays there.
1 parent cc059f4 commit 7a80753

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/api/test_rsa.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,10 @@ int test_wc_RsaDecisionCoverage(void)
15701570
* key, in, inLen, out, outLen, outLen pointer, and type each
15711571
* independently reject. The
15721572
* all-false side is produced by every real encrypt/decrypt; these supply
1573-
* the single-true half of each condition's MC/DC pair. */
1573+
* the single-true half of each condition's MC/DC pair.
1574+
* wc_RsaFunction is not exported by the FIPS module (undefined reference
1575+
* at link time on the FIPS legs), so exclude it under HAVE_FIPS. */
1576+
#if !defined(HAVE_FIPS)
15741577
{
15751578
word32 rawOutLen = cipherLen;
15761579
word32 rawZeroLen = 0;
@@ -1593,6 +1596,7 @@ int test_wc_RsaDecisionCoverage(void)
15931596
ExpectIntEQ(wc_RsaFunction(cipher, cipherLen, plain, &rawOutLen,
15941597
RSA_PUBLIC_DECRYPT, NULL, &rng), WC_NO_ERR_TRACE(BAD_FUNC_ARG));
15951598
}
1599+
#endif /* !HAVE_FIPS - wc_RsaFunction not exported by the FIPS module */
15961600

15971601
/* ---- wc_RsaDirect: in/outSz/key argument-check (rsa.c line ~3304) ----
15981602
* Compiled because the base enables WC_RSA_NO_PADDING. */

0 commit comments

Comments
 (0)