From: Todd Short Date: Wed, 26 May 2021 14:03:35 +0000 (-0400) Subject: Call SSLfatal when the generate_ticket_cb returns 0 X-Git-Tag: openssl-3.0.0-beta1~342 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e49095f186dcea5dbd902eae6cc81935063f782d;p=thirdparty%2Fopenssl.git Call SSLfatal when the generate_ticket_cb returns 0 Otherwise, the state machine ends up being in a bad state: ``` SSL routines:write_state_machine:missing fatal:ssl/statem/statem.c:XXX: ``` Reviewed-by: Matt Caswell Reviewed-by: Ben Kaduk (Merged from https://github.com/openssl/openssl/pull/15487) --- diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 386bd983fc4..56d4b4591a6 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -3945,9 +3945,10 @@ int tls_construct_new_session_ticket(SSL *s, WPACKET *pkt) } if (tctx->generate_ticket_cb != NULL && - tctx->generate_ticket_cb(s, tctx->ticket_cb_data) == 0) + tctx->generate_ticket_cb(s, tctx->ticket_cb_data) == 0) { + SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR); goto err; - + } /* * If we are using anti-replay protection then we behave as if * SSL_OP_NO_TICKET is set - we are caching tickets anyway so there