Teach SSL_trace() about the early_data_info extension
authorMatt Caswell <matt@openssl.org>
Fri, 17 Feb 2017 17:41:46 +0000 (17:41 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 2 Mar 2017 17:44:14 +0000 (17:44 +0000)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2737)

ssl/t1_trce.c

index e99a2ceca852f6349b01f6566dc7492bd7ebe5a7..459827b76d62dfca77696b32d81b979bf449d96d 100644 (file)
@@ -475,7 +475,8 @@ static ssl_trace_tbl ssl_exts_tbl[] = {
     {TLSEXT_TYPE_signed_certificate_timestamp, "signed_certificate_timestamps"},
     {TLSEXT_TYPE_padding, "padding"},
     {TLSEXT_TYPE_encrypt_then_mac, "encrypt_then_mac"},
-    {TLSEXT_TYPE_extended_master_secret, "extended_master_secret"}
+    {TLSEXT_TYPE_extended_master_secret, "extended_master_secret"},
+    {TLSEXT_TYPE_early_data_info, "ticket_early_data_info"}
 };
 
 static ssl_trace_tbl ssl_groups_tbl[] = {
@@ -680,6 +681,7 @@ static int ssl_print_extension(BIO *bio, int indent, int server,
 {
     size_t xlen, share_len;
     unsigned int sigalg;
+    uint32_t max_early_data;
 
     BIO_indent(bio, indent, 80);
     BIO_printf(bio, "extension_type=%s(%d), length=%d\n",
@@ -830,6 +832,15 @@ static int ssl_print_extension(BIO *bio, int indent, int server,
         return ssl_trace_list(bio, indent + 2, ext + 1, xlen, 1,
                               ssl_psk_kex_modes_tbl);
 
+    case TLSEXT_TYPE_early_data_info:
+        if (extlen != 4)
+            return 0;
+        max_early_data = (ext[0] << 24) | (ext[1] << 16) | (ext[2] << 8)
+                         | ext[3];
+        BIO_indent(bio, indent + 2, 80);
+        BIO_printf(bio, "max_early_data=%u\n", max_early_data);
+        break;
+
     default:
         BIO_dump_indent(bio, (const char *)ext, extlen, indent + 2);
     }