summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2007-06-21 20:22:56 +0000
committerGerald Combs <gerald@wireshark.org>2007-06-21 20:22:56 +0000
commit7efcc33a1e768a82eeb5c823946f50335448cb74 (patch)
treed1bc53d0789db767459eaa5ed84bb767b918e547 /epan
parent249a747c51efab55250ab6b57f1d8bad1584522c (diff)
downloadwireshark-7efcc33a1e768a82eeb5c823946f50335448cb74.tar.gz
In packet-ieee802.11.c, fix a serious preference bug introduced in the
last checkin. In airpcap.c, appease the toolbar code by returning a lower-case, non-separated WEP key. svn path=/trunk/; revision=22152
Diffstat (limited to 'epan')
-rw-r--r--epan/crypt/airpdcap.c7
-rw-r--r--epan/dissectors/packet-ieee80211.c14
2 files changed, 12 insertions, 9 deletions
diff --git a/epan/crypt/airpdcap.c b/epan/crypt/airpdcap.c
index 43fe4c458f..2e24e12125 100644
--- a/epan/crypt/airpdcap.c
+++ b/epan/crypt/airpdcap.c
@@ -1353,13 +1353,16 @@ parse_key_string(gchar* input_string)
key_ba = g_byte_array_new();
res = hex_str_to_bytes(first_nibble, key_ba, FALSE);
- if (res) {
+ if (res && key_ba->len > 0) {
/* Key is correct! It was probably an 'old style' WEP key */
/* Create the decryption_key_t structure, fill it and return it*/
dk = g_malloc(sizeof(decryption_key_t));
dk->type = AIRPDCAP_KEY_TYPE_WEP;
- dk->key = g_string_new(input_string);
+ /* XXX - The current key handling code in the GUI requires
+ * no separators and lower case */
+ dk->key = g_string_new(bytes_to_str(key_ba->data, key_ba->len));
+ g_string_down(dk->key);
dk->bits = key_ba->len * 8;
dk->ssid = NULL;
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index a4bd66952e..73c79491fb 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -10092,17 +10092,17 @@ proto_register_ieee80211 (void)
g_string_sprintf(key_title, "Key #%d", i + 1);
/* Davide Schiera (2006-11-26): modified keys input tooltip */
g_string_sprintf(key_desc,
- "Key #%d string can be:\n"
- " <wep hexadecimal key>;\n"
- " wep:<wep hexadecimal key>;\n"
- " wpa-pwd:<passphrase>[:<ssid>];\n"
+ "Key #%d string can be:"
+ " <wep hexadecimal key>;"
+ " wep:<wep hexadecimal key>;"
+ " wpa-pwd:<passphrase>[:<ssid>];"
" wpa-psk:<wpa hexadecimal key>", i + 1);
#else
g_string_sprintf(key_name, "wep_key%d", i + 1);
g_string_sprintf(key_title, "WEP key #%d", i + 1);
- g_string_sprintf(key_desc, "WEP key #%d can be:\n"
- " <wep hexadecimal key>;\n"
- " wep:<wep hexadecimal key>\n", i + 1);
+ g_string_sprintf(key_desc, "WEP key #%d can be:"
+ " <wep hexadecimal key>;"
+ " wep:<wep hexadecimal key>", i + 1);
#endif
prefs_register_string_preference(wlan_module, key_name->str,