macro guard on ECB test case and use realloc for hash

This commit is contained in:
JacobBarthelmeh
2022-04-06 07:04:17 -07:00
parent a338b4c933
commit 91d883d99f
2 changed files with 5 additions and 7 deletions

View File

@ -1715,13 +1715,11 @@ int _wc_Sha_Grow(byte** msg, word32* used, word32* len, const byte* in,
*msg = (byte*)XMALLOC(*used + inSz, heap, DYNAMIC_TYPE_TMP_BUFFER); *msg = (byte*)XMALLOC(*used + inSz, heap, DYNAMIC_TYPE_TMP_BUFFER);
} }
else { else {
byte* pt = (byte*)XMALLOC(*used + inSz, heap, byte* pt = (byte*)XREALLOC(*msg, *used + inSz, heap,
DYNAMIC_TYPE_TMP_BUFFER); DYNAMIC_TYPE_TMP_BUFFER);
if (pt == NULL) { if (pt == NULL) {
return MEMORY_E; return MEMORY_E;
} }
XMEMCPY(pt, *msg, *used);
XFREE(*msg, heap, DYNAMIC_TYPE_TMP_BUFFER);
*msg = pt; *msg = pt;
} }
if (*msg == NULL) { if (*msg == NULL) {

View File

@ -8462,7 +8462,7 @@ static int aes_cbc_test(void)
} }
#endif #endif
#ifdef HAVE_AES_ECB #if defined(HAVE_AES_ECB) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
static int aesecb_test(void) static int aesecb_test(void)
{ {
#ifdef WOLFSSL_SMALL_STACK #ifdef WOLFSSL_SMALL_STACK
@ -9174,7 +9174,7 @@ WOLFSSL_TEST_SUBROUTINE int aes_test(void)
#endif #endif
#endif #endif
#if defined(HAVE_AES_ECB) #if defined(HAVE_AES_ECB) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
ret = aesecb_test(); ret = aesecb_test();
if (ret != 0) if (ret != 0)
goto out; goto out;
@ -38726,7 +38726,7 @@ static int myCryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
} }
} }
#endif /* HAVE_AES_CBC */ #endif /* HAVE_AES_CBC */
#ifdef HAVE_AES_ECB #if defined(HAVE_AES_ECB) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
if (info->cipher.type == WC_CIPHER_AES_ECB) { if (info->cipher.type == WC_CIPHER_AES_ECB) {
if (info->cipher.enc) { if (info->cipher.enc) {
/* set devId to invalid, so software is used */ /* set devId to invalid, so software is used */