forked from osmocom/wireshark
Skype: Remove TCP heuristic dissection
It was taking any/all TCP packets. Also clean up a little of the UDP heuristic. Change-Id: Iae08e79c0d71e4676cfc7821372ab9581c1d1cfc Ping-Bug: 13029 Reviewed-on: https://code.wireshark.org/review/18322 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
bd057c8dd2
commit
404c31492b
|
@ -291,20 +291,21 @@ static gboolean
|
||||||
test_skype_udp(tvbuff_t *tvb)
|
test_skype_udp(tvbuff_t *tvb)
|
||||||
{
|
{
|
||||||
/* Minimum of 3 bytes, check for valid message type */
|
/* Minimum of 3 bytes, check for valid message type */
|
||||||
guint length = tvb_captured_length(tvb);
|
if (tvb_captured_length(tvb) > 3)
|
||||||
guint8 type = tvb_get_guint8(tvb, 2) & 0xF;
|
{
|
||||||
if ( length >= 3 &&
|
guint8 type = tvb_get_guint8(tvb, 2) & 0xF;
|
||||||
( type == 0 ||
|
if ( type == 0 ||
|
||||||
/* FIXME: Extend this by minimum or exact length per message type */
|
/* FIXME: Extend this by minimum or exact length per message type */
|
||||||
type == 2 ||
|
type == 2 ||
|
||||||
type == 3 ||
|
type == 3 ||
|
||||||
type == 5 ||
|
type == 5 ||
|
||||||
type == 7 ||
|
type == 7 ||
|
||||||
type == 0xd ||
|
type == 0xd ||
|
||||||
type == 0xf
|
type == 0xf
|
||||||
)
|
)
|
||||||
) {
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -312,12 +313,11 @@ test_skype_udp(tvbuff_t *tvb)
|
||||||
static gboolean
|
static gboolean
|
||||||
dissect_skype_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
|
dissect_skype_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
|
||||||
{
|
{
|
||||||
if (pinfo->ptype == PT_UDP) {
|
if ( !test_skype_udp(tvb) ) {
|
||||||
if ( !test_skype_udp(tvb) ) {
|
return FALSE;
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
dissect_skype_udp(tvb, pinfo, tree);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dissect_skype_udp(tvb, pinfo, tree);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,7 +447,6 @@ proto_reg_handoff_skype(void)
|
||||||
dissector_add_for_decode_as_with_preference("tcp.port", skype_handle);
|
dissector_add_for_decode_as_with_preference("tcp.port", skype_handle);
|
||||||
dissector_add_for_decode_as_with_preference("udp.port", skype_handle);
|
dissector_add_for_decode_as_with_preference("udp.port", skype_handle);
|
||||||
|
|
||||||
heur_dissector_add("tcp", dissect_skype_heur, "Skype over TCP", "skype_tcp", proto_skype, HEURISTIC_DISABLE);
|
|
||||||
heur_dissector_add("udp", dissect_skype_heur, "Skype over UDP", "skype_udp", proto_skype, HEURISTIC_DISABLE);
|
heur_dissector_add("udp", dissect_skype_heur, "Skype over UDP", "skype_udp", proto_skype, HEURISTIC_DISABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue