TLS(1.3): Add cookie (44) hello extension

Ping-Bug: 12779
Change-Id: I94d492d126050fdff6f98608f9d68d55c19e0a50
Reviewed-on: https://code.wireshark.org/review/18092
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2016-09-29 10:17:07 +02:00 committed by Anders Broman
parent 40d23eb23a
commit 6529b36c54
2 changed files with 36 additions and 1 deletions

View File

@ -5632,6 +5632,26 @@ ssl_dissect_hnd_hello_ext_early_data(ssl_common_dissect_t *hf, tvbuff_t *tvb,
return offset;
}
static gint
ssl_dissect_hnd_hello_ext_cookie(ssl_common_dissect_t *hf, tvbuff_t *tvb,
proto_tree *tree, guint32 offset, guint32 ext_len)
{
if (ext_len < 2) {
return offset;
}
proto_tree_add_item(tree, hf->hf.hs_ext_cookie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
ext_len -= 2;
proto_tree_add_item(tree, hf->hf.hs_ext_cookie, tvb, offset, ext_len, ENC_NA);
offset += ext_len;
return offset;
}
static gint
ssl_dissect_hnd_hello_ext_server_name(ssl_common_dissect_t *hf, tvbuff_t *tvb,
proto_tree *tree, guint32 offset, guint32 ext_len)
@ -6754,6 +6774,9 @@ ssl_dissect_hnd_hello_ext(ssl_common_dissect_t *hf, tvbuff_t *tvb, proto_tree *t
case SSL_HND_HELLO_EXT_EARLY_DATA:
offset = ssl_dissect_hnd_hello_ext_early_data(hf, tvb, ext_tree, offset, ext_len, hnd_type);
break;
case SSL_HND_HELLO_EXT_COOKIE:
offset = ssl_dissect_hnd_hello_ext_cookie(hf, tvb, ext_tree, offset, ext_len);
break;
case SSL_HND_HELLO_EXT_DRAFT_VERSION_TLS13:
proto_tree_add_item(ext_tree, hf->hf.hs_ext_draft_version_tls13,
tvb, offset, 2, ENC_BIG_ENDIAN);

View File

@ -681,6 +681,8 @@ typedef struct ssl_common_dissect {
gint hs_ext_psk_identity;
gint hs_ext_psk_identity_selected;
gint hs_ext_early_data_obfuscated_ticket_age;
gint hs_ext_cookie_len;
gint hs_ext_cookie;
gint hs_ext_server_name;
gint hs_ext_server_name_len;
gint hs_ext_server_name_list_len;
@ -879,7 +881,7 @@ ssl_common_dissect_t name = { \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, \
-1, -1, -1, \
}, \
/* ett */ { \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
@ -1048,6 +1050,16 @@ ssl_common_dissect_t name = { \
FT_UINT32, BASE_DEC, NULL, 0x0, \
"The time since the client learned about the server configuration that it is using, in milliseconds", HFILL } \
}, \
{ & name .hf.hs_ext_cookie_len, \
{ "Cookie length", prefix ".handshake.extensions.cookie_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cookie, \
{ "Cookie", prefix ".handshake.extensions.cookie", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_server_name_list_len, \
{ "Server Name list length", prefix ".handshake.extensions_server_name_list_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \