From 249a747c51efab55250ab6b57f1d8bad1584522c Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 21 Jun 2007 17:49:03 +0000 Subject: Be less restrictive about WEP key preferences. Use hex_str_to_bytes to process WEP keys. Allow the "wep:" prefix for WEP keys even when HAVE_AIRPDCAP isn't defined. Add a NULL pointer check to hex_str_to_bytes(). Fixes bug 1584. Fixup indentation. svn path=/trunk/; revision=22151 --- epan/crypt/airpdcap_user.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'epan/crypt/airpdcap_user.h') diff --git a/epan/crypt/airpdcap_user.h b/epan/crypt/airpdcap_user.h index 0dccb8c975..04d90a4003 100644 --- a/epan/crypt/airpdcap_user.h +++ b/epan/crypt/airpdcap_user.h @@ -193,15 +193,31 @@ typedef struct _AIRPDCAP_KEYS_COLLECTION { /******************************************************************************/ /* Function prototype declarations */ -/* +/** * Returns the decryption_key_t struct given a string describing the key. - * Returns NULL if the key_string cannot be parsed. + * @param key_string [IN] Key string in one of the following formats: + * - 0102030405 (40/64-bit WEP) + * - 01:02:03:04:05 (40/64-bit WEP) + * - 0102030405060708090a0b0c0d (104/128-bit WEP) + * - 01:02:03:04:05:06:07:08:09:0a:0b:0c:0d (104/128-bit WEP) + * - wep:01020304... (WEP) + * - wep:01:02:03:04... (WEP) + * - wpa-pwd:MyPassword (WPA + plaintext password + "wildcard" SSID) + * - wpa-pwd:MyPassword:MySSID (WPA + plaintext password + specific SSID) + * - wpa-psk:01020304... (WPA + 256-bit raw key) + * @return A pointer to a freshly-g_malloc()ed decryption_key_t struct on + * success, or NULL on failure. + * @see get_key_string() */ decryption_key_t* parse_key_string(gchar* key_string); -/* - * Returns a newly allocated string representing the given decryption_key_t struct +/** + * Returns a newly allocated string representing the given decryption_key_t + * struct. + * @param dk [IN] Pointer to the key to be converted + * @return A g_malloc()ed string representation of the key + * @see parse_key_string() */ gchar* get_key_string(decryption_key_t* dk); -- cgit v1.2.3