QUIC: Add support of GREASE Transport Parameter

Bug: 13881
Change-Id: Iaf72a14e227f0406edc8e8cbb71a63be95ec7eed
Reviewed-on: https://code.wireshark.org/review/34701
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2019-10-03 18:14:03 +02:00 committed by Anders Broman
parent dbfe1b2221
commit 21cfde4c6d
2 changed files with 22 additions and 2 deletions

View File

@ -1400,6 +1400,18 @@ const value_string quic_tp_preferred_address_vals[] = {
/* Lookup tables }}} */
void
quic_transport_parameter_id_base_custom(gchar *result, guint32 parameter_id)
{
/* GREASE ? https://tools.ietf.org/html/draft-ietf-quic-transport-23#section-18.1 */
if ( ( (parameter_id - 27) % 31) == 0 ) {
g_snprintf(result, ITEM_LABEL_LENGTH, "GREASE (0x%04x)", parameter_id);
} else {
g_snprintf(result, ITEM_LABEL_LENGTH, "%s (0x%04x)", val_to_str_const(parameter_id, quic_transport_parameter_id, "Unknown"), parameter_id);
}
}
/* we keep this internal to packet-tls-utils, as there should be
no need to access it any other way.
@ -6651,7 +6663,13 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv
proto_tree_add_item_ret_uint(parameter_tree, hf->hf.hs_ext_quictp_parameter_type,
tvb, offset, 2, ENC_BIG_ENDIAN, &parameter_type);
offset += 2;
proto_item_append_text(parameter_tree, ": %s", val_to_str(parameter_type, quic_transport_parameter_id, "Unknown"));
/* GREASE ? https://tools.ietf.org/html/draft-ietf-quic-transport-23#section-18.1 */
if ( ( (parameter_type - 27) % 31) == 0 ) {
proto_item_append_text(parameter_tree, ": GREASE");
} else {
proto_item_append_text(parameter_tree, ": %s", val_to_str(parameter_type, quic_transport_parameter_id, "Unknown"));
}
/* opaque value<0..2^16-1> */
if (!ssl_add_vector(hf, tvb, pinfo, parameter_tree, offset, next_offset, &parameter_length,

View File

@ -502,6 +502,8 @@ typedef struct {
gint ssl_get_keyex_alg(gint cipher);
void quic_transport_parameter_id_base_custom(gchar *result, guint32 parameter_id);
gboolean ssldecrypt_uat_fld_ip_chk_cb(void*, const char*, unsigned, const void*, const void*, char** err);
gboolean ssldecrypt_uat_fld_port_chk_cb(void*, const char*, unsigned, const void*, const void*, char** err);
gboolean ssldecrypt_uat_fld_fileopen_chk_cb(void*, const char*, unsigned, const void*, const void*, char** err);
@ -1913,7 +1915,7 @@ ssl_common_dissect_t name = { \
}, \
{ & name .hf.hs_ext_quictp_parameter_type, \
{ "Type", prefix ".quic.parameter.type", \
FT_UINT16, BASE_HEX, VALS(quic_transport_parameter_id), 0x00, \
FT_UINT16, BASE_CUSTOM, CF_FUNC(quic_transport_parameter_id_base_custom), 0x00, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_quictp_parameter_len, \