]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Call SSLfatal when the generate_ticket_cb returns 0
authorTodd Short <tshort@akamai.com>
Wed, 26 May 2021 14:03:35 +0000 (10:03 -0400)
committerBenjamin Kaduk <bkaduk@akamai.com>
Thu, 27 May 2021 18:54:32 +0000 (11:54 -0700)
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 <matt@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/15487)

ssl/statem/statem_srvr.c

index 386bd983fc49b8fd3ac63a28be1c04e22aad4113..56d4b4591a6df48569bf7970d79784b1e6490732 100644 (file)
@@ -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