summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-04-04 14:28:23 +0100
committerMatt Caswell <matt@openssl.org>2018-04-17 16:51:03 +0100
commit7f9f5f71e48b12b6029871cbf8542f21c7883c6c (patch)
tree1b2028dbb1b6aca57881c83695f46d1c0d7409a4 /ssl
parentc2c1d8a495d540e0b1b61f20c2c14f0c7ab7a8f0 (diff)
Make sure info callback knows about all handshake start events
The first session ticket sent by the server is actually tacked onto the end of the first handshake from a state machine perspective. However in reality this is a post-handshake message, and should be preceeded by a handshake start event from an info callback perspective. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5874)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/statem/statem_srvr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index 60e0bc7373..7e033ceb16 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -3716,6 +3716,23 @@ int tls_construct_new_session_ticket(SSL *s, WPACKET *pkt)
} age_add_u;
if (SSL_IS_TLS13(s)) {
+ if (s->post_handshake_auth != SSL_PHA_EXT_RECEIVED) {
+ void (*cb) (const SSL *ssl, int type, int val) = NULL;
+
+ /*
+ * This is the first session ticket we've sent. In the state
+ * machine we "cheated" and tacked this onto the end of the first
+ * handshake. From an info callback perspective this should appear
+ * like the start of a new handshake.
+ */
+ if (s->info_callback != NULL)
+ cb = s->info_callback;
+ else if (s->ctx->info_callback != NULL)
+ cb = s->ctx->info_callback;
+ if (cb != NULL)
+ cb(s, SSL_CB_HANDSHAKE_START, 1);
+ }
+
if (!ssl_generate_session_id(s, s->session)) {
/* SSLfatal() already called */
goto err;