aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorEdward Dao <edmailbox@gmail.com>2015-03-21 09:33:50 -0700
committerAnders Broman <a.broman58@gmail.com>2015-03-24 05:08:42 +0000
commit570bc36b587de3af3b2321d8a03f8cc88973fb00 (patch)
tree9649dc63839922ff9effa4dc8ae307cbecdab92f /epan
parentae20651d9a517ee3d37fa8b840b1c2b7bf5ceeac (diff)
http2: fix dissection over TLS
Previously, the http2 heuristics dissector sets a conversation dissector which overrides the SSL dissector, breaking SSL decryption before http2. This patch fixes that by checking for an active http2 session in the http2 heuristics dissector. Change-Id: Ibacbcde3e29bbb746ad2e394f1c10ca571b07bf5 Reviewed-on: https://code.wireshark.org/review/7782 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>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-http2.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c
index 9530ceded3..0ca4ea7bf9 100644
--- a/epan/dissectors/packet-http2.c
+++ b/epan/dissectors/packet-http2.c
@@ -1423,6 +1423,17 @@ static gboolean
dissect_http2_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *conversation;
+ http2_session_t *session;
+
+ conversation = find_or_create_conversation(pinfo);
+ session = (http2_session_t *)conversation_get_proto_data(conversation,
+ proto_http2);
+ /* A http2 conversation was previously started, assume it is still active */
+ if (session) {
+ dissect_http2(tvb, pinfo, tree, data);
+ return TRUE;
+ }
+
if (tvb_memeql(tvb, 0, kMagicHello, MAGIC_FRAME_LENGTH) != 0) {
/* we couldn't find the Magic Hello (PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n)
@@ -1433,10 +1444,8 @@ dissect_http2_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
return FALSE;
}
- /* Once switched to HTTP2, then future messages are also part of HTTP2. */
- conversation = find_or_create_conversation(pinfo);
- conversation_set_dissector(conversation, http2_handle);
-
+ /* Remember http2 conversation. */
+ get_http2_session(pinfo);
dissect_http2(tvb, pinfo, tree, data);
return (TRUE);