From d5f2ae83e58c3787cc9c602f64ede8199dfa352c Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 9 Mar 2017 20:39:12 +0100 Subject: [PATCH] fixed memory leak recently introduced with openssl-1.1.0 changes --- libretroshare/src/crypto/chacha20.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libretroshare/src/crypto/chacha20.cpp b/libretroshare/src/crypto/chacha20.cpp index 2653a7046..ed26b1b42 100644 --- a/libretroshare/src/crypto/chacha20.cpp +++ b/libretroshare/src/crypto/chacha20.cpp @@ -545,6 +545,8 @@ bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint3 HMAC_Update(&hmac_ctx,aad,aad_size) ; HMAC_Update(&hmac_ctx,data,data_size) ; HMAC_Final(&hmac_ctx,computed_tag,&md_size) ; + + HMAC_CTX_cleanup(&hmac_ctx) ; #else HMAC_CTX *hmac_ctx = HMAC_CTX_new(); @@ -576,6 +578,8 @@ bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint3 HMAC_Update(&hmac_ctx,aad,aad_size) ; HMAC_Update(&hmac_ctx,data,data_size) ; HMAC_Final(&hmac_ctx,computed_tag,&md_size) ; + + HMAC_CTX_cleanup(&hmac_ctx) ; #else HMAC_CTX *hmac_ctx = HMAC_CTX_new();