From: Dr. Stephen Henson Date: Wed, 15 Oct 2014 00:53:55 +0000 (+0100) Subject: Fix for session tickets memory leak. X-Git-Tag: OpenSSL_1_0_1j~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7fd4ce6a997be5f5c9e744ac527725c2850de203;p=oweals%2Fopenssl.git Fix for session tickets memory leak. CVE-2014-3567 Reviewed-by: Rich Salz Reviewed-by: Matt Caswell (cherry picked from commit 5dc6070a03779cd524f0e67f76c945cb0ac38320) --- diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 12ee3c9a10..d6aff4b682 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -2348,7 +2348,10 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, HMAC_Final(&hctx, tick_hmac, NULL); HMAC_CTX_cleanup(&hctx); if (CRYPTO_memcmp(tick_hmac, etick + eticklen, mlen)) + { + EVP_CIPHER_CTX_cleanup(&ctx); return 2; + } /* Attempt to decrypt session data */ /* Move p after IV to start of encrypted ticket, update length */ p = etick + 16 + EVP_CIPHER_CTX_iv_length(&ctx);