]> 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 19:06:49 +0000 (12:06 -0700)
Otherwise, the state machine ends up being in a bad state:
```
SSL routines:write_state_machine:missing fatal:ssl/statem/statem.c:850:
```

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/15485)

ssl/statem/statem_srvr.c

index fec12f613004e975ef2ff102a89d1244cf7e52bb..30d20f129729f70686fee6f66927809430694ff5 100644 (file)
@@ -4139,9 +4139,12 @@ 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,
+                 SSL_F_TLS_CONSTRUCT_NEW_SESSION_TICKET,
+                 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