tests/rsa: run bad-size wc_MakeRsaKey checks under WOLFSSL_CHECK_MEM_ZERO

The mem-zero false-positive these calls tripped is fixed at the library
level in wc_MakeRsaKey() on the sibling branch (fixes-2026-07-10 / PR
10875), which zero-initializes its stack temporaries so the early-out
mp_memzero_check() is safe. Drop the !WOLFSSL_CHECK_MEM_ZERO guard so the
RsaSizeCheck decision is exercised in the instrumented build too. Depends
on PR 10875 for the all-check-mem-zero config.
This commit is contained in:
Daniele Lacamera
2026-07-13 11:19:24 +02:00
parent 9730a76ab9
commit 42bbbda087
+1 -8
View File
@@ -1610,18 +1610,11 @@ int test_wc_RsaDecisionCoverage(void)
/* ---- wc_MakeRsaKey size check: RsaSizeCheck (rsa.c line ~5153) ----
* size < RSA_MIN_SIZE and size > RSA_MAX_SIZE both reject; the valid-size
* (all-false) side came from the MAKE_RSA_KEY above.
* Skipped under WOLFSSL_CHECK_MEM_ZERO: on the early size-check failure
* wc_MakeRsaKey runs mp_memzero_check() over its not-yet-initialized local
* temporaries, which over-scans the stack and false-positives on the
* still-registered (legitimately non-zero) key->d of the key made above.
* The decision itself is covered in every non-instrumented build. */
#ifndef WOLFSSL_CHECK_MEM_ZERO
* (all-false) side came from the MAKE_RSA_KEY above. */
ExpectIntEQ(wc_MakeRsaKey(&key, RSA_MIN_SIZE - 1, WC_RSA_EXPONENT, &rng),
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
ExpectIntEQ(wc_MakeRsaKey(&key, RSA_MAX_SIZE + 1, WC_RSA_EXPONENT, &rng),
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
#endif
/* ---- wc_CheckProbablePrime_ex argument checks (rsa.c ~5286/~5293) ---- */
{