aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-turnchannel.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-05-26 10:53:03 -0700
committerGuy Harris <guy@alum.mit.edu>2018-05-26 17:54:07 +0000
commit59b2ea5129bfa3046ee2ffc21a6f2564ecbf78f0 (patch)
tree09c0c47e0e442d9d5d25d36a2a7c669ee27bac99 /epan/dissectors/packet-turnchannel.c
parente299b4098b0677bb1598bfe332fc8be6ea10fb99 (diff)
Fix STUN-over-SSL/TLS/DTLS.
Different dissectors are required for protocols running atop SSL/TLS and protocols running atop DTLS - SSL/TLS provides a byte-stream service, so there's no guarantee that there's a correspondence between SSL/TLS application data record boundaries and packet boundaries, but DTLS provides a datagram service, with packet boundaries corresponding to application data record boundaries. This is similar to the difference between dissectors for protocols running atop TCP and protocols running atop protocols such as UDP. So have two separate tables mapping Application-Layer Protocol Negotiation (ALPN) Protocol IDs to dissector names - one for SSL/TLS and one for DTLS. There are both "over a byte-stream protocol" and "over a packet-oriented protocol" dissectors for STUN and TURN ChannelData packets. Register the "over a byte-stream protocol" ones by name, and use the appropriate ones in the appropriate tables. (There is not one named "stun", so the STUN dissector wouldn't have been called at all.) Change-Id: I054e169f6ae3291abdc7eb58918ef65a17c90a63 Reviewed-on: https://code.wireshark.org/review/27822 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-turnchannel.c')
-rw-r--r--epan/dissectors/packet-turnchannel.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/epan/dissectors/packet-turnchannel.c b/epan/dissectors/packet-turnchannel.c
index 552f24d9a9..339db978f3 100644
--- a/epan/dissectors/packet-turnchannel.c
+++ b/epan/dissectors/packet-turnchannel.c
@@ -49,6 +49,7 @@ static int hf_turnchannel_len = -1;
/* Initialize the subtree pointers */
static gint ett_turnchannel = -1;
+static dissector_handle_t turnchannel_tcp_handle;
static dissector_handle_t turnchannel_udp_handle;
static int
@@ -181,6 +182,7 @@ proto_register_turnchannel(void)
proto_turnchannel = proto_register_protocol("TURN Channel",
"TURNCHANNEL", "turnchannel");
+ turnchannel_tcp_handle = register_dissector("turnchannel-tcp", dissect_turnchannel_tcp, proto_turnchannel);
turnchannel_udp_handle = register_dissector("turnchannel", dissect_turnchannel_message, proto_turnchannel);
/* subdissectors */
@@ -196,10 +198,6 @@ proto_register_turnchannel(void)
void
proto_reg_handoff_turnchannel(void)
{
- dissector_handle_t turnchannel_tcp_handle;
-
- turnchannel_tcp_handle = create_dissector_handle(dissect_turnchannel_tcp, proto_turnchannel);
-
/* Register for "Decode As" in case STUN negotiation isn't captured */
dissector_add_for_decode_as_with_preference("tcp.port", turnchannel_tcp_handle);
dissector_add_for_decode_as_with_preference("udp.port", turnchannel_udp_handle);