Fix for session tickets memory leak.
authorDr. Stephen Henson <steve@openssl.org>
Wed, 15 Oct 2014 01:01:16 +0000 (02:01 +0100)
committerGeoff Thorpe <geoff@openssl.org>
Wed, 15 Oct 2014 12:49:50 +0000 (08:49 -0400)
CVE-2014-3567

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
ssl/t1_lib.c

index 60c7d8bca952f19b84e2f64066f438b4b350b804..87181762d81d8172ae15f4f5e68cd93cfc5ac025 100644 (file)
@@ -1830,7 +1830,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);