35#define EAPOL_KEY_TYPE_RSN 2
38#define EAPOL_KEY_TYPE_WPA 254
47#define EAPOL_KEY_INFO_VERSION 0x0007
50#define EAPOL_KEY_INFO_TYPE 0x0008
53#define EAPOL_KEY_INFO_INSTALL 0x0040
56#define EAPOL_KEY_INFO_KEY_ACK 0x0080
59#define EAPOL_KEY_INFO_KEY_MIC 0x0100
62#define EAPOL_KEY_INFO_SECURE 0x0200
65#define EAPOL_KEY_INFO_ERROR 0x0400
68#define EAPOL_KEY_INFO_REQUEST 0x0800
71#define EAPOL_KEY_INFO_KEY_ENC 0x1000
74#define EAPOL_KEY_INFO_SMC_MESS 0x2000
78#define EAPOL_KEY_VERSION_WPA 1
81#define EAPOL_KEY_VERSION_WPA2 2
84#define EAPOL_KEY_TYPE_PTK 0x0008
87#define EAPOL_KEY_TYPE_GTK 0x0000
204#define WPA_NONCE_LEN 32
207#define WPA_TKIP_KEY_LEN 16
210#define WPA_TKIP_MIC_KEY_LEN 8
213#define WPA_CCMP_KEY_LEN 16
216#define WPA_KCK_LEN 16
219#define WPA_KEK_LEN 16
222#define WPA_PMK_LEN 32
225#define WPA_PMKID_LEN 16
407#define WPA_KIES __table ( struct wpa_kie, "wpa_kies" )
408#define __wpa_kie __table_entry ( WPA_KIES, 01 )
435#define WPA_GTK_KID 0x03
438#define WPA_GTK_TXBIT 0x04
442#define WPA_KDE_GTK _MKOUI ( 0x00, 0x0F, 0xAC, 0x01 )
445#define WPA_KDE_MAC _MKOUI ( 0x00, 0x0F, 0xAC, 0x03 )
448#define WPA_KDE_PMKID _MKOUI ( 0x00, 0x0F, 0xAC, 0x04 )
451#define WPA_KDE_NONCE _MKOUI ( 0x00, 0x0F, 0xAC, 0x06 )
454#define WPA_KDE_LIFETIME _MKOUI ( 0x00, 0x0F, 0xAC, 0x07 )
501 const void *pmk,
size_t pmk_len );
struct golan_eq_context ctx
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
enum wpa_state __attribute__
Constants and data structures defined in IEEE 802.11, subsetted according to what iPXE knows how to u...
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
net80211_crypto_alg
An 802.11 data encryption algorithm.
u8 iv[16]
Initialization vector.
u16 keysize
Length of encryption key to be used, network byte order.
u8 rsc[8]
Receive sequence counter for GTK.
u8 mic[16]
Message integrity code over the entire EAPOL frame.
u16 info
Bitfield of key characteristics, network byte order.
u8 type
One of the EAPOL_KEY_TYPE_* defines.
u8 _reserved[8]
Reserved bytes.
u16 datalen
Length of the data field in bytes, network byte order.
u64 replay
Monotonically increasing value for EAPOL-Key conversations.
A doubly-linked list entry (or list head)
Structure encapsulating the complete state of an 802.11 device.
Structure of the Temporal Key for TKIP encryption.
u8 rx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets from the AP.
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
u8 key[WPA_TKIP_KEY_LEN]
Main key: input to TKIP Phase 1 and Phase 2 key mixing functions.
Common context for WPA security handshaking.
u8 Snonce[WPA_NONCE_LEN]
Supplicant-generated nonce (that's us)
struct list_head list
List entry.
u64 replay
Replay counter for this association.
void * ap_rsn_ie
Data in WPA or RSN IE from AP's beacon frame.
enum net80211_crypto_alg gcrypt
The cipher to use for broadcast and multicast RX.
int pmk_len
Length of the Pairwise Master Key.
struct net80211_device * dev
802.11 device we are authenticating for
int have_Snonce
Whether we should refrain from generating another SNonce.
u8 Anonce[WPA_NONCE_LEN]
Authenticator-provided nonce.
struct wpa_ptk ptk
The Pairwise Transient Key derived from the handshake.
enum wpa_keymask valid
Mask of valid keys after authentication success.
enum wpa_state state
State of EAPOL-Key handshaking.
enum net80211_crypto_alg crypt
The cipher to use for unicast RX and all TX.
int ap_rsn_ie_len
Length of ap_rsn_ie.
struct wpa_gtk gtk
The Group Transient Key derived from the handshake.
int ap_rsn_is_rsn
Whether ap_rsn_ie is an RSN IE (as opposed to old WPA)
u8 pmk[WPA_PMK_LEN]
The Pairwise Master Key to use in handshaking.
Structure of the Group Transient Key.
union wpa_tk tk
Temporal key.
Payload structure of the GTK-encapsulating KDE.
struct wpa_gtk gtk
Encapsulated group transient key.
Any key descriptor element type.
u8 mac[ETH_ALEN]
For MAC-type KDEs, the MAC address.
u8 pmkid[WPA_PMKID_LEN]
For PMKID-type KDEs, the PMKID.
u32 oui_type
OUI + type byte.
u32 lifetime
For Lifetime-type KDEs, the lifetime in seconds.
u8 len
Length, not including ie_type and length fields.
struct wpa_kde_gtk_encap gtk_encap
For GTK-type KDEs, encapsulated GTK.
u8 ie_type
Information element type: always 0xDD (IEEE80211_IE_VENDOR)
u8 nonce[WPA_NONCE_LEN]
For Nonce-type KDEs, the nonce.
WPA handshake key integrity and encryption handler.
int version
Value of version bits in EAPOL-Key info field for which to use.
int(* decrypt)(const void *kek, const void *iv, void *msg, u16 *len)
Decrypt key data.
void(* mic)(const void *kck, const void *msg, size_t len, void *mic)
Calculate MIC over message.
Structure of the Pairwise Transient Key.
u8 kek[WPA_KEK_LEN]
EAPOL-Key Key Encryption Key (KEK)
union wpa_tk tk
Temporal key.
u8 kck[WPA_KCK_LEN]
EAPOL-Key Key Confirmation Key (KCK)
Any 802.11 information element.
Structure of a generic Temporal Key.
struct tkip_tk tkip
TKIP keys.
u8 ccmp[WPA_CCMP_KEY_LEN]
CCMP key.
#define WPA_KEK_LEN
Length of an EAPOL Key Encryption Key.
void wpa_stop(struct net80211_device *dev)
Disable handling of received WPA handshake frames.
u8 iv[16]
Initialization vector.
#define WPA_CCMP_KEY_LEN
Length of a CCMP key.
#define WPA_TKIP_MIC_KEY_LEN
Length of a TKIP MIC key.
#define WPA_PMKID_LEN
Length of a PMKID.
#define WPA_NONCE_LEN
Length of a nonce.
#define WPA_PMK_LEN
Usual length of a Pairwise Master Key.
u8 mic[16]
Message integrity code over the entire EAPOL frame.
u8 kek[WPA_KEK_LEN]
EAPOL-Key Key Encryption Key (KEK)
#define WPA_KCK_LEN
Length of an EAPOL Key Confirmation Key.
wpa_keymask
Bitfield indicating a selection of WPA transient keys.
@ WPA_GTK
Group transient key.
@ WPA_PTK
Pairwise transient key.
int wpa_make_rsn_ie(struct net80211_device *dev, union ieee80211_ie **ie)
Construct RSN or WPA information element.
wpa_state
WPA handshaking state.
@ WPA_FAILURE
4-Way Handshake failed
@ WPA_WAITING
Waiting for PMK to be set.
@ WPA_WORKING
Performing 4-Way Handshake.
@ WPA_SUCCESS
4-Way Handshake succeeded
@ WPA_READY
Ready for 4-Way Handshake.
#define WPA_TKIP_KEY_LEN
Length of a TKIP main key.
int wpa_start(struct net80211_device *dev, struct wpa_common_ctx *ctx, const void *pmk, size_t pmk_len)
Set up generic WPA support to handle 4-Way Handshake.
u8 len
Length, not including ie_type and length fields.
u8 kck[WPA_KCK_LEN]
EAPOL-Key Key Confirmation Key (KCK)