mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-10 06:00:49 +02:00
wc_ChaCha20Poly1305_Decrypt: clear unauthed plaintext
F-452
This commit is contained in:
@@ -119,6 +119,10 @@ int wc_ChaCha20Poly1305_Decrypt(
|
||||
if (ret == 0)
|
||||
ret = wc_ChaCha20Poly1305_CheckTag(inAuthTag, calculatedAuthTag);
|
||||
|
||||
if (ret != 0) {
|
||||
/* zero plaintext on error */
|
||||
ForceZero(outPlaintext, inCiphertextLen);
|
||||
}
|
||||
WC_FREE_VAR_EX(aead, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user