peer review fixes re: minor fixes to accommodate --disable-sha in combination with --enable-all-crypto.

This commit is contained in:
Daniel Pouzzner
2022-12-20 10:43:33 -06:00
parent 91869f6028
commit 455e76873c
2 changed files with 5 additions and 6 deletions

View File

@@ -338,13 +338,12 @@ static unsigned long wolfSSL_CONF_VALUE_hash(const WOLFSSL_CONF_VALUE *val)
unsigned long wolfSSL_LH_strhash(const char *str) unsigned long wolfSSL_LH_strhash(const char *str)
{ {
unsigned long ret = 0; unsigned long ret = 0;
int strLen;
#if !defined(NO_SHA) #if !defined(NO_SHA)
wc_Sha sha; wc_Sha sha;
int strLen;
byte digest[WC_SHA_DIGEST_SIZE]; byte digest[WC_SHA_DIGEST_SIZE];
#elif !defined(NO_SHA256) #elif !defined(NO_SHA256)
wc_Sha256 sha; wc_Sha256 sha;
int strLen;
byte digest[WC_SHA256_DIGEST_SIZE]; byte digest[WC_SHA256_DIGEST_SIZE];
#endif #endif
WOLFSSL_ENTER("wolfSSL_LH_strhash"); WOLFSSL_ENTER("wolfSSL_LH_strhash");

View File

@@ -20334,7 +20334,7 @@ static int test_wc_RsaPublicEncryptDecrypt_ex(void)
int result = TEST_SKIPPED; int result = TEST_SKIPPED;
#if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN) && !defined(HAVE_FIPS)\ #if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN) && !defined(HAVE_FIPS)\
&& !defined(WC_NO_RSA_OAEP) && !defined(HAVE_USER_RSA)\ && !defined(WC_NO_RSA_OAEP) && !defined(HAVE_USER_RSA)\
&& !defined(NO_SHA) && !defined(NO_SHA256)
RsaKey key; RsaKey key;
WC_RNG rng; WC_RNG rng;
int ret; int ret;
@@ -20372,7 +20372,7 @@ static int test_wc_RsaPublicEncryptDecrypt_ex(void)
/* Encrypt */ /* Encrypt */
if (ret == 0) { if (ret == 0) {
ret = wc_RsaPublicEncrypt_ex(in, inLen, cipher, cipherSz, &key, &rng, ret = wc_RsaPublicEncrypt_ex(in, inLen, cipher, cipherSz, &key, &rng,
WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA256, WC_MGF1SHA1, NULL, 0); WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA256, WC_MGF1SHA256, NULL, 0);
if (ret >= 0) { if (ret >= 0) {
idx = ret; idx = ret;
ret = 0; ret = 0;
@@ -20398,7 +20398,7 @@ static int test_wc_RsaPublicEncryptDecrypt_ex(void)
if (ret == 0) { if (ret == 0) {
ret = wc_RsaPrivateDecrypt_ex(cipher, (word32)idx, ret = wc_RsaPrivateDecrypt_ex(cipher, (word32)idx,
plain, plainSz, &key, WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA256, plain, plainSz, &key, WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA256,
WC_MGF1SHA1, NULL, 0); WC_MGF1SHA256, NULL, 0);
} }
if (ret >= 0) { if (ret >= 0) {
if (!XMEMCMP(plain, inStr, plainSz)) { if (!XMEMCMP(plain, inStr, plainSz)) {
@@ -20418,7 +20418,7 @@ static int test_wc_RsaPublicEncryptDecrypt_ex(void)
if (ret == 0) { if (ret == 0) {
ret = wc_RsaPrivateDecryptInline_ex(cipher, (word32)idx, ret = wc_RsaPrivateDecryptInline_ex(cipher, (word32)idx,
&res, &key, WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA256, &res, &key, WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA256,
WC_MGF1SHA1, NULL, 0); WC_MGF1SHA256, NULL, 0);
if (ret >= 0) { if (ret >= 0) {
if (!XMEMCMP(inStr, res, plainSz)) { if (!XMEMCMP(inStr, res, plainSz)) {