From: Jouni Malinen Date: Tue, 16 Feb 2016 11:13:36 +0000 (+0200) Subject: OpenSSL: Fix memory leak in HMAC_CTX compatibility wrapper function X-Git-Tag: hostap_2_6~908 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03e3ddf84e97f193efedd88a380cfcedfff89587;p=thirdparty%2Fhostap.git OpenSSL: Fix memory leak in HMAC_CTX compatibility wrapper function Commit 5c9a33702fd9e9ae9c349d6461a6621801d4f9cb ('OpenSSL: Clean up crypto_hash_*() to use a single implementation') added a wrapper function to allow the new OpenSSL API to be used with older OpenSSL versions. However, the HMAC_CTX_free() wrapper was incorrectly skipping the call to HMAC_CTX_cleanup() which is still needed to free the resources OpenSSL allocated internally. Signed-off-by: Jouni Malinen --- diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index 7c3600234..ee20b37f0 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -47,6 +47,7 @@ static HMAC_CTX * HMAC_CTX_new(void) static void HMAC_CTX_free(HMAC_CTX *ctx) { + HMAC_CTX_cleanup(ctx); bin_clear_free(ctx, sizeof(*ctx)); }