wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
eapol_common.h
Go to the documentation of this file.
1 
5 #ifndef EAPOL_COMMON_H
6 #define EAPOL_COMMON_H
7 
8 /* IEEE Std 802.1X-2004 */
9 
10 #ifdef _MSC_VER
11 #pragma pack(push, 1)
12 #endif /* _MSC_VER */
13 
15  u8 version;
16  u8 type;
17  be16 length;
18  /* followed by length octets of data */
19 } STRUCT_PACKED;
20 
21 struct ieee8023_hdr {
22  u8 dest[ETH_ALEN];
23  u8 src[ETH_ALEN];
24  u16 ethertype;
25 } STRUCT_PACKED;
26 
27 #ifdef _MSC_VER
28 #pragma pack(pop)
29 #endif /* _MSC_VER */
30 
31 #ifdef CONFIG_MACSEC
32 #define EAPOL_VERSION 3
33 #else /* CONFIG_MACSEC */
34 #define EAPOL_VERSION 2
35 #endif /* CONFIG_MACSEC */
36 
37 enum { IEEE802_1X_TYPE_EAP_PACKET = 0,
38  IEEE802_1X_TYPE_EAPOL_START = 1,
39  IEEE802_1X_TYPE_EAPOL_LOGOFF = 2,
40  IEEE802_1X_TYPE_EAPOL_KEY = 3,
41  IEEE802_1X_TYPE_EAPOL_ENCAPSULATED_ASF_ALERT = 4,
42  IEEE802_1X_TYPE_EAPOL_MKA = 5,
43 };
44 
45 enum { EAPOL_KEY_TYPE_RC4 = 1, EAPOL_KEY_TYPE_RSN = 2,
46  EAPOL_KEY_TYPE_WPA = 254 };
47 
48 
49 #define IEEE8021X_REPLAY_COUNTER_LEN 8
50 #define IEEE8021X_KEY_SIGN_LEN 16
51 #define IEEE8021X_KEY_IV_LEN 16
52 
53 #define IEEE8021X_KEY_INDEX_FLAG 0x80
54 #define IEEE8021X_KEY_INDEX_MASK 0x03
55 
56 #ifdef _MSC_VER
57 #pragma pack(push, 1)
58 #endif /* _MSC_VER */
59 
61  u8 type;
62  /* Note: key_length is unaligned */
63  u8 key_length[2];
64  /* does not repeat within the life of the keying material used to
65  * encrypt the Key field; 64-bit NTP timestamp MAY be used here */
66  u8 replay_counter[IEEE8021X_REPLAY_COUNTER_LEN];
67  u8 key_iv[IEEE8021X_KEY_IV_LEN]; /* cryptographically random number */
68  u8 key_index; /* key flag in the most significant bit:
69  * 0 = broadcast (default key),
70  * 1 = unicast (key mapping key); key index is in the
71  * 7 least significant bits */
72  /* HMAC-MD5 message integrity check computed with MS-MPPE-Send-Key as
73  * the key */
74  u8 key_signature[IEEE8021X_KEY_SIGN_LEN];
75 
76  /* followed by key: if packet body length = 44 + key length, then the
77  * key field (of key_length bytes) contains the key in encrypted form;
78  * if packet body length = 44, key field is absent and key_length
79  * represents the number of least significant octets from
80  * MS-MPPE-Send-Key attribute to be used as the keying material;
81  * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */
82 } STRUCT_PACKED;
83 
84 #ifdef _MSC_VER
85 #pragma pack(pop)
86 #endif /* _MSC_VER */
87 
88 #endif /* EAPOL_COMMON_H */
Definition: eapol_common.h:60
Definition: eapol_common.h:21
Definition: eapol_common.h:14