mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
SHA 256,512: Only write hash if no error has occurred
ZD 11649
This commit is contained in:
@@ -1094,7 +1094,7 @@ static int InitSha256(wc_Sha256* sha256)
|
||||
#endif
|
||||
|
||||
/* save remainder */
|
||||
if (len > 0) {
|
||||
if (ret == 0 && len > 0) {
|
||||
XMEMCPY(local, data, len);
|
||||
sha256->buffLen = len;
|
||||
}
|
||||
|
@@ -717,7 +717,7 @@ static WC_INLINE int Sha512Update(wc_Sha512* sha512, const byte* data, word32 le
|
||||
}
|
||||
#endif
|
||||
|
||||
if (len > 0) {
|
||||
if (ret == 0 && len > 0) {
|
||||
XMEMCPY(local, data, len);
|
||||
sha512->buffLen = len;
|
||||
}
|
||||
|
Reference in New Issue
Block a user