summaryrefslogtreecommitdiffstats
path: root/ssl/t1_trce.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2017-02-26 03:14:53 +0000
committerDr. Stephen Henson <steve@openssl.org>2017-02-26 18:26:09 +0000
commit26212351b624376bebac447fc3b8434d335c579f (patch)
tree19cc9641ec16bf3f27fa0995a6cf6a199a697912 /ssl/t1_trce.c
parent52434847b10858548f32be086d2855b4beb94a78 (diff)
print out alpn extension
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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ssl/t1_trce.c b/ssl/t1_trce.c
index 190be97eee..6e65a4b35c 100644
--- a/ssl/t1_trce.c
+++ b/ssl/t1_trce.c
@@ -468,6 +468,8 @@ static ssl_trace_tbl ssl_exts_tbl[] = {
# ifndef OPENSSL_NO_NEXTPROTONEG
{TLSEXT_TYPE_next_proto_neg, "next_proto_neg"},
# endif
+ {TLSEXT_TYPE_application_layer_protocol_negotiation,
+ "application_layer_protocol_negotiation"},
{TLSEXT_TYPE_signed_certificate_timestamp, "signed_certificate_timestamps"},
{TLSEXT_TYPE_padding, "padding"},
{TLSEXT_TYPE_encrypt_then_mac, "encrypt_then_mac"},
@@ -693,6 +695,24 @@ static int ssl_print_extension(BIO *bio, int indent, int server,
if (extlen != xlen + 2)
return 0;
return ssl_trace_list(bio, indent + 2, ext + 2, xlen, 2, ssl_groups_tbl);
+ case TLSEXT_TYPE_application_layer_protocol_negotiation:
+ if (extlen < 2)
+ return 0;
+ xlen = (ext[0] << 8) | ext[1];
+ if (extlen != xlen + 2)
+ return 0;
+ ext += 2;
+ while (xlen > 0) {
+ size_t plen = *ext++;
+ if (plen > xlen + 1)
+ return 0;
+ BIO_indent(bio, indent + 2, 80);
+ BIO_write(bio, ext, plen);
+ BIO_puts(bio, "\n");
+ ext += plen;
+ xlen -= plen + 1;
+ }
+ return 1;
case TLSEXT_TYPE_signature_algorithms: