16#ifndef LIBWIFI_CORE_SECURITY_H
17#define LIBWIFI_CORE_SECURITY_H
22#define EAPOL_KEY_INFO_M1 0x008A
23#define EAPOL_KEY_INFO_M2 0x010A
24#define EAPOL_KEY_INFO_M3 0x13CA
25#define EAPOL_KEY_INFO_M4 0x030A
28#define LIBWIFI_MAX_CIPHER_SUITES 6
31#define MICROSOFT_OUI "\x00\x50\xF2"
32#define CIPHER_SUITE_OUI "\x00\x0F\xAC"
35#define MICROSOFT_OUI_TYPE_WPA 1
36#define MICROSOFT_OUI_TYPE_WMM 2
37#define MICROSOFT_OUI_TYPE_WPS 4
40#define CIPHER_SUITE_GROUP 0
41#define CIPHER_SUITE_WEP40 1
42#define CIPHER_SUITE_TKIP 2
43#define CIPHER_SUITE_RESERVED 3
44#define CIPHER_SUITE_CCMP128 4
45#define CIPHER_SUITE_WEP104 5
46#define CIPHER_SUITE_BIP_CMAC128 6
47#define CIPHER_SUITE_NOTALLOWED 7
48#define CIPHER_SUITE_GCMP128 8
49#define CIPHER_SUITE_GCMP256 9
50#define CIPHER_SUITE_CCMP256 10
51#define CIPHER_SUITE_BIP_GMAC128 11
52#define CIPHER_SUITE_BIP_GMAC256 12
53#define CIPHER_SUITE_BIP_CMAC256 13
56#define AKM_SUITE_RESERVED 0
58#define AKM_SUITE_PSK 2
59#define AKM_SUITE_1X_FT 3
60#define AKM_SUITE_PSK_FT 4
61#define AKM_SUITE_1X_SHA256 5
62#define AKM_SUITE_PSK_SHA256 6
63#define AKM_SUITE_TDLS 7
64#define AKM_SUITE_SAE 8
65#define AKM_SUITE_SAE_FT 9
66#define AKM_SUITE_AP_PEER 10
67#define AKM_SUITE_1X_SUITEB_SHA256 11
68#define AKM_SUITE_1X_SUITEB_SHA384 12
69#define AKM_SUITE_1X_FT_SHA384 13
70#define AKM_SUITE_FILS_SHA256 14
71#define AKM_SUITE_FILS_SHA384 15
72#define AKM_SUITE_FILS_SHA256_FT 16
73#define AKM_SUITE_FILS_SHA384_FT 17
74#define AKM_SUITE_OWE 18
75#define AKM_PSK_SHA384_FT 19
76#define AKM_PSK_SHA384 20
80#define AUTH_SHARED_KEY 1
81#define AUTH_FAST_BSS 2
83#define AUTH_VENDOR 65535
86#define WEP (1ULL << 1)
87#define WPA (1ULL << 2)
88#define WPA2 (1ULL << 3)
89#define WPA3 (1ULL << 4)
92#define LIBWIFI_GROUP_CIPHER_SUITE_WEP40 (1ULL << 5)
93#define LIBWIFI_GROUP_CIPHER_SUITE_TKIP (1ULL << 6)
94#define LIBWIFI_GROUP_CIPHER_SUITE_RESERVED (1ULL << 7)
95#define LIBWIFI_GROUP_CIPHER_SUITE_CCMP128 (1ULL << 8)
96#define LIBWIFI_GROUP_CIPHER_SUITE_WEP104 (1ULL << 9)
97#define LIBWIFI_GROUP_CIPHER_SUITE_BIP_CMAC128 (1ULL << 10)
98#define LIBWIFI_GROUP_CIPHER_SUITE_NOTALLOWED (1ULL << 11)
99#define LIBWIFI_GROUP_CIPHER_SUITE_GCMP128 (1ULL << 12)
100#define LIBWIFI_GROUP_CIPHER_SUITE_GCMP256 (1ULL << 13)
101#define LIBWIFI_GROUP_CIPHER_SUITE_CCMP256 (1ULL << 14)
102#define LIBWIFI_GROUP_CIPHER_SUITE_BIP_GMAC128 (1ULL << 15)
103#define LIBWIFI_GROUP_CIPHER_SUITE_BIP_GMAC256 (1ULL << 16)
104#define LIBWIFI_GROUP_CIPHER_SUITE_BIP_CMAC256 (1ULL << 17)
107#define LIBWIFI_PAIRWISE_SUITE_GROUP (1ULL << 18)
108#define LIBWIFI_PAIRWISE_CIPHER_SUITE_WEP40 (1ULL << 19)
109#define LIBWIFI_PAIRWISE_CIPHER_SUITE_TKIP (1ULL << 20)
110#define LIBWIFI_PAIRWISE_CIPHER_SUITE_RESERVED (1ULL << 21)
111#define LIBWIFI_PAIRWISE_CIPHER_SUITE_CCMP128 (1ULL << 22)
112#define LIBWIFI_PAIRWISE_CIPHER_SUITE_WEP104 (1ULL << 23)
113#define LIBWIFI_PAIRWISE_CIPHER_SUITE_BIP_CMAC128 (1ULL << 24)
114#define LIBWIFI_PAIRWISE_CIPHER_SUITE_NOTALLOWED (1ULL << 25)
115#define LIBWIFI_PAIRWISE_CIPHER_SUITE_GCMP128 (1ULL << 26)
116#define LIBWIFI_PAIRWISE_CIPHER_SUITE_GCMP256 (1ULL << 27)
117#define LIBWIFI_PAIRWISE_CIPHER_SUITE_CCMP256 (1ULL << 28)
118#define LIBWIFI_PAIRWISE_CIPHER_SUITE_BIP_GMAC128 (1ULL << 29)
119#define LIBWIFI_PAIRWISE_CIPHER_SUITE_BIP_GMAC256 (1ULL << 30)
120#define LIBWIFI_PAIRWISE_CIPHER_SUITE_BIP_CMAC256 (1ULL << 31)
123#define LIBWIFI_AKM_SUITE_RESERVED (1ULL << 32)
124#define LIBWIFI_AKM_SUITE_1X (1ULL << 33)
125#define LIBWIFI_AKM_SUITE_PSK (1ULL << 34)
126#define LIBWIFI_AKM_SUITE_1X_FT (1ULL << 35)
127#define LIBWIFI_AKM_SUITE_PSK_FT (1ULL << 36)
128#define LIBWIFI_AKM_SUITE_1X_SHA256 (1ULL << 37)
129#define LIBWIFI_AKM_SUITE_PSK_SHA256 (1ULL << 39)
130#define LIBWIFI_AKM_SUITE_TDLS (1ULL << 40)
131#define LIBWIFI_AKM_SUITE_SAE (1ULL << 41)
132#define LIBWIFI_AKM_SUITE_SAE_FT (1ULL << 42)
133#define LIBWIFI_AKM_SUITE_AP_PEER (1ULL << 43)
134#define LIBWIFI_AKM_SUITE_1X_SUITEB_SHA256 (1ULL << 44)
135#define LIBWIFI_AKM_SUITE_1X_SUITEB_SHA384 (1ULL << 45)
136#define LIBWIFI_AKM_SUITE_1X_FT_SHA384 (1ULL << 46)
137#define LIBWIFI_AKM_SUITE_FILS_SHA256 (1ULL << 47)
138#define LIBWIFI_AKM_SUITE_FILS_SHA384 (1ULL << 48)
139#define LIBWIFI_AKM_SUITE_FILS_SHA256_FT (1ULL << 49)
140#define LIBWIFI_AKM_SUITE_FILS_SHA384_FT (1ULL << 50)
141#define LIBWIFI_AKM_SUITE_OWE (1ULL << 51)
142#define LIBWIFI_AKM_PSK_SHA384_FT (1ULL << 52)
143#define LIBWIFI_AKM_PSK_SHA384 (1ULL << 53)
146#define LIBWIFI_AUTH_OPEN (1ULL << 54)
147#define LIBWIFI_AUTH_SHARED_KEY (1ULL << 55)
148#define LIBWIFI_AUTH_FAST_BSS (1ULL << 56)
149#define LIBWIFI_AUTH_SAE (1ULL << 57)
150#define LIBWIFI_AUTH_VENDOR (1ULL << 58)
153#define LIBWIFI_RSN_CAPAB_PREAUTH (1 << 0)
154#define LIBWIFI_RSN_CAPAB_PAIRWISE (1 << 1)
155#define LIBWIFI_RSN_CAPAB_PTKSA_REPLAY (1 << 2 | 1 << 3)
156#define LIBWIFI_RSN_CAPAB_GTKSA_REPLAY (1 << 4 | 1 << 5)
157#define LIBWIFI_RSN_CAPAB_MFP_REQUIRED (1 << 6)
158#define LIBWIFI_RSN_CAPAB_MFP_CAPABLE (1 << 7)
159#define LIBWIFI_RSN_CAPAB_JOINT_RSNA (1 << 8)
160#define LIBWIFI_RSN_CAPAB_PEERKEY (1 << 9)
161#define LIBWIFI_RSN_CAPAB_EXT_KEY_ID (1 << 13)
259 unsigned char iv[16];
struct libwifi_cipher_suite __attribute__((packed))
#define LIBWIFI_MAX_CIPHER_SUITES
libwifi Representation of a WPA or RSN cipher suite ┌────────────────────────┬────────────┐ │ OUI │ S...
libwifi Representation of a 802.11 RSN Information Element ┌───────────────────────────────────┐ │ Ve...
uint16_t rsn_capabilities
int num_pairwise_cipher_suites
int num_auth_key_mgmt_suites
struct libwifi_cipher_suite auth_key_mgmt_suites[LIBWIFI_MAX_CIPHER_SUITES]
struct libwifi_cipher_suite pairwise_cipher_suites[LIBWIFI_MAX_CIPHER_SUITES]
struct libwifi_cipher_suite group_cipher_suite
libwifi Representation of the encapsulating 802.1X data in an EAPOL frame ┌─────────────────┐ │ Versi...
struct libwifi_wpa_key_info key_info
libwifi Representation of a Microsoft WPA Information Element ┌───────────────────────────────────┐ │...
struct libwifi_cipher_suite unicast_cipher_suites[LIBWIFI_MAX_CIPHER_SUITES]
struct libwifi_cipher_suite multicast_cipher_suite
uint16_t num_unicast_cipher_suites
struct libwifi_cipher_suite auth_key_mgmt_suites[LIBWIFI_MAX_CIPHER_SUITES]
uint16_t num_auth_key_mgmt_suites