Merge pull request #10776 from julek-wolfssl/fix-sha512-w-cache-free-type

sha512: free SHA-512/384 W cache with its allocated memory type
This commit is contained in:
David Garske
2026-06-25 09:29:47 -07:00
committed by GitHub
+2 -2
View File
@@ -2306,7 +2306,7 @@ void wc_Sha512Free(wc_Sha512* sha512)
#ifdef WOLFSSL_SMALL_STACK_CACHE
if (sha512->W != NULL) {
ForceZero(sha512->W, (sizeof(word64) * 16) + WC_SHA512_BLOCK_SIZE);
XFREE(sha512->W, sha512->heap, DYNAMIC_TYPE_TMP_BUFFER);
XFREE(sha512->W, sha512->heap, DYNAMIC_TYPE_DIGEST);
sha512->W = NULL;
}
#endif
@@ -2779,7 +2779,7 @@ void wc_Sha384Free(wc_Sha384* sha384)
#ifdef WOLFSSL_SMALL_STACK_CACHE
if (sha384->W != NULL) {
ForceZero(sha384->W, (sizeof(word64) * 16) + WC_SHA512_BLOCK_SIZE);
XFREE(sha384->W, sha384->heap, DYNAMIC_TYPE_TMP_BUFFER);
XFREE(sha384->W, sha384->heap, DYNAMIC_TYPE_DIGEST);
sha384->W = NULL;
}
#endif