Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
dot11decrypt_user.h
Go to the documentation of this file.
1
9#ifndef _DOT11DECRYPT_USER_H
10#define _DOT11DECRYPT_USER_H
11
12/******************************************************************************/
13/* File includes */
14/* */
15#include <glib.h>
16
17#include "ws_symbol_export.h"
18
19/* */
20/* */
21/******************************************************************************/
22
23/******************************************************************************/
24/* Constant definitions */
25/* */
26/* Decryption key types */
27#define DOT11DECRYPT_KEY_TYPE_WEP 0
28#define DOT11DECRYPT_KEY_TYPE_WEP_40 1
29#define DOT11DECRYPT_KEY_TYPE_WEP_104 2
30#define DOT11DECRYPT_KEY_TYPE_WPA_PWD 3
31#define DOT11DECRYPT_KEY_TYPE_WPA_PSK 4
32#define DOT11DECRYPT_KEY_TYPE_WPA_PMK 5
33#define DOT11DECRYPT_KEY_TYPE_TK 6
34#define DOT11DECRYPT_KEY_TYPE_MSK 7
35
36#define DOT11DECRYPT_KEY_TYPE_TKIP 100
37#define DOT11DECRYPT_KEY_TYPE_CCMP 101
38#define DOT11DECRYPT_KEY_TYPE_CCMP_256 102
39#define DOT11DECRYPT_KEY_TYPE_GCMP 103
40#define DOT11DECRYPT_KEY_TYPE_GCMP_256 104
41#define DOT11DECRYPT_KEY_TYPE_UNKNOWN -1
42
43/* Decryption algorithms fields size definition (bytes) */
44#define DOT11DECRYPT_WEP_KEY_MINLEN 1
45#define DOT11DECRYPT_WEP_KEY_MAXLEN 32
46#define DOT11DECRYPT_WEP_40_KEY_LEN 5
47#define DOT11DECRYPT_WEP_104_KEY_LEN 13
48
49#define DOT11DECRYPT_WPA_PASSPHRASE_MIN_LEN 8
50#define DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN 63 /* null-terminated string, the actual length of the storage is 64 */
51#define DOT11DECRYPT_WPA_SSID_MIN_LEN 0
52#define DOT11DECRYPT_WPA_SSID_MAX_LEN 32
53#define DOT11DECRYPT_WPA_PMK_MAX_LEN 48
54#define DOT11DECRYPT_WPA_PWD_PSK_LEN 32
55#define DOT11DECRYPT_TK_MAX_LEN 32
56#define DOT11DECRYPT_MSK_MIN_LEN 64
57#define DOT11DECRYPT_MSK_MAX_LEN 128
58/* */
59/* */
60/******************************************************************************/
61
62/******************************************************************************/
63/* Macro definitions */
64/* */
65/* */
66/******************************************************************************/
67
68/******************************************************************************/
69/* Type definitions */
70/* */
74typedef struct {
75 GByteArray *key;
76 GByteArray *ssid;
77 unsigned bits;
78 unsigned type;
80
84typedef struct _DOT11DECRYPT_KEY_ITEM {
93 uint8_t KeyType;
94
122 unsigned char WepKey[DOT11DECRYPT_WEP_KEY_MAXLEN];
127 size_t WepKeyLen;
128 } Wep;
129
138 unsigned char Psk[DOT11DECRYPT_WPA_PMK_MAX_LEN];
139 unsigned char Ptk[DOT11DECRYPT_WPA_PTK_MAX_LEN];
140 uint8_t PskLen;
141 uint8_t PtkLen;
142 uint8_t Akm;
143 uint8_t Cipher;
144 } Wpa;
145
146 } KeyData;
147
149 uint8_t Tk[DOT11DECRYPT_TK_MAX_LEN];
150 uint8_t Len;
151 } Tk;
152
154 uint8_t Msk[DOT11DECRYPT_MSK_MAX_LEN];
155 uint8_t Len;
156 } Msk;
157
166 char Passphrase[DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN];
177 char Ssid[DOT11DECRYPT_WPA_SSID_MAX_LEN];
181 size_t SsidLen;
182 } UserPwd;
184
199/* */
200/******************************************************************************/
201
202/******************************************************************************/
203/* Function prototype declarations */
204
226WS_DLL_PUBLIC
228parse_key_string(char* key_string, uint8_t key_type, char **error);
229
235WS_DLL_PUBLIC
236void
238
239/******************************************************************************/
240
241#endif /* _DOT11DECRYPT_USER_H */
struct _DOT11DECRYPT_KEYS_COLLECTION DOT11DECRYPT_KEYS_COLLECTION
WS_DLL_PUBLIC decryption_key_t * parse_key_string(char *key_string, uint8_t key_type, char **error)
Definition dot11decrypt.c:2738
WS_DLL_PUBLIC void free_key_string(decryption_key_t *dk)
Definition dot11decrypt.c:3015
struct _DOT11DECRYPT_KEY_ITEM DOT11DECRYPT_KEY_ITEM
char Ssid[DOT11DECRYPT_WPA_SSID_MAX_LEN]
Definition dot11decrypt_user.h:177
size_t PassphraseLen
Definition dot11decrypt_user.h:170
size_t SsidLen
Definition dot11decrypt_user.h:181
char Passphrase[DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN]
Definition dot11decrypt_user.h:166
unsigned char WepKey[DOT11DECRYPT_WEP_KEY_MAXLEN]
Definition dot11decrypt_user.h:122
Definition dot11decrypt_user.h:84
uint8_t KeyType
Definition dot11decrypt_user.h:93
Definition dot11decrypt_user.h:188
size_t nKeys
Definition dot11decrypt_user.h:192
DOT11DECRYPT_KEY_ITEM Keys[256]
Definition dot11decrypt_user.h:197
Definition dot11decrypt_user.h:74
Definition dot11decrypt_user.h:110