From 2ed80d14d7159de7b52c7720128459e8c24a94d5 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 15 Oct 2014 02:01:16 +0100 Subject: [PATCH] Fix for session tickets memory leak. CVE-2014-3567 Reviewed-by: Rich Salz Reviewed-by: Matt Caswell (cherry picked from commit 90e53055939db40cf0fac1ad0c59630280aeee86) --- ssl/t1_lib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 8638eb9a41..68c527dfdf 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -1101,7 +1101,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); goto tickerr; + } /* 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); -- 2.34.1