mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Fix ShaFinal overrun.
This commit is contained in:
@ -841,7 +841,10 @@ int wc_ShaFinal(wc_Sha* sha, byte* hash)
|
||||
|
||||
/* pad with zeros */
|
||||
if (sha->buffLen > WC_SHA_PAD_SIZE) {
|
||||
XMEMSET(&local[sha->buffLen], 0, WC_SHA_BLOCK_SIZE - sha->buffLen);
|
||||
if (sha->buffLen < WC_SHA_BLOCK_SIZE) {
|
||||
XMEMSET(&local[sha->buffLen], 0, WC_SHA_BLOCK_SIZE - sha->buffLen);
|
||||
}
|
||||
|
||||
sha->buffLen += WC_SHA_BLOCK_SIZE - sha->buffLen;
|
||||
|
||||
#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW)
|
||||
|
Reference in New Issue
Block a user