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.
pull/10876/head
Daniele Lacamera 2026-07-13 14:13:46 +02:00
parent cc059f4cc5
commit 7a80753efb
1 changed files with 5 additions and 1 deletions

View File

@ -1570,7 +1570,10 @@ int test_wc_RsaDecisionCoverage(void)
* key, in, inLen, out, outLen, outLen pointer, and type each
* independently reject. The
* all-false side is produced by every real encrypt/decrypt; these supply
* the single-true half of each condition's MC/DC pair. */
* the single-true half of each condition's MC/DC pair.
* wc_RsaFunction is not exported by the FIPS module (undefined reference
* at link time on the FIPS legs), so exclude it under HAVE_FIPS. */
#if !defined(HAVE_FIPS)
{
word32 rawOutLen = cipherLen;
word32 rawZeroLen = 0;
@ -1593,6 +1596,7 @@ int test_wc_RsaDecisionCoverage(void)
ExpectIntEQ(wc_RsaFunction(cipher, cipherLen, plain, &rawOutLen,
RSA_PUBLIC_DECRYPT, NULL, &rng), WC_NO_ERR_TRACE(BAD_FUNC_ARG));
}
#endif /* !HAVE_FIPS - wc_RsaFunction not exported by the FIPS module */
/* ---- wc_RsaDirect: in/outSz/key argument-check (rsa.c line ~3304) ----
* Compiled because the base enables WC_RSA_NO_PADDING. */