Ethereal-dev: [Ethereal-dev] [PATCH] ieee802.11 dissector tweak

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: Mon, 21 Oct 2002 14:13:05 -0400
The attached patch displays changes the ieee802.11 dissector to
display whether or not the WEP ICV was successfully verified.

Fairly trivial, but asthetically pleasing.  :)

It applies to the current CVS head.

 - 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)
Index: packet-ieee80211.c
===================================================================
RCS file: /cvsroot/ethereal/packet-ieee80211.c,v
retrieving revision 1.74
diff -u -r1.74 packet-ieee80211.c
--- packet-ieee80211.c	2002/08/28 21:00:17	1.74
+++ packet-ieee80211.c	2002/10/21 18:09:30
@@ -1633,9 +1633,6 @@
        */
       len -= 4;
       reported_len -= 4;
-      if (tree)
-	proto_tree_add_item (wep_tree, hf_wep_icv, tvb, hdr_len + 4 + len, 4,
-			     FALSE);
       can_decrypt = TRUE;
     }
 
@@ -1646,9 +1643,24 @@
        */
       next_tvb = tvb_new_subset(tvb, hdr_len + 4, len, reported_len);
 
+      if (tree && can_decrypt)
+	proto_tree_add_uint_format (wep_tree, hf_wep_icv, tvb, 
+				    hdr_len + 4 + len, 4, 
+				    tvb_get_ntohl(tvb, hdr_len + 4 + len),
+				    "WEP ICV: 0x%08x (not verified)", 
+				    tvb_get_ntohl(tvb, hdr_len + 4 + len));
+
       call_dissector(data_handle, next_tvb, pinfo, tree);
       return;
     } else {
+
+      if (tree)
+	proto_tree_add_uint_format (wep_tree, hf_wep_icv, tvb, 
+				    hdr_len + 4 + len, 4, 
+				    tvb_get_ntohl(tvb, hdr_len + 4 + len),
+				    "WEP ICV: 0x%08x (correct)", 
+				    tvb_get_ntohl(tvb, hdr_len + 4 + len));
+
       add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
     }
 
@@ -2171,7 +2183,7 @@
       "Key", HFILL }},
 
     {&hf_wep_icv,
-     {"WEP ICV (not verified)", "wlan.wep.icv", FT_UINT32, BASE_HEX, NULL, 0,
+     {"WEP ICV", "wlan.wep.icv", FT_UINT32, BASE_HEX, NULL, 0,
       "WEP ICV", HFILL }},
   };
 

Attachment: pgpY5C4Nb39vl.pgp
Description: PGP signature