Commit 9fb6cb81 authored by Matt Caswell's avatar Matt Caswell
Browse files

Fix bug where early_data does not work if no SNI callback is present



Fixes #4496

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
Reviewed-by: default avatarBen Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/4519)
parent 549be253
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -834,6 +834,11 @@ static int final_server_name(SSL *s, unsigned int context, int sent,
        ret = s->session_ctx->ext.servername_cb(s, &altmp,
                                       s->session_ctx->ext.servername_arg);

    if (!sent) {
        OPENSSL_free(s->session->ext.hostname);
        s->session->ext.hostname = NULL;
    }

    /*
     * If we're expecting to send a ticket, and tickets were previously enabled,
     * and now tickets are disabled, then turn off expected ticket.