Ethereal-dev: [Ethereal-dev] [PATCH] Fix the 802.11 dissector

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Solomon Peachy <solomon@xxxxxxxxxxxxxx>
Date: Wed, 19 Jun 2002 10:07:41 -0400
Guy, your most recent CVS commit broke WEP decoding.

Attached is a patch to fix it.

 - Pizza
-- 
Solomon Peachy                        solomon@xxxxxxxxxxxxxx
AbsoluteValue Systems                 http://www.linux-wlan.com
715-D North Drive                     +1 (321) 259-0737  (office)
Melbourne, FL 32934                   +1 (321) 259-0286  (fax)
? out
Index: packet-ieee80211.c
===================================================================
RCS file: /cvsroot/ethereal/packet-ieee80211.c,v
retrieving revision 1.67
diff -u -r1.67 packet-ieee80211.c
--- packet-ieee80211.c	2002/06/19 09:18:45	1.67
+++ packet-ieee80211.c	2002/06/19 14:05:09
@@ -1630,7 +1630,7 @@
       can_decrypt = TRUE;
     }
 
-    if (!can_decrypt || (next_tvb = try_decrypt_wep(tvb, hdr_len, reported_len - hdr_len + 4)) == NULL) {
+    if (!can_decrypt || (next_tvb = try_decrypt_wep(tvb, hdr_len, reported_len + 8)) == NULL) {
       /*
        * WEP decode impossible or failed, treat payload as raw data
        * and don't attempt fragment reassembly or further dissection.
@@ -1647,14 +1647,11 @@
      * WEP decryption successful!
      *
      * Use the tvbuff we got back from the decryption; the data starts at
-     * the beginning, and doesn't include the 802.11 header or the WEP
-     * IV, so subtract "hdr_len + 4" from the lengths we computed above,
-     * and set "hdr_len" to 0 so the code below starts at the beginning
-     * of "next_tvb".
+     * the beginning.  The lengths are already correct for the decoded WEP
+     * payload.
      */
-    reported_len -= hdr_len + 4;
-    len -= hdr_len + 4;
     hdr_len = 0;
+
   } else {
     /*
      * Not a WEP-encrypted frame; just use the data from the tvbuff

Attachment: pgper3Q7K3vJ0.pgp
Description: PGP signature