fixes for --disable-harden.

This commit is contained in:
Daniel Pouzzner
2021-11-08 13:56:04 -06:00
parent 27d4bb304c
commit f8565f26e2
2 changed files with 8 additions and 0 deletions

View File

@ -11749,7 +11749,11 @@ int wc_ecc_encrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
#ifndef WOLFSSL_ECIES_OLD #ifndef WOLFSSL_ECIES_OLD
if (privKey->type == ECC_PRIVATEKEY_ONLY) { if (privKey->type == ECC_PRIVATEKEY_ONLY) {
#ifdef ECC_TIMING_RESISTANT
ret = wc_ecc_make_pub_ex(privKey, NULL, privKey->rng); ret = wc_ecc_make_pub_ex(privKey, NULL, privKey->rng);
#else
ret = wc_ecc_make_pub_ex(privKey, NULL, NULL);
#endif
if (ret != 0) if (ret != 0)
return ret; return ret;
} }

View File

@ -24405,6 +24405,8 @@ static int ecc_encrypt_kat(WC_RNG *rng)
ret = -10456; ret = -10456;
} }
} }
#else
(void)rng;
#endif #endif
if (ret == 0) { if (ret == 0) {
@ -31136,7 +31138,9 @@ static int pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
pkcs7EnvelopedVector *testVectors = NULL; pkcs7EnvelopedVector *testVectors = NULL;
#ifdef ECC_TIMING_RESISTANT
XMEMSET(&rng, 0, sizeof(rng)); XMEMSET(&rng, 0, sizeof(rng));
#endif
testVectors = (pkcs7EnvelopedVector *)XMALLOC(MAX_TESTVECTORS_LEN * sizeof(*testVectors), testVectors = (pkcs7EnvelopedVector *)XMALLOC(MAX_TESTVECTORS_LEN * sizeof(*testVectors),
HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);