Allow TURN channeldata to be padded on both UDP and TCP.
authorPhilipp Hancke <fippo@andyet.net>
Thu, 8 Oct 2015 19:55:22 +0000 (12:55 -0700)
committerAlexis La Goutte <alexis.lagoutte@gmail.com>
Sun, 11 Oct 2015 05:34:44 +0000 (05:34 +0000)
Microsoft's Edge browser does this, UDP padding is a MAY in https://tools.ietf.org/html/rfc5766#section-11.5

Bug: 11584
Change-Id: I513638d8a3eb257576af3cfc8e6b81cc93b22d05
Reviewed-on: https://code.wireshark.org/review/10889
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
epan/dissectors/packet-stun.c

index 19ffe6b82dc4fc9df5e6abce92d4f46ad4b96a47..930c2b9f88ba2dad0180c890e0393705140e1a98 100644 (file)
@@ -590,7 +590,8 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
         /* note that padding is only mandatory over streaming
            protocols */
         if (is_udp) {
-            if (reported_length != (msg_length + CHANNEL_DATA_HDR_LEN))
+            if (reported_length != msg_length + CHANNEL_DATA_HDR_LEN &&
+                reported_length != ((msg_length + CHANNEL_DATA_HDR_LEN + 3) & ~0x3))
                 return 0;
         } else { /* TCP */
             if (reported_length != ((msg_length + CHANNEL_DATA_HDR_LEN + 3) & ~0x3))