summaryrefslogtreecommitdiffstats
path: root/crypto/evp/e_chacha20_poly1305.c
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-01-26 13:01:30 +0900
committerRich Salz <rsalz@openssl.org>2017-02-15 20:00:34 -0500
commita8f957686675194d786b41f6e1f7c48bb85723ec (patch)
tree59c2c1982811b4c8a7c9de6fb511a63eec39df1d /crypto/evp/e_chacha20_poly1305.c
parent8653e78f4319b23d60239f9557d8c1e1d23be1a5 (diff)
Properly zero cipher_data for ChaCha20-Poly1305 on cleanup
Fix a typo. Probably this has not been found because EVP_CIPHER_CTX is smaller than EVP_CHACHA_AEAD_CTX and heap overflow does not occur. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2294)
Diffstat (limited to 'crypto/evp/e_chacha20_poly1305.c')
-rw-r--r--crypto/evp/e_chacha20_poly1305.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/e_chacha20_poly1305.c b/crypto/evp/e_chacha20_poly1305.c
index 46bc2cb44f..7fd4f8dfe7 100644
--- a/crypto/evp/e_chacha20_poly1305.c
+++ b/crypto/evp/e_chacha20_poly1305.c
@@ -316,7 +316,7 @@ static int chacha20_poly1305_cleanup(EVP_CIPHER_CTX *ctx)
{
EVP_CHACHA_AEAD_CTX *actx = aead_data(ctx);
if (actx)
- OPENSSL_cleanse(ctx->cipher_data, sizeof(*ctx) + Poly1305_ctx_size());
+ OPENSSL_cleanse(ctx->cipher_data, sizeof(*actx) + Poly1305_ctx_size());
return 1;
}