Wireshark 4.7.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 64
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 bool tk_mld;
78 uint8_t ap_mld_mac[6];
79 uint8_t sta_mld_mac[6];
80 unsigned bits;
81 unsigned type;
83
87typedef struct _DOT11DECRYPT_KEY_ITEM {
96 uint8_t KeyType;
97
130 unsigned char WepKey[DOT11DECRYPT_WEP_KEY_MAXLEN];
135 size_t WepKeyLen;
136 } Wep;
137
146 unsigned char Psk[DOT11DECRYPT_WPA_PMK_MAX_LEN];
147 unsigned char Ptk[DOT11DECRYPT_WPA_PTK_MAX_LEN];
148 uint8_t PskLen;
149 uint8_t PtkLen;
150 uint8_t Akm;
151 uint8_t Cipher;
152 } Wpa;
153
154 } KeyData;
155
160 uint8_t Tk[DOT11DECRYPT_TK_MAX_LEN];
161 uint8_t Len;
162 bool mld;
163 uint8_t ap_mld_mac[6];
164 uint8_t sta_mld_mac[6];
165 } Tk;
166
171 uint8_t Msk[DOT11DECRYPT_MSK_MAX_LEN];
172 uint8_t Len;
173 } Msk;
174
186 char Passphrase[DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN];
197 char Ssid[DOT11DECRYPT_WPA_SSID_MAX_LEN];
201 size_t SsidLen;
202 } UserPwd;
204
219/* */
220/******************************************************************************/
221
222/******************************************************************************/
223/* Function prototype declarations */
224
246WS_DLL_PUBLIC
248parse_key_string(char* key_string, uint8_t key_type, char **error);
249
255WS_DLL_PUBLIC
256void
258
259/******************************************************************************/
260
261#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:2879
WS_DLL_PUBLIC void free_key_string(decryption_key_t *dk)
Definition dot11decrypt.c:3195
struct _DOT11DECRYPT_KEY_ITEM DOT11DECRYPT_KEY_ITEM
Holds a Master Session Key (MSK) used as the basis for further key derivation.
Definition dot11decrypt_user.h:170
uint8_t Len
Definition dot11decrypt_user.h:172
uint8_t Msk[128]
Definition dot11decrypt_user.h:171
Holds a plaintext password and optional SSID for WPA/WPA2 decryption.
Definition dot11decrypt_user.h:178
char Ssid[32]
Definition dot11decrypt_user.h:197
char Passphrase[63]
Definition dot11decrypt_user.h:186
size_t PassphraseLen
Definition dot11decrypt_user.h:190
size_t SsidLen
Definition dot11decrypt_user.h:201
Holds a Temporal Key (TK) and optional MLD MAC addresses for per-link decryption.
Definition dot11decrypt_user.h:159
uint8_t Len
Definition dot11decrypt_user.h:161
uint8_t sta_mld_mac[6]
Definition dot11decrypt_user.h:164
uint8_t ap_mld_mac[6]
Definition dot11decrypt_user.h:163
uint8_t Tk[32]
Definition dot11decrypt_user.h:160
bool mld
Definition dot11decrypt_user.h:162
WEP key data structure.
Definition dot11decrypt_user.h:119
Definition dot11decrypt_user.h:87
uint8_t KeyType
Definition dot11decrypt_user.h:96
Definition dot11decrypt_user.h:208
size_t nKeys
Definition dot11decrypt_user.h:212
DOT11DECRYPT_KEY_ITEM Keys[256]
Definition dot11decrypt_user.h:217
Definition dot11decrypt_user.h:74
Union representing key data for various 802.11 decryption algorithms.
Definition dot11decrypt_user.h:115