Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
dot11decrypt_user.h
1 /* dot11decrypt_user.h
2  *
3  * Copyright (c) 2006 CACE Technologies, Davis (California)
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
7  */
8 
9 #ifndef _DOT11DECRYPT_USER_H
10 #define _DOT11DECRYPT_USER_H
11 
12 /******************************************************************************/
13 /* File includes */
14 /* */
15 #include "dot11decrypt_interop.h"
16 #include "ws_symbol_export.h"
17 
18 /* */
19 /* */
20 /******************************************************************************/
21 
22 /******************************************************************************/
23 /* Constant definitions */
24 /* */
25 /* Decryption key types */
26 #define DOT11DECRYPT_KEY_TYPE_WEP 0
27 #define DOT11DECRYPT_KEY_TYPE_WEP_40 1
28 #define DOT11DECRYPT_KEY_TYPE_WEP_104 2
29 #define DOT11DECRYPT_KEY_TYPE_WPA_PWD 3
30 #define DOT11DECRYPT_KEY_TYPE_WPA_PSK 4
31 #define DOT11DECRYPT_KEY_TYPE_WPA_PMK 5
32 #define DOT11DECRYPT_KEY_TYPE_TKIP 6
33 #define DOT11DECRYPT_KEY_TYPE_CCMP 7
34 
35 /* Decryption algorithms fields size definition (bytes) */
36 #define DOT11DECRYPT_WEP_KEY_MINLEN 1
37 #define DOT11DECRYPT_WEP_KEY_MAXLEN 32
38 #define DOT11DECRYPT_WEP_40_KEY_LEN 5
39 #define DOT11DECRYPT_WEP_104_KEY_LEN 13
40 
41 #define DOT11DECRYPT_WPA_PASSPHRASE_MIN_LEN 8
42 #define DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN 63 /* null-terminated string, the actual length of the storage is 64 */
43 #define DOT11DECRYPT_WPA_SSID_MIN_LEN 0
44 #define DOT11DECRYPT_WPA_SSID_MAX_LEN 32
45 #define DOT11DECRYPT_WPA_PSK_LEN 32
46 /* */
47 /* */
48 /******************************************************************************/
49 
50 /******************************************************************************/
51 /* Macro definitions */
52 /* */
53 /* */
54 /******************************************************************************/
55 
56 /******************************************************************************/
57 /* Type definitions */
58 /* */
62 typedef struct {
63  GString *key;
64  GByteArray *ssid;
65  guint bits;
66  guint type;
68 
72 typedef struct _DOT11DECRYPT_KEY_ITEM {
81  UINT8 KeyType;
82 
110  UCHAR WepKey[DOT11DECRYPT_WEP_KEY_MAXLEN];
115  size_t WepKeyLen;
116  } Wep;
117 
126  UCHAR Psk[DOT11DECRYPT_WPA_PSK_LEN];
127  UCHAR Ptk[DOT11DECRYPT_WPA_PTK_LEN];
128  } Wpa;
129  } KeyData;
130 
136  CHAR Passphrase[DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN+1];
143  CHAR Ssid[DOT11DECRYPT_WPA_SSID_MAX_LEN];
147  size_t SsidLen;
148  } UserPwd;
150 
158  size_t nKeys;
159 
165 /* */
166 /******************************************************************************/
167 
168 /******************************************************************************/
169 /* Function prototype declarations */
170 
190 WS_DLL_PUBLIC
192 parse_key_string(gchar* key_string, guint8 key_type);
193 
201 WS_DLL_PUBLIC
202 gchar*
203 get_key_string(decryption_key_t* dk);
204 
210 WS_DLL_PUBLIC
211 void
212 free_key_string(decryption_key_t *dk);
213 
214 /******************************************************************************/
215 
216 #endif /* _DOT11DECRYPT_USER_H */
size_t nKeys
Definition: dot11decrypt_user.h:158
Definition: dot11decrypt_user.h:154
UINT8 KeyType
Definition: dot11decrypt_user.h:81
size_t SsidLen
Definition: dot11decrypt_user.h:147
Definition: dot11decrypt_user.h:98
Definition: dot11decrypt_user.h:62
UCHAR WepKey[DOT11DECRYPT_WEP_KEY_MAXLEN]
Definition: dot11decrypt_user.h:110
Definition: dot11decrypt_user.h:72