Commit 87489337 authored by J Mohan Rao Arisankala's avatar J Mohan Rao Arisankala Committed by Matt Caswell
Browse files

Cleanup ctxs if callback fail to retrieve session ticket



If tlsext ticket decrypt callback returns error, cleanup ctxs

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3273)
parent bb9ca2af
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3513,9 +3513,12 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
        int rv = tctx->tlsext_ticket_key_cb(s, nctick, nctick + 16,
                                            &ctx, &hctx, 0);
        if (rv < 0)
            return -1;
        if (rv == 0)
            goto err;
        if (rv == 0) {
            HMAC_CTX_cleanup(&hctx);
            EVP_CIPHER_CTX_cleanup(&ctx);
            return 2;
        }
        if (rv == 2)
            renew_ticket = 1;
    } else {