wc_XChaCha20Poly1305_crypt_oneshot(): use ForceZero, not XMEMSET(), to safely clear the AEAD state before return.

This commit is contained in:
Daniel Pouzzner
2020-10-23 00:33:48 -05:00
parent 7a5cbaa9bc
commit f37c25f9c0

View File

@ -435,7 +435,8 @@ static WC_INLINE int wc_XChaCha20Poly1305_crypt_oneshot(
out:
XMEMSET(aead, 0, sizeof *aead);
ForceZero(aead, sizeof *aead);
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
XFREE(aead, NULL, DYNAMIC_TYPE_TMP_BUFFER);
#endif