QUIC: remove gQUIC Q044 support

While gQUIC Q044 is compatible with the IETF QUIC long headers format,
it is not the same. Remove gQUIC support since it is incomplete (flag
dissection is wrong, payload is not correctly dissected) and slows down
IETF QUIC dissector development. If support is restored, it should
likely be added as heuristics in packet-gquic.c

This is a manual revert of v2.9.0rc0-2173-g9fcb4af6b6 ("QUIC: gQUIC Q044
always use CHLO from gQUIC (with tag)") plus some other changes.

Change-Id: If75d81a4c38475f4e11fd8ade7252991f0ba0316
Reviewed-on: https://code.wireshark.org/review/31640
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Peter Wu 2019-01-21 00:08:39 +01:00 committed by Alexis La Goutte
parent 588c10a518
commit 7acb5caa9f
4 changed files with 3 additions and 83 deletions

View File

@ -356,7 +356,6 @@ set(DISSECTOR_PUBLIC_HEADERS
packet-gmr1_common.h
packet-gmr1_rr.h
packet-gprscdr.h
packet-gquic.h
packet-gre.h
packet-gsm_a_common.h
packet-gsm_a_rr.h

View File

@ -25,7 +25,6 @@ QUIC source code in Chromium : https://code.google.com/p/chromium/codesearch#chr
#include <epan/conversation.h>
#include <epan/dissectors/packet-http2.h>
#include <wsutil/strtoi.h>
#include "packet-gquic.h"
void proto_register_gquic(void);
void proto_reg_handoff_gquic(void);
@ -2017,44 +2016,6 @@ dissect_gquic_unencrypt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tre
}
int
dissect_gquic_ietf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, guint offset, guint32 version){
conversation_t *conv;
gquic_info_data_t *gquic_info;
guint64 pkn;
/* get conversation, create if necessary*/
conv = find_or_create_conversation(pinfo);
/* get associated state information, create if necessary */
gquic_info = (gquic_info_data_t *)conversation_get_proto_data(conv, proto_gquic);
if (!gquic_info) {
gquic_info = wmem_new(wmem_file_scope(), gquic_info_data_t);
gquic_info->version = (guint8)version;
gquic_info->encoding = ENC_LITTLE_ENDIAN;
gquic_info->version_valid = TRUE;
gquic_info->server_port = 443;
conversation_add_proto_data(conv, proto_gquic, gquic_info);
}
proto_tree_add_item_ret_uint64(gquic_tree, hf_gquic_packet_number, tvb, offset, 4, ENC_BIG_ENDIAN, &pkn);
offset += 4;
if (is_gquic_unencrypt(tvb, pinfo, offset, tvb_reported_length_remaining(tvb, offset), gquic_info)){
offset = dissect_gquic_unencrypt(tvb, pinfo, gquic_tree, offset, tvb_reported_length_remaining(tvb, offset), gquic_info);
}else { /* Payload... (encrypted... TODO FIX !) */
col_add_str(pinfo->cinfo, COL_INFO, "Payload (Encrypted)");
proto_tree_add_item(gquic_tree, hf_gquic_payload, tvb, offset, -1, ENC_NA);
offset += tvb_reported_length_remaining(tvb, offset);
}
col_append_fstr(pinfo->cinfo, COL_INFO, ", PKN: %" G_GINT64_MODIFIER "u", pkn);
return offset;
}
static int
dissect_gquic_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
void *data _U_)

View File

@ -1,31 +0,0 @@
/* packet-gquic.h
* Routines for (Google) Quick UDP Internet Connections dissection
* Copyright 2013, Alexis La Goutte <alexis.lagoutte at gmail dot com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __PACKET_GQUIC_H__
#define __PACKET_GQUIC_H__
int
dissect_gquic_ietf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, guint offset, guint32 version);
#endif
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/

View File

@ -27,7 +27,6 @@
#include "packet-tls.h"
#include <epan/prefs.h>
#include <wsutil/pint.h>
#include "packet-gquic.h"
#if GCRYPT_VERSION_NUMBER >= 0x010600 /* 1.6.0 */
/* Whether to provide support for authentication in addition to decryption. */
@ -292,10 +291,6 @@ static inline gboolean is_quic_draft_max(guint32 version, guint8 max_version) {
}
#endif
static inline guint8 is_gquic_version(guint32 version) {
return version == 0x51303434; /* Q044 is the first release to use IETF QUIC (draft-12) packet header */
}
const value_string quic_version_vals[] = {
{ 0x00000000, "Version Negotiation" },
{ 0x51303434, "Google Q044" },
@ -1920,10 +1915,6 @@ dissect_quic_long_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tre
offset = dissect_quic_long_header_common(tvb, pinfo, quic_tree, offset, quic_packet, &version, &dcid, &scid);
if (conn && conn->version == 0x51303434) { /* gQUIC Q044 */
return dissect_gquic_ietf(tvb, pinfo, quic_tree, offset, conn->version);
}
if (long_packet_type == QUIC_LPT_INITIAL) {
proto_tree_add_item_ret_varint(quic_tree, hf_quic_token_length, tvb, offset, -1, ENC_VARINT_QUIC, &token_length, &len_token_length);
offset += len_token_length;
@ -2126,7 +2117,7 @@ quic_get_message_tvb(tvbuff_t *tvb, const guint offset)
guint version = tvb_get_ntohl(tvb, offset + 1);
// If this is not a VN packet but a valid long form, extract a subset.
// TODO check for valid QUIC versions as future versions might change the format.
if (version != 0 && !is_gquic_version(version)) {
if (version != 0) {
guint8 cid_lengths = tvb_get_guint8(tvb, offset + 5);
guint8 dcil = cid_lengths >> 4;
guint8 scil = cid_lengths & 0xf;
@ -2356,9 +2347,9 @@ static gboolean dissect_quic_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree
}
offset += 1;
// check for draft QUIC version (for draft -11 and newer) or check for gQUIC version (= Q044)
// check for draft QUIC version (for draft -11 and newer)
version = tvb_get_ntohl(tvb, offset);
is_quic = (quic_draft_version(version) >= 11) || is_gquic_version(version);
is_quic = (quic_draft_version(version) >= 11);
if (is_quic) {
conversation = find_or_create_conversation(pinfo);