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 );
u64 replay
Replay counter for this association.
u8 type
One of the EAPOL_KEY_TYPE_* defines.
Performing 4-Way Handshake.
struct net80211_device * dev
802.11 device we are authenticating for
#define WPA_KCK_LEN
Length of an EAPOL Key Confirmation Key.
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
u8 pmkid[WPA_PMKID_LEN]
For PMKID-type KDEs, the PMKID.
Constants and data structures defined in IEEE 802.11, subsetted according to what iPXE knows how to u...
WPA handshake key integrity and encryption handler.
u8 kck[WPA_KCK_LEN]
EAPOL-Key Key Confirmation Key (KCK)
struct wpa_ptk ptk
The Pairwise Transient Key derived from the handshake.
u8 nonce[WPA_NONCE_LEN]
For Nonce-type KDEs, the nonce.
int pmk_len
Length of the Pairwise Master Key.
enum net80211_crypto_alg crypt
The cipher to use for unicast RX and all TX.
struct wpa_gtk gtk
Encapsulated group transient key.
union wpa_tk tk
Temporal key.
enum net80211_crypto_alg gcrypt
The cipher to use for broadcast and multicast RX.
struct golan_eq_context ctx
u16 keysize
Length of encryption key to be used, network byte order.
Ready for 4-Way Handshake.
u8 pmk[WPA_PMK_LEN]
The Pairwise Master Key to use in handshaking.
u8 iv[16]
Initialization vector.
struct wpa_gtk gtk
The Group Transient Key derived from the handshake.
#define WPA_PMK_LEN
Usual length of a Pairwise Master Key.
A doubly-linked list entry (or list head)
#define WPA_PMKID_LEN
Length of a PMKID.
u8 mic[16]
Message integrity code over the entire EAPOL frame.
u8 kck[WPA_KCK_LEN]
EAPOL-Key Key Confirmation Key (KCK)
u32 lifetime
For Lifetime-type KDEs, the lifetime in seconds.
u8 len
Length, not including ie_type and length fields.
#define WPA_TKIP_KEY_LEN
Length of a TKIP main key.
u8 rsc[8]
Receive sequence counter for GTK.
u32 oui_type
OUI + type byte.
4-Way Handshake succeeded
int version
Value of version bits in EAPOL-Key info field for which to use.
Common context for WPA security handshaking.
Structure of the Group Transient Key.
#define WPA_NONCE_LEN
Length of a nonce.
u16 info
Bitfield of key characteristics, network byte order.
int(* decrypt)(const void *kek, const void *iv, void *msg, u16 *len)
Decrypt key data.
Structure of the Pairwise Transient Key.
enum wpa_state __attribute__
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.
wpa_state
WPA handshaking state.
u8 kek[WPA_KEK_LEN]
EAPOL-Key Key Encryption Key (KEK)
Waiting for PMK to be set.
Structure encapsulating the complete state of an 802.11 device.
wpa_keymask
Bitfield indicating a selection of WPA transient keys.
void(* mic)(const void *kck, const void *msg, size_t len, void *mic)
Calculate MIC over message.
void wpa_stop(struct net80211_device *dev)
Disable handling of received WPA handshake frames.
u8 rx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets from the AP.
u16 datalen
Length of the data field in bytes, network byte order.
FILE_LICENCE(GPL2_OR_LATER)
struct wpa_kde_gtk_encap gtk_encap
For GTK-type KDEs, encapsulated GTK.
Any 802.11 information element.
int ap_rsn_ie_len
Length of ap_rsn_ie.
u8 ccmp[WPA_CCMP_KEY_LEN]
CCMP key.
struct tkip_tk tkip
TKIP keys.
enum wpa_keymask valid
Mask of valid keys after authentication success.
Structure of the Temporal Key for TKIP encryption.
u8 Anonce[WPA_NONCE_LEN]
Authenticator-provided nonce.
net80211_crypto_alg
An 802.11 data encryption algorithm.
#define WPA_KEK_LEN
Length of an EAPOL Key Encryption Key.
u8 Snonce[WPA_NONCE_LEN]
Supplicant-generated nonce (that's us)
union wpa_tk tk
Temporal key.
#define WPA_TKIP_MIC_KEY_LEN
Length of a TKIP MIC key.
u8 _reserved[8]
Reserved bytes.
struct list_head list
List entry.
u8 iv[16]
Initialization vector.
u8 key[WPA_TKIP_KEY_LEN]
Main key: input to TKIP Phase 1 and Phase 2 key mixing functions.
u8 len
Length, not including ie_type and length fields.
int ap_rsn_is_rsn
Whether ap_rsn_ie is an RSN IE (as opposed to old WPA)
Any key descriptor element type.
Payload structure of the GTK-encapsulating KDE.
#define WPA_CCMP_KEY_LEN
Length of a CCMP key.
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
u8 ie_type
Information element type: always 0xDD (IEEE80211_IE_VENDOR)
struct tkip_tk::@651 __attribute__((packed)) mic
Michael MIC keys.
int wpa_make_rsn_ie(struct net80211_device *dev, union ieee80211_ie **ie)
Construct RSN or WPA information element.
int have_Snonce
Whether we should refrain from generating another SNonce.
enum wpa_state state
State of EAPOL-Key handshaking.
u8 kek[WPA_KEK_LEN]
EAPOL-Key Key Encryption Key (KEK)
u8 mic[16]
Message integrity code over the entire EAPOL frame.
u64 replay
Monotonically increasing value for EAPOL-Key conversations.
void * ap_rsn_ie
Data in WPA or RSN IE from AP's beacon frame.
u8 mac[ETH_ALEN]
For MAC-type KDEs, the MAC address.
Structure of a generic Temporal Key.