aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-quic.c
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2020-10-27 19:48:21 +0100
committerNardi Ivan <nardi.ivan@gmail.com>2020-10-31 15:54:12 +0100
commitcafdab3967050caedfaef66a60d5162b695f161a (patch)
tree1f7bfdb3068d461f3bb40cf9e701e580a74ed2a8 /epan/dissectors/packet-quic.c
parentb6222766cce1befd7f696a67df57c9e63ad963b6 (diff)
QUIC: allow dissection of sessions forcing version negotiation
Right now, these sessions are not dissected as QUIC, let alone decrypted
Diffstat (limited to 'epan/dissectors/packet-quic.c')
-rw-r--r--epan/dissectors/packet-quic.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c
index ed870ac4c8..58f63220a4 100644
--- a/epan/dissectors/packet-quic.c
+++ b/epan/dissectors/packet-quic.c
@@ -384,6 +384,16 @@ static inline guint8 quic_draft_version(guint32 version) {
version == 0x54303531) {
return 27;
}
+ /* https://tools.ietf.org/html/draft-ietf-quic-transport-32#section-15
+ "Versions that follow the pattern 0x?a?a?a?a are reserved for use in
+ forcing version negotiation to be exercised"
+ It is tricky to return a correct draft version: such number is primarly
+ used to select a proper salt (which depends on the version itself), but
+ we don't have a real version here! Let's hope that we need to handle
+ only latest drafts... */
+ if ((version & 0x0F0F0F0F) == 0x0a0a0a0a) {
+ return 29;
+ }
return 0;
}
@@ -2545,6 +2555,7 @@ dissect_quic_long_header_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *q
{
guint32 version;
guint32 dcil, scil;
+ proto_item *ti;
version = tvb_get_ntohl(tvb, offset);
@@ -2552,7 +2563,10 @@ dissect_quic_long_header_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *q
*version_out = version;
}
- proto_tree_add_item(quic_tree, hf_quic_version, tvb, offset, 4, ENC_BIG_ENDIAN);
+ ti = proto_tree_add_item(quic_tree, hf_quic_version, tvb, offset, 4, ENC_BIG_ENDIAN);
+ if ((version & 0x0F0F0F0F) == 0x0a0a0a0a) {
+ proto_item_append_text(ti, " (Forcing Version Negotiation)");
+ }
offset += 4;
proto_tree_add_item_ret_uint(quic_tree, hf_quic_dcil, tvb, offset, 1, ENC_BIG_ENDIAN, &dcil);