wc_ChaCha20Poly1305_Decrypt: clear unauthed plaintext

F-452
This commit is contained in:
Juliusz Sosinowicz
2026-03-09 17:21:01 +01:00
parent 0b03d56127
commit 7a264162b8
+4
View File
@@ -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;