TLS: Enhance display of Hello Extension

Append the length to the extension and display the contents of
unknown extensions as bytes.

Change-Id: Iba1204a1d5e187f28cb41c4369b10eeb86e6b43a
Reviewed-on: https://code.wireshark.org/review/17265
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexis La Goutte 2016-08-23 13:38:27 +02:00 committed by Michael Mann
parent 193e366a3f
commit 2fb9cbd9ad
1 changed files with 4 additions and 6 deletions

View File

@ -6429,9 +6429,9 @@ ssl_dissect_hnd_hello_ext(ssl_common_dissect_t *hf, tvbuff_t *tvb, proto_tree *t
ext_len = tvb_get_ntohs(tvb, offset + 2); ext_len = tvb_get_ntohs(tvb, offset + 2);
ext_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4 + ext_len, hf->ett.hs_ext, NULL, ext_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4 + ext_len, hf->ett.hs_ext, NULL,
"Extension: %s", val_to_str(ext_type, "Extension: %s (len=%u)", val_to_str(ext_type,
tls_hello_extension_types, tls_hello_extension_types,
"Unknown %u")); "Unknown type %u"), ext_len);
proto_tree_add_uint(ext_tree, hf->hf.hs_ext_type, proto_tree_add_uint(ext_tree, hf->hf.hs_ext_type,
tvb, offset, 2, ext_type); tvb, offset, 2, ext_type);
@ -6499,10 +6499,8 @@ ssl_dissect_hnd_hello_ext(ssl_common_dissect_t *hf, tvbuff_t *tvb, proto_tree *t
ssl->state |= (is_client ? SSL_CLIENT_EXTENDED_MASTER_SECRET : SSL_SERVER_EXTENDED_MASTER_SECRET); ssl->state |= (is_client ? SSL_CLIENT_EXTENDED_MASTER_SECRET : SSL_SERVER_EXTENDED_MASTER_SECRET);
break; break;
default: default:
proto_tree_add_bytes_format(ext_tree, hf->hf.hs_ext_data, proto_tree_add_item(ext_tree, hf->hf.hs_ext_data,
tvb, offset, ext_len, NULL, tvb, offset, ext_len, ENC_NA);
"Data (%u byte%s)",
ext_len, plurality(ext_len, "", "s"));
offset += ext_len; offset += ext_len;
break; break;
} }