diff options
-rw-r--r-- | epan/dissectors/packet-quic.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-tls-utils.c | 64 | ||||
-rw-r--r-- | epan/dissectors/packet-tls-utils.h | 2 |
3 files changed, 39 insertions, 30 deletions
diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c index 576b02f6ef..f682028160 100644 --- a/epan/dissectors/packet-quic.c +++ b/epan/dissectors/packet-quic.c @@ -306,6 +306,7 @@ const value_string quic_version_vals[] = { { 0xff000010, "draft-16" }, { 0xff000011, "draft-17" }, { 0xff000012, "draft-18" }, + { 0xff000013, "draft-19" }, { 0, NULL } }; @@ -424,7 +425,7 @@ static const range_string quic_transport_error_code_vals[] = { { 0x0006, 0x0006, "FINAL_SIZE_ERROR" }, { 0x0007, 0x0007, "FRAME_ENCODING_ERROR" }, { 0x0008, 0x0008, "TRANSPORT_PARAMETER_ERROR" }, - { 0x0009, 0x0009, "VERSION_NEGOTIATION_ERROR" }, + { 0x0009, 0x0009, "VERSION_NEGOTIATION_ERROR" }, // removed in draft -19 { 0x000A, 0x000A, "PROTOCOL_VIOLATION" }, { 0x000C, 0x000C, "INVALID_MIGRATION" }, { 0x0100, 0x01FF, "CRYPTO_ERROR" }, diff --git a/epan/dissectors/packet-tls-utils.c b/epan/dissectors/packet-tls-utils.c index c5003a32c0..846efdf810 100644 --- a/epan/dissectors/packet-tls-utils.c +++ b/epan/dissectors/packet-tls-utils.c @@ -6631,6 +6631,7 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv * opaque value<0..2^16-1>; * } TransportParameter; * + * // draft -18 and before * struct { * select (Handshake.msg_type) { * case client_hello: @@ -6643,6 +6644,9 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv * TransportParameter parameters<0..2^16-1>; * } TransportParameters; * + * // since draft 19 + * TransportParameter TransportParameters<0..2^16-1>; + * * // draft -17 and before * struct { * enum { IPv4(4), IPv6(6), (15) } ipVersion; @@ -6662,39 +6666,43 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv * opaque statelessResetToken[16]; * } PreferredAddress; */ - switch (hnd_type) { - case SSL_HND_CLIENT_HELLO: - proto_tree_add_item(tree, hf->hf.hs_ext_quictp_initial_version, - tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - break; - case SSL_HND_ENCRYPTED_EXTENSIONS: - proto_tree_add_item(tree, hf->hf.hs_ext_quictp_negotiated_version, - tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - /* QuicVersion supported_versions<4..2^8-4>;*/ - if (!ssl_add_vector(hf, tvb, pinfo, tree, offset, offset_end, &supported_versions_length, - hf->hf.hs_ext_quictp_supported_versions_len, 4, G_MAXUINT8-3)) { - return offset_end; - } - offset += 1; - next_offset = offset + supported_versions_length; - - while (offset < next_offset) { - proto_tree_add_item(tree, hf->hf.hs_ext_quictp_supported_versions, + // Heuristically detect draft -18 vs draft -19. + if (offset_end - offset >= 4 && tvb_get_ntoh24(tvb, offset) == 0xff0000) { + // Draft -18 and before start with a (draft) version field. + switch (hnd_type) { + case SSL_HND_CLIENT_HELLO: + proto_tree_add_item(tree, hf->hf.hs_ext_quictp_initial_version, + tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + break; + case SSL_HND_ENCRYPTED_EXTENSIONS: + proto_tree_add_item(tree, hf->hf.hs_ext_quictp_negotiated_version, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + /* QuicVersion supported_versions<4..2^8-4>;*/ + if (!ssl_add_vector(hf, tvb, pinfo, tree, offset, offset_end, &supported_versions_length, + hf->hf.hs_ext_quictp_supported_versions_len, 4, G_MAXUINT8-3)) { + return offset_end; + } + offset += 1; + next_offset = offset + supported_versions_length; + + while (offset < next_offset) { + proto_tree_add_item(tree, hf->hf.hs_ext_quictp_supported_versions, + tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + } + break; + case SSL_HND_NEWSESSION_TICKET: + break; + default: + return offset; } - break; - case SSL_HND_NEWSESSION_TICKET: - break; - default: - return offset; } - /* TransportParameter parameters<22..2^16-1>; */ + /* TransportParameter TransportParameters<0..2^16-1>; */ if (!ssl_add_vector(hf, tvb, pinfo, tree, offset, offset_end, &quic_length, - hf->hf.hs_ext_quictp_len, 22, G_MAXUINT16)) { + hf->hf.hs_ext_quictp_len, 0, G_MAXUINT16)) { return offset_end; } offset += 2; @@ -6737,7 +6745,7 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv case SSL_HND_QUIC_TP_IDLE_TIMEOUT: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_idle_timeout, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u secs", value); + proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u ms", value); offset += len; break; case SSL_HND_QUIC_TP_STATELESS_RESET_TOKEN: diff --git a/epan/dissectors/packet-tls-utils.h b/epan/dissectors/packet-tls-utils.h index 1b3bc42388..74c717f941 100644 --- a/epan/dissectors/packet-tls-utils.h +++ b/epan/dissectors/packet-tls-utils.h @@ -1920,7 +1920,7 @@ ssl_common_dissect_t name = { \ { & name .hf.hs_ext_quictp_parameter_idle_timeout, \ { "idle_timeout", prefix ".quic.parameter.idle_timeout", \ FT_UINT64, BASE_DEC, NULL, 0x00, \ - "In seconds", HFILL } \ + "In milliseconds", HFILL } \ }, \ { & name .hf.hs_ext_quictp_parameter_stateless_reset_token, \ { "stateless_reset_token", prefix ".quic.parameter.stateless_reset_token", \ |