iPXE
Data Fields
net80211_handshaker Struct Reference

Interface to an 802.11 security handshaking protocol. More...

#include <net80211.h>

Data Fields

enum net80211_security_proto protocol
 The security handshaking protocol implemented. More...
 
int(* init )(struct net80211_device *dev)
 Initialize security handshaking protocol. More...
 
int(* start )(struct net80211_device *dev)
 Start handshaking. More...
 
int(* step )(struct net80211_device *dev)
 Process handshaking state. More...
 
int(* change_key )(struct net80211_device *dev)
 Change cryptographic key based on setting. More...
 
void(* stop )(struct net80211_device *dev)
 Stop security handshaking handlers. More...
 
int priv_len
 Amount of private data requested. More...
 
int started
 Whether start has been called. More...
 
void * priv
 Pointer to private data. More...
 

Detailed Description

Interface to an 802.11 security handshaking protocol.

Security handshaking protocols handle parsing a user-specified key into a suitable input to the encryption algorithm, and for WPA and better systems, manage performing whatever authentication with the network is necessary.

At all times when any method in this structure is called with a net80211_device argument dev, a dynamically allocated copy of the handshaker structure itself with space for the requested amount of private data may be accessed as dev->handshaker. The structure will not be modified, and will only be freed during reassociation and device closing after the stop method has been called.

Definition at line 564 of file net80211.h.

Field Documentation

◆ protocol

enum net80211_security_proto net80211_handshaker::protocol

The security handshaking protocol implemented.

Definition at line 567 of file net80211.h.

◆ init

int( * net80211_handshaker::init) (struct net80211_device *dev)

Initialize security handshaking protocol.

Parameters
dev802.11 device
Return values
rcReturn status code

This method is expected to access netX/key or other applicable settings to determine the parameters for handshaking. If no handshaking is required, it should call sec80211_install() with the cryptosystem and key that are to be used, and start and step should be set to NULL.

This is always called just before association is performed, but after its parameters have been set; in particular, you may rely on the contents of the essid field in dev.

Definition at line 585 of file net80211.h.

Referenced by net80211_prepare_assoc().

◆ start

int( * net80211_handshaker::start) (struct net80211_device *dev)

Start handshaking.

Parameters
dev802.11 device
Return values
rcReturn status code

This method is expected to set up internal state so that packets sent immediately after association, before step can be called, will be handled appropriately.

This is always called just before association is attempted.

Definition at line 598 of file net80211.h.

Referenced by net80211_step_associate().

◆ step

int( * net80211_handshaker::step) (struct net80211_device *dev)

Process handshaking state.

Parameters
dev802.11 device
Return values
rcReturn status code, or positive if done

This method is expected to perform as much progress on the protocol it implements as is possible without blocking. It should return 0 if it wishes to be called again, a negative return status code on error, or a positive value if handshaking is complete. In the case of a positive return, net80211_crypto_install() must have been called.

If handshaking may require further action (e.g. an AP that might decide to rekey), handlers must be installed by this function that will act without further calls to step.

Definition at line 616 of file net80211.h.

Referenced by net80211_step_associate().

◆ change_key

int( * net80211_handshaker::change_key) (struct net80211_device *dev)

Change cryptographic key based on setting.

Parameters
dev802.11 device
Return values
rcReturn status code

This method is called whenever the netX/key setting may have been changed. It is expected to determine whether it did in fact change, and if so, to install the new key using net80211_crypto_install(). If it is not possible to do this immediately, this method should return an error; in that case the 802.11 stack will reassociate, following the usual init/start/step sequence.

This method is only relevant when it is possible to associate successfully with an incorrect key. When it is not, a failed association will be retried until the user changes the key setting, and a successful association will not be dropped due to such a change. When association with an incorrect key is impossible, this function should return 0 after performing no action.

Definition at line 639 of file net80211.h.

Referenced by net80211_check_settings_update().

◆ stop

void( * net80211_handshaker::stop) (struct net80211_device *dev)

Stop security handshaking handlers.

Parameters
dev802.11 device

This method is called just before freeing a security handshaker; it could, for example, delete a process that start had created to manage the security of the connection. If not needed it may be set to NULL.

Definition at line 650 of file net80211.h.

Referenced by net80211_netdev_close(), and net80211_prepare_assoc().

◆ priv_len

int net80211_handshaker::priv_len

Amount of private data requested.

Before init is called for the first time, this structure's priv pointer will point to this many bytes of allocated data, where the allocation will be performed separately for each net80211_device.

Definition at line 659 of file net80211.h.

◆ started

int net80211_handshaker::started

Whether start has been called.

Reset to 0 after stop is called.

Definition at line 665 of file net80211.h.

Referenced by net80211_netdev_close(), net80211_prepare_assoc(), and net80211_step_associate().

◆ priv

void* net80211_handshaker::priv

Pointer to private data.

In initializing this structure statically for a linker table, set this to NULL.

Definition at line 672 of file net80211.h.

Referenced by net80211_prepare_assoc(), wpa_psk_start(), and wpa_psk_step().


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