summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2016-10-07 12:35:41 +0200
committerAnders Broman <a.broman58@gmail.com>2016-10-12 03:52:04 +0000
commit9434f25275b1ff838a9976903f180de7da4b00e4 (patch)
treee6a3bbb21ed0e3da9c08c875f163767127c77ece
parentaa78460ef9793ea56f79ef353e9f6af3805799f8 (diff)
downloadwireshark-9434f25275b1ff838a9976903f180de7da4b00e4.tar.gz
TLS(1.3): Add Supported Versions (43) Hello extension
Ping-Bug: 12779 Change-Id: Ia8dcfcb300f4da3bf270d9512fbcc85a7b1a8671 Reviewed-on: https://code.wireshark.org/review/18108 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: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-ssl-utils.c30
-rw-r--r--epan/dissectors/packet-ssl-utils.h15
2 files changed, 44 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index a30ec25b0c..303868e326 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -80,6 +80,11 @@ const value_string ssl_versions[] = {
{ TLSV1DOT1_VERSION, "TLS 1.1" },
{ TLSV1DOT2_VERSION, "TLS 1.2" },
{ TLSV1DOT3_VERSION, "TLS 1.3" },
+ { 0x7F0E, "TLS 1.3 (draft 14)" },
+ { 0x7F0F, "TLS 1.3 (draft 15)" },
+ { 0x7F10, "TLS 1.3 (draft 16)" },
+ { 0x7F11, "TLS 1.3 (draft 17)" },
+ { 0x7F12, "TLS 1.3 (draft 18)" },
{ DTLSV1DOT0_OPENSSL_VERSION, "DTLS 1.0 (OpenSSL pre 0.9.8f)" },
{ DTLSV1DOT0_VERSION, "DTLS 1.0" },
{ DTLSV1DOT2_VERSION, "DTLS 1.2" },
@@ -1161,6 +1166,7 @@ const value_string tls_hello_extension_types[] = {
{ SSL_HND_HELLO_EXT_KEY_SHARE, "key_share" }, /* TLS 1.3 https://tools.ietf.org/html/draft-ietf-tls-tls13 */
{ SSL_HND_HELLO_EXT_PRE_SHARED_KEY, "pre_shared_key" }, /* TLS 1.3 https://tools.ietf.org/html/draft-ietf-tls-tls13 */
{ SSL_HND_HELLO_EXT_EARLY_DATA, "early_data" }, /* TLS 1.3 https://tools.ietf.org/html/draft-ietf-tls-tls13 */
+ { SSL_HND_HELLO_EXT_SUPPORTED_VERSIONS, "supported_versions" }, /* TLS 1.3 https://tools.ietf.org/html/draft-ietf-tls-tls13 */
{ SSL_HND_HELLO_EXT_COOKIE, "cookie" }, /* TLS 1.3 https://tools.ietf.org/html/draft-ietf-tls-tls13 */
{ SSL_HND_HELLO_EXT_NPN, "next_protocol_negotiation"}, /* http://technotes.googlecode.com/git/nextprotoneg.html */
{ SSL_HND_HELLO_EXT_CHANNEL_ID_OLD, "channel_id_old" }, /* http://tools.ietf.org/html/draft-balfanz-tls-channelid-00
@@ -5643,6 +5649,27 @@ ssl_dissect_hnd_hello_ext_early_data(ssl_common_dissect_t *hf, tvbuff_t *tvb,
}
static gint
+ssl_dissect_hnd_hello_ext_supported_versions(ssl_common_dissect_t *hf, tvbuff_t *tvb,
+ proto_tree *tree, guint32 offset, guint32 ext_len)
+{
+ guint32 offset_end = offset + ext_len;
+
+ if (ext_len < 1) {
+ return offset;
+ }
+
+ proto_tree_add_item(tree, hf->hf.hs_ext_supported_versions_len, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset += 1;
+
+ while(offset_end - offset >= 2){
+ proto_tree_add_item(tree, hf->hf.hs_ext_supported_versions, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset += 2;
+ }
+
+ 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)
{
@@ -6809,6 +6836,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_SUPPORTED_VERSIONS:
+ offset = ssl_dissect_hnd_hello_ext_supported_versions(hf, tvb, ext_tree, offset, ext_len);
+ break;
case SSL_HND_HELLO_EXT_COOKIE:
offset = ssl_dissect_hnd_hello_ext_cookie(hf, tvb, ext_tree, offset, ext_len);
break;
diff --git a/epan/dissectors/packet-ssl-utils.h b/epan/dissectors/packet-ssl-utils.h
index 2278008972..2ba7e0f1f5 100644
--- a/epan/dissectors/packet-ssl-utils.h
+++ b/epan/dissectors/packet-ssl-utils.h
@@ -169,6 +169,7 @@ typedef enum {
#define SSL_HND_HELLO_EXT_KEY_SHARE 40
#define SSL_HND_HELLO_EXT_PRE_SHARED_KEY 41
#define SSL_HND_HELLO_EXT_EARLY_DATA 42
+#define SSL_HND_HELLO_EXT_SUPPORTED_VERSIONS 43
#define SSL_HND_HELLO_EXT_COOKIE 44
#define SSL_HND_HELLO_EXT_NPN 13712 /* 0x3374 */
#define SSL_HND_HELLO_EXT_CHANNEL_ID_OLD 30031 /* 0x754f */
@@ -683,6 +684,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_supported_versions_len;
+ gint hs_ext_supported_versions;
gint hs_ext_cookie_len;
gint hs_ext_cookie;
gint hs_ext_server_name;
@@ -888,7 +891,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, \
+ -1, -1, -1, -1, -1, -1, \
}, \
/* ett */ { \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
@@ -1062,6 +1065,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_supported_versions_len, \
+ { "Supported Versions length", prefix ".handshake.extensions.supported_versions_len", \
+ FT_UINT8, BASE_DEC, NULL, 0x0, \
+ NULL, HFILL } \
+ }, \
+ { & name .hf.hs_ext_supported_versions, \
+ { "Supported Versions", prefix ".handshake.extensions.supported_versions", \
+ FT_UINT16, BASE_HEX, VALS(ssl_versions), 0x0, \
+ NULL, HFILL } \
+ }, \
{ & name .hf.hs_ext_cookie_len, \
{ "Cookie length", prefix ".handshake.extensions.cookie_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \