iPXE
Data Fields
net80211_crypto Struct Reference

Interface to an 802.11 cryptosystem. More...

#include <net80211.h>

Data Fields

enum net80211_crypto_alg algorithm
 The cryptographic algorithm implemented.
int(* init )(struct net80211_crypto *crypto, const void *key, int keylen, const void *rsc)
 Initialize cryptosystem using a given key.
struct io_buffer *(* encrypt )(struct net80211_crypto *crypto, struct io_buffer *iob)
 Encrypt a frame using the cryptosystem.
struct io_buffer *(* decrypt )(struct net80211_crypto *crypto, struct io_buffer *iob)
 Decrypt a frame using the cryptosystem.
int priv_len
 Length of private data requested to be allocated.
void * priv
 Private data for the algorithm to store key and state info.

Detailed Description

Interface to an 802.11 cryptosystem.

Cryptosystems define a net80211_crypto structure statically, using a iPXE linker table to make it available to the 802.11 layer. When the cryptosystem needs to be used, the 802.11 code will allocate a copy of the static definition plus whatever space the algorithm has requested for private state, and point net80211_device::crypto or net80211_device::gcrypto at it.

Definition at line 689 of file net80211.h.


Field Documentation

The cryptographic algorithm implemented.

Definition at line 692 of file net80211.h.

Referenced by ath_tx_setup_buffer(), sec80211_install(), and wpa_find_cryptosystem().

int( * net80211_crypto::init)(struct net80211_crypto *crypto, const void *key, int keylen, const void *rsc)

Initialize cryptosystem using a given key.

Parameters:
crypto802.11 cryptosystem
keyPointer to key bytes
keylenNumber of key bytes
rscInitial receive sequence counter, if applicable
Return values:
rcReturn status code

This method is passed the communication key provided by the security handshake handler, which will already be in the low-level form required. It may not store a pointer to the key after returning; it must copy it to its private storage.

Definition at line 707 of file net80211.h.

Referenced by sec80211_install(), and trivial_change_key().

struct io_buffer*( * net80211_crypto::encrypt)(struct net80211_crypto *crypto, struct io_buffer *iob) [read]

Encrypt a frame using the cryptosystem.

Parameters:
crypto802.11 cryptosystem
iobI/O buffer
Return values:
eiobNewly allocated I/O buffer with encrypted packet

This method is called to encrypt a single frame. It is guaranteed that initialize() will have completed successfully before this method is called.

The frame passed already has an 802.11 header prepended, but the PROTECTED bit in the frame control field will not be set; this method is responsible for setting it. The returned I/O buffer should contain a complete copy of iob, including the 802.11 header, but with the PROTECTED bit set, the data encrypted, and whatever encryption headers/trailers are necessary added.

This method should never free the passed I/O buffer.

Return NULL if the packet could not be encrypted, due to memory limitations or otherwise.

Definition at line 733 of file net80211.h.

Referenced by net80211_handle_auth(), net80211_netdev_transmit(), and net80211_tx_mgmt().

struct io_buffer*( * net80211_crypto::decrypt)(struct net80211_crypto *crypto, struct io_buffer *iob) [read]

Decrypt a frame using the cryptosystem.

Parameters:
crypto802.11 cryptosystem
eiobEncrypted I/O buffer
Return values:
iobNewly allocated I/O buffer with decrypted packet

This method is called to decrypt a single frame. It is guaranteed that initialize() will have completed successfully before this method is called.

Decryption follows the reverse of the pattern used for encryption: this method must copy the 802.11 header into the returned packet, decrypt the data stream, remove any encryption header or trailer, and clear the PROTECTED bit in the frame control header.

This method should never free the passed I/O buffer.

Return NULL if memory was not available for decryption, if a consistency or integrity check on the decrypted frame failed, or if the decrypted frame should not be processed by the network stack for any other reason.

Definition at line 759 of file net80211.h.

Referenced by net80211_rx().

Length of private data requested to be allocated.

Definition at line 763 of file net80211.h.

Referenced by sec80211_install().

Private data for the algorithm to store key and state info.

Definition at line 766 of file net80211.h.

Referenced by ccmp_decrypt(), ccmp_encrypt(), ccmp_init(), sec80211_install(), tkip_decrypt(), tkip_encrypt(), tkip_init(), wep_decrypt(), wep_encrypt(), and wep_init().


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