iPXE
Data Fields
wpa_common_ctx Struct Reference

Common context for WPA security handshaking. More...

#include <wpa.h>

Data Fields

struct net80211_devicedev
 802.11 device we are authenticating for More...
 
u8 pmk [WPA_PMK_LEN]
 The Pairwise Master Key to use in handshaking. More...
 
int pmk_len
 Length of the Pairwise Master Key. More...
 
enum wpa_state state
 State of EAPOL-Key handshaking. More...
 
u64 replay
 Replay counter for this association. More...
 
enum wpa_keymask valid
 Mask of valid keys after authentication success. More...
 
enum net80211_crypto_alg crypt
 The cipher to use for unicast RX and all TX. More...
 
enum net80211_crypto_alg gcrypt
 The cipher to use for broadcast and multicast RX. More...
 
struct wpa_ptk ptk
 The Pairwise Transient Key derived from the handshake. More...
 
struct wpa_gtk gtk
 The Group Transient Key derived from the handshake. More...
 
u8 Anonce [WPA_NONCE_LEN]
 Authenticator-provided nonce. More...
 
u8 Snonce [WPA_NONCE_LEN]
 Supplicant-generated nonce (that's us) More...
 
int have_Snonce
 Whether we should refrain from generating another SNonce. More...
 
void * ap_rsn_ie
 Data in WPA or RSN IE from AP's beacon frame. More...
 
int ap_rsn_ie_len
 Length of ap_rsn_ie. More...
 
int ap_rsn_is_rsn
 Whether ap_rsn_ie is an RSN IE (as opposed to old WPA) More...
 
struct list_head list
 List entry. More...
 

Detailed Description

Common context for WPA security handshaking.

Any implementor of a particular handshaking type (e.g. PSK or EAP) must include this structure at the very beginning of their private data context structure, to allow the EAPOL-Key handling code to work. When the preliminary authentication is done, it is necessary to call wpa_start(), passing the PMK (derived from PSK or EAP MSK) as an argument. The handshaker can use its step function to monitor state in this wpa_ctx structure for success or failure. On success, the keys will be available in ptk and gtk according to the state of the valid bitmask.

After an initial success, the parent handshaker does not need to concern itself with rekeying; the WPA common code takes care of that.

Definition at line 291 of file wpa.h.

Field Documentation

◆ dev

struct net80211_device* wpa_common_ctx::dev

802.11 device we are authenticating for

Definition at line 294 of file wpa.h.

Referenced by wpa_psk_start(), wpa_psk_step(), wpa_psk_stop(), and wpa_stop().

◆ pmk

u8 wpa_common_ctx::pmk[WPA_PMK_LEN]

The Pairwise Master Key to use in handshaking.

This is set either by running the PBKDF2 algorithm on a passphrase with the SSID as salt to generate a pre-shared key, or by copying the first 32 bytes of the EAP Master Session Key in 802.1X-served authentication.

Definition at line 303 of file wpa.h.

Referenced by wpa_psk_start().

◆ pmk_len

int wpa_common_ctx::pmk_len

Length of the Pairwise Master Key.

This is always 32 except with one EAP method which only gives 16 bytes.

Definition at line 310 of file wpa.h.

◆ state

enum wpa_state wpa_common_ctx::state

State of EAPOL-Key handshaking.

Definition at line 313 of file wpa.h.

◆ replay

u64 wpa_common_ctx::replay

Replay counter for this association.

This stores the replay counter value for the most recent packet we've accepted. It is initially initialised to ~0 to show we'll accept anything.

Definition at line 321 of file wpa.h.

◆ valid

enum wpa_keymask wpa_common_ctx::valid

Mask of valid keys after authentication success.

If the PTK is not valid, the GTK should be used for both unicast and multicast decryption; if the GTK is not valid, multicast packets cannot be decrypted.

Definition at line 329 of file wpa.h.

◆ crypt

enum net80211_crypto_alg wpa_common_ctx::crypt

The cipher to use for unicast RX and all TX.

Definition at line 332 of file wpa.h.

◆ gcrypt

enum net80211_crypto_alg wpa_common_ctx::gcrypt

The cipher to use for broadcast and multicast RX.

Definition at line 335 of file wpa.h.

◆ ptk

struct wpa_ptk wpa_common_ctx::ptk

The Pairwise Transient Key derived from the handshake.

Definition at line 338 of file wpa.h.

◆ gtk

struct wpa_gtk wpa_common_ctx::gtk

The Group Transient Key derived from the handshake.

Definition at line 341 of file wpa.h.

◆ Anonce

u8 wpa_common_ctx::Anonce[WPA_NONCE_LEN]

Authenticator-provided nonce.

Definition at line 344 of file wpa.h.

◆ Snonce

u8 wpa_common_ctx::Snonce[WPA_NONCE_LEN]

Supplicant-generated nonce (that's us)

Definition at line 347 of file wpa.h.

◆ have_Snonce

int wpa_common_ctx::have_Snonce

Whether we should refrain from generating another SNonce.

Definition at line 350 of file wpa.h.

◆ ap_rsn_ie

void* wpa_common_ctx::ap_rsn_ie

Data in WPA or RSN IE from AP's beacon frame.

Definition at line 353 of file wpa.h.

◆ ap_rsn_ie_len

int wpa_common_ctx::ap_rsn_ie_len

Length of ap_rsn_ie.

Definition at line 356 of file wpa.h.

◆ ap_rsn_is_rsn

int wpa_common_ctx::ap_rsn_is_rsn

Whether ap_rsn_ie is an RSN IE (as opposed to old WPA)

Definition at line 359 of file wpa.h.

◆ list

struct list_head wpa_common_ctx::list

List entry.

Definition at line 362 of file wpa.h.

Referenced by wpa_stop().


The documentation for this struct was generated from the following file: