aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ieee80211.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-06-24 06:23:05 +0000
committerGuy Harris <guy@alum.mit.edu>2003-06-24 06:23:05 +0000
commit1867f2ff247bc93afa0033fe434e9b08a99ddc18 (patch)
treecd7070c8d5c59768f3a5746ffd8020af2840c4b4 /packet-ieee80211.c
parent4906ff281b87e919a51ed50f881537a890256cd2 (diff)
From Motonori Shindo:
parse the WEP keys every time they're changed, not just when we start up; make the description of the WEP keys in the preference more accurate. svn path=/trunk/; revision=7922
Diffstat (limited to 'packet-ieee80211.c')
-rw-r--r--packet-ieee80211.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/packet-ieee80211.c b/packet-ieee80211.c
index 8bf2295675..493fbd376e 100644
--- a/packet-ieee80211.c
+++ b/packet-ieee80211.c
@@ -3,7 +3,7 @@
* Copyright 2000, Axis Communications AB
* Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
*
- * $Id: packet-ieee80211.c,v 1.91 2003/06/05 22:10:49 gerald Exp $
+ * $Id: packet-ieee80211.c,v 1.92 2003/06/24 06:23:05 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -2526,7 +2526,7 @@ proto_register_ieee80211 (void)
register_init_routine(wlan_defragment_init);
/* Register configuration options */
- wlan_module = prefs_register_protocol(proto_wlan, NULL);
+ wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
prefs_register_bool_preference(wlan_module, "defragment",
"Reassemble fragmented 802.11 datagrams",
"Whether fragmented 802.11 datagrams should be reassembled",
@@ -2550,19 +2550,19 @@ proto_register_ieee80211 (void)
prefs_register_string_preference(wlan_module, "wep_key1",
"WEP key #1",
- "First WEP key (A:B:C:D:E:F)",
+ "First WEP key (A:B:C:D:E) [40bit], (A:B:C:D:E:F:G:H:I:J:K:L:M) [104bit], or whatever key length you're using",
&wep_keystr[0]);
prefs_register_string_preference(wlan_module, "wep_key2",
"WEP key #2",
- "Second WEP key (A:B:C:D:E:F)",
+ "Second WEP key (A:B:C:D:E) [40bit], (A:B:C:D:E:F:G:H:I:J:K:L:M) [104bit], or whatever key length you're using",
&wep_keystr[1]);
prefs_register_string_preference(wlan_module, "wep_key3",
"WEP key #3",
- "Third WEP key (A:B:C:D:E:F)",
+ "Third WEP key (A:B:C:D:E) [40bit], (A:B:C:D:E:F:G:H:I:J:K:L:M) [104bit], or whatever key length you're using",
&wep_keystr[2]);
prefs_register_string_preference(wlan_module, "wep_key4",
"WEP key #4",
- "Fourth WEP key (A:B:C:D:E:F)",
+ "Fourth WEP key (A:B:C:D:E) [40bit] (A:B:C:D:E:F:G:H:I:J:K:L:M) [104bit], or whatever key length you're using",
&wep_keystr[3]);
#endif
}
@@ -2650,8 +2650,6 @@ static tvbuff_t *try_decrypt_wep(tvbuff_t *tvb, guint32 offset, guint32 len) {
if (num_wepkeys < 1)
return NULL;
- if (wep_keylens == NULL)
- init_wepkeys();
if ((tmp = g_malloc(len)) == NULL)
return NULL; /* krap! */
@@ -2794,8 +2792,11 @@ static void init_wepkeys(void) {
if (num_wepkeys < 1)
return;
- if (wep_keylens != NULL)
- return;
+ if (wep_keys)
+ g_free(wep_keys);
+
+ if (wep_keylens)
+ g_free(wep_keylens);
wep_keys = g_malloc(num_wepkeys * sizeof(guint8*));
wep_keylens = g_malloc(num_wepkeys * sizeof(int));
@@ -2821,6 +2822,8 @@ static void init_wepkeys(void) {
#endif
#endif
+ if (wep_keys[i])
+ g_free(wep_keys[i]);
wep_keys[i] = g_malloc(32 * sizeof(guint8));
memset(wep_keys[i], 0, 32 * sizeof(guint8));
tmp3 = wep_keys[i];