mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
wc_XChaCha20Poly1305_crypt_oneshot(): use ForceZero, not XMEMSET(), to safely clear the AEAD state before return.
This commit is contained in:
@ -435,7 +435,8 @@ static WC_INLINE int wc_XChaCha20Poly1305_crypt_oneshot(
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
||||||
XMEMSET(aead, 0, sizeof *aead);
|
ForceZero(aead, sizeof *aead);
|
||||||
|
|
||||||
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
|
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
|
||||||
XFREE(aead, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(aead, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user