api.c: fix logic in test_RsaDecryptBoundsCheck().

This commit is contained in:
Daniel Pouzzner
2021-12-22 12:24:18 -06:00
parent 11e8d729c2
commit b0a5b16068

View File

@@ -18495,7 +18495,7 @@ static int test_RsaDecryptBoundsCheck(void)
ret = wc_RsaDirect(flatC, flatCSz, out, &outSz, &key,
RSA_PRIVATE_DECRYPT, &rng);
}
if (ret == RSA_OUT_OF_RANGE_E) {
mp_int c;
mp_init_copy(&c, &key.n);
@@ -18507,6 +18507,9 @@ static int test_RsaDecryptBoundsCheck(void)
}
if (ret == RSA_OUT_OF_RANGE_E)
ret = 0;
else
ret = WOLFSSL_FATAL_ERROR;
}
if (wc_FreeRsaKey(&key) || wc_FreeRng(&rng) || ret != 0)
ret = WOLFSSL_FATAL_ERROR;