9#ifndef _DOT11DECRYPT_SYSTEM_H
10#define _DOT11DECRYPT_SYSTEM_H
16#define DOT11DECRYPT_RET_SUCCESS 0
17#define DOT11DECRYPT_RET_UNSUCCESS 1
19#define DOT11DECRYPT_RET_NO_DATA 1
20#define DOT11DECRYPT_RET_WRONG_DATA_SIZE 2
21#define DOT11DECRYPT_RET_REQ_DATA 3
22#define DOT11DECRYPT_RET_NO_VALID_HANDSHAKE 4
23#define DOT11DECRYPT_RET_NO_DATA_ENCRYPTED 5
25#define DOT11DECRYPT_RET_SUCCESS_HANDSHAKE -1
27#define DOT11DECRYPT_MAX_KEYS_NR 64
30#define DOT11DECRYPT_WPA_NONCE_LEN 32
31#define DOT11DECRYPT_WPA_PTK_MAX_LEN 88
32#define DOT11DECRYPT_WPA_MICKEY_MAX_LEN 24
34#define DOT11DECRYPT_WEP_128_KEY_LEN 16
37#define DOT11DECRYPT_MAC_LEN 6
38#define DOT11DECRYPT_RADIOTAP_HEADER_LEN 24
40#define DOT11DECRYPT_EAPOL_MAX_LEN 1024U
42#define DOT11DECRYPT_TK_LEN 16
45#define DOT11DECRYPT_MAX_CAPLEN 8192
47#define DOT11DECRYPT_WEP_IVLEN 3
48#define DOT11DECRYPT_WEP_KIDLEN 1
49#define DOT11DECRYPT_WEP_ICV 4
50#define DOT11DECRYPT_WEP_HEADER DOT11DECRYPT_WEP_IVLEN + DOT11DECRYPT_WEP_KIDLEN
51#define DOT11DECRYPT_WEP_TRAILER DOT11DECRYPT_WEP_ICV
60#define DOT11DECRYPT_RSNA_EXTIV 0x20
61#define DOT11DECRYPT_RSNA_EXTIVLEN 4
62#define DOT11DECRYPT_TKIP_MICLEN 8
64#define DOT11DECRYPT_RSNA_HEADER DOT11DECRYPT_WEP_HEADER + DOT11DECRYPT_RSNA_EXTIVLEN
66#define DOT11DECRYPT_CCMP_HEADER DOT11DECRYPT_RSNA_HEADER
67#define DOT11DECRYPT_CCMP_TRAILER 8
68#define DOT11DECRYPT_CCMP_256_TRAILER 16
70#define DOT11DECRYPT_GCMP_HEADER 8
71#define DOT11DECRYPT_GCMP_TRAILER 16
73#define DOT11DECRYPT_TKIP_HEADER DOT11DECRYPT_RSNA_HEADER
74#define DOT11DECRYPT_TKIP_TRAILER DOT11DECRYPT_TKIP_MICLEN + DOT11DECRYPT_WEP_ICV
76#define DOT11DECRYPT_CRC_LEN 4
85#include "ws_symbol_export.h"
94 unsigned char bssid[DOT11DECRYPT_MAC_LEN];
95 unsigned char sta[DOT11DECRYPT_MAC_LEN];
111 unsigned char nonce[DOT11DECRYPT_WPA_NONCE_LEN];
116 int tmp_group_cipher;
117 unsigned char ptk[DOT11DECRYPT_WPA_PTK_MAX_LEN];
128 char pkt_ssid[DOT11DECRYPT_WPA_SSID_MAX_LEN];
132typedef enum _DOT11DECRYPT_HS_MSG_TYPE {
133 DOT11DECRYPT_HS_MSG_TYPE_INVALID = 0,
134 DOT11DECRYPT_HS_MSG_TYPE_4WHS_1,
135 DOT11DECRYPT_HS_MSG_TYPE_4WHS_2,
136 DOT11DECRYPT_HS_MSG_TYPE_4WHS_3,
137 DOT11DECRYPT_HS_MSG_TYPE_4WHS_4,
138 DOT11DECRYPT_HS_MSG_TYPE_GHS_1,
139 DOT11DECRYPT_HS_MSG_TYPE_GHS_2
140} DOT11DECRYPT_HS_MSG_TYPE;
154 DOT11DECRYPT_HS_MSG_TYPE msg_type;
161 uint16_t key_data_len;
162 uint8_t group_cipher;
178 uint8_t frame_subtype;
179 uint8_t group_cipher;
191 uint16_t gtk_subelem_key_len;
192 uint8_t bssid[DOT11DECRYPT_MAC_LEN];
193 uint8_t sa[DOT11DECRYPT_MAC_LEN];
194 uint8_t da[DOT11DECRYPT_MAC_LEN];
246 const unsigned data_off,
247 const unsigned data_len,
249 uint32_t *decrypt_len,
275 const unsigned char bssid[DOT11DECRYPT_MAC_LEN],
276 const unsigned char sta[DOT11DECRYPT_MAC_LEN],
277 unsigned char *decrypted_data,
unsigned *decrypted_len,
309 const uint8_t *eapol_raw,
310 const unsigned tot_len,
311 const unsigned char bssid[DOT11DECRYPT_MAC_LEN],
312 const unsigned char sta[DOT11DECRYPT_MAC_LEN])
338 uint8_t *decrypted_gtk,
size_t *decrypted_len,
357 const unsigned tot_len)
404 const size_t keys_nr)
int Dot11DecryptScanEapolForKeys(PDOT11DECRYPT_CONTEXT ctx, PDOT11DECRYPT_EAPOL_PARSED eapol_parsed, const uint8_t *eapol_raw, const unsigned tot_len, const unsigned char bssid[DOT11DECRYPT_MAC_LEN], const unsigned char sta[DOT11DECRYPT_MAC_LEN])
Definition dot11decrypt.c:829
int Dot11DecryptGetKCK(const PDOT11DECRYPT_KEY_ITEM key, const uint8_t **kck)
Definition dot11decrypt.c:578
WS_DLL_PUBLIC int Dot11DecryptDestroyContext(PDOT11DECRYPT_CONTEXT ctx)
Definition dot11decrypt.c:1185
int Dot11DecryptDecryptPacket(PDOT11DECRYPT_CONTEXT ctx, const uint8_t *data, const unsigned data_off, const unsigned data_len, unsigned char *decrypt_data, uint32_t *decrypt_len, PDOT11DECRYPT_KEY_ITEM key)
int Dot11DecryptDecryptKeyData(PDOT11DECRYPT_CONTEXT ctx, PDOT11DECRYPT_EAPOL_PARSED eapol_parsed, const unsigned char bssid[DOT11DECRYPT_MAC_LEN], const unsigned char sta[DOT11DECRYPT_MAC_LEN], unsigned char *decrypted_data, unsigned *decrypted_len, PDOT11DECRYPT_KEY_ITEM key)
Definition dot11decrypt.c:409
int Dot11DecryptSetLastSSID(PDOT11DECRYPT_CONTEXT ctx, char *pkt_ssid, size_t pkt_ssid_len)
Definition dot11decrypt.c:1134
int Dot11DecryptSetKeys(PDOT11DECRYPT_CONTEXT ctx, DOT11DECRYPT_KEY_ITEM keys[], const size_t keys_nr)
Definition dot11decrypt.c:1054
WS_DLL_PUBLIC int Dot11DecryptInitContext(PDOT11DECRYPT_CONTEXT ctx)
Definition dot11decrypt.c:1163
int Dot11DecryptScanTdlsForKeys(PDOT11DECRYPT_CONTEXT ctx, const uint8_t *data, const unsigned tot_len)
Definition dot11decrypt.c:632
int Dot11DecryptScanFtAssocForKeys(const PDOT11DECRYPT_CONTEXT ctx, const PDOT11DECRYPT_ASSOC_PARSED assoc_parsed, uint8_t *decrypted_gtk, size_t *decrypted_len, DOT11DECRYPT_KEY_ITEM *used_key)
Definition dot11decrypt.c:1822
Definition dot11decrypt_system.h:177
Definition dot11decrypt_system.h:124
Definition dot11decrypt_system.h:153
Definition dot11decrypt_system.h:142
Definition dot11decrypt_user.h:84
Definition dot11decrypt_system.h:93
Definition dot11decrypt_system.h:98
Definition packet-isakmp.c:1889