summaryrefslogtreecommitdiffstats
path: root/ssl/t1_trce.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2017-02-26 13:40:03 +0000
committerDr. Stephen Henson <steve@openssl.org>2017-02-26 18:26:09 +0000
commit5032abdfa817f86a722f9342cf57eee346c4f313 (patch)
tree817b4245e9013e24b95cda2793eaaa0b848b29dd /ssl/t1_trce.c
parent26212351b624376bebac447fc3b8434d335c579f (diff)
TLS 1.3 support for ssl_print_ticket()
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2747)
Diffstat (limited to 'ssl/t1_trce.c')
-rw-r--r--ssl/t1_trce.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/ssl/t1_trce.c b/ssl/t1_trce.c
index 6e65a4b35c..78c794d279 100644
--- a/ssl/t1_trce.c
+++ b/ssl/t1_trce.c
@@ -1265,7 +1265,7 @@ static int ssl_print_cert_request(BIO *bio, int indent, SSL *s,
return 1;
}
-static int ssl_print_ticket(BIO *bio, int indent,
+static int ssl_print_ticket(BIO *bio, int indent, SSL *s,
const unsigned char *msg, size_t msglen)
{
unsigned int tick_life;
@@ -1281,8 +1281,23 @@ static int ssl_print_ticket(BIO *bio, int indent,
msg += 4;
BIO_indent(bio, indent + 2, 80);
BIO_printf(bio, "ticket_lifetime_hint=%u\n", tick_life);
+ if (SSL_IS_TLS13(s)) {
+ unsigned int ticket_age_add;
+ if (msglen < 4)
+ return 0;
+ ticket_age_add = (msg[0] << 24) | (msg[1] << 16) | (msg[2] << 8)
+ | msg[3];
+ msglen -= 4;
+ msg += 4;
+ BIO_indent(bio, indent + 2, 80);
+ BIO_printf(bio, "ticket_age_add=%u\n", ticket_age_add);
+ }
if (!ssl_print_hexbuf(bio, indent + 2, "ticket", 2, &msg, &msglen))
return 0;
+ if (SSL_IS_TLS13(s) && !ssl_print_extensions(bio, indent + 2, 0,
+ SSL3_MT_NEWSESSION_TICKET,
+ &msg, &msglen))
+ return 0;
if (msglen)
return 0;
return 1;
@@ -1368,7 +1383,7 @@ static int ssl_print_handshake(BIO *bio, SSL *ssl, int server,
break;
case SSL3_MT_NEWSESSION_TICKET:
- if (!ssl_print_ticket(bio, indent + 2, msg, msglen))
+ if (!ssl_print_ticket(bio, indent + 2, ssl, msg, msglen))
return 0;
break;