wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
wpa_auth.c File Reference

IEEE 802.11 RSN / WPA Authenticator. More...

#include "utils/includes.h"
#include "utils/common.h"
#include "utils/eloop.h"
#include "utils/state_machine.h"
#include "utils/bitfield.h"
#include "common/ieee802_11_defs.h"
#include "crypto/aes_wrap.h"
#include "crypto/crypto.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
#include "crypto/random.h"
#include "eapol_auth/eapol_auth_sm.h"
#include "ap_config.h"
#include "ieee802_11.h"
#include "wpa_auth.h"
#include "pmksa_cache_auth.h"
#include "wpa_auth_i.h"
#include "wpa_auth_ie.h"

Macros

#define STATE_MACHINE_DATA   struct wpa_state_machine
 
#define STATE_MACHINE_DEBUG_PREFIX   "WPA"
 
#define STATE_MACHINE_ADDR   sm->addr
 
#define RSN_SUITE   "%02x-%02x-%02x-%d"
 
#define RSN_SUITE_ARG(s)   ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
 

Functions

int wpa_auth_for_each_sta (struct wpa_authenticator *wpa_auth, int(*cb)(struct wpa_state_machine *sm, void *ctx), void *cb_ctx)
 
int wpa_auth_for_each_auth (struct wpa_authenticator *wpa_auth, int(*cb)(struct wpa_authenticator *a, void *ctx), void *cb_ctx)
 
void wpa_auth_logger (struct wpa_authenticator *wpa_auth, const u8 *addr, logger_level level, const char *txt)
 
void wpa_auth_vlogger (struct wpa_authenticator *wpa_auth, const u8 *addr, logger_level level, const char *fmt,...)
 
struct wpa_authenticatorwpa_init (const u8 *addr, struct wpa_auth_config *conf, struct wpa_auth_callbacks *cb)
 Initialize WPA authenticator. More...
 
int wpa_init_keys (struct wpa_authenticator *wpa_auth)
 
void wpa_deinit (struct wpa_authenticator *wpa_auth)
 Deinitialize WPA authenticator. More...
 
int wpa_reconfig (struct wpa_authenticator *wpa_auth, struct wpa_auth_config *conf)
 Update WPA authenticator configuration. More...
 
struct wpa_state_machinewpa_auth_sta_init (struct wpa_authenticator *wpa_auth, const u8 *addr, const u8 *p2p_dev_addr)
 
int wpa_auth_sta_associated (struct wpa_authenticator *wpa_auth, struct wpa_state_machine *sm)
 
void wpa_auth_sta_no_wpa (struct wpa_state_machine *sm)
 
void wpa_auth_sta_deinit (struct wpa_state_machine *sm)
 
void wpa_receive (struct wpa_authenticator *wpa_auth, struct wpa_state_machine *sm, u8 *data, size_t data_len)
 
void __wpa_send_eapol (struct wpa_authenticator *wpa_auth, struct wpa_state_machine *sm, int key_info, const u8 *key_rsc, const u8 *nonce, const u8 *kde, size_t kde_len, int keyidx, int encr, int force_version)
 
void wpa_remove_ptk (struct wpa_state_machine *sm)
 
int wpa_auth_sm_event (struct wpa_state_machine *sm, enum wpa_event event)
 
 SM_STATE (WPA_PTK, INITIALIZE)
 
 SM_STATE (WPA_PTK, DISCONNECT)
 
 SM_STATE (WPA_PTK, DISCONNECTED)
 
 SM_STATE (WPA_PTK, AUTHENTICATION)
 
 SM_STATE (WPA_PTK, AUTHENTICATION2)
 
 SM_STATE (WPA_PTK, INITPMK)
 
 SM_STATE (WPA_PTK, INITPSK)
 
 SM_STATE (WPA_PTK, PTKSTART)
 
 SM_STATE (WPA_PTK, PTKCALCNEGOTIATING)
 
 SM_STATE (WPA_PTK, PTKCALCNEGOTIATING2)
 
 SM_STATE (WPA_PTK, PTKINITNEGOTIATING)
 
 SM_STATE (WPA_PTK, PTKINITDONE)
 
 SM_STEP (WPA_PTK)
 
 SM_STATE (WPA_PTK_GROUP, IDLE)
 
 SM_STATE (WPA_PTK_GROUP, REKEYNEGOTIATING)
 
 SM_STATE (WPA_PTK_GROUP, REKEYESTABLISHED)
 
 SM_STATE (WPA_PTK_GROUP, KEYERROR)
 
 SM_STEP (WPA_PTK_GROUP)
 
void wpa_auth_sm_notify (struct wpa_state_machine *sm)
 
void wpa_gtk_rekey (struct wpa_authenticator *wpa_auth)
 
int wpa_get_mib (struct wpa_authenticator *wpa_auth, char *buf, size_t buflen)
 
int wpa_get_mib_sta (struct wpa_state_machine *sm, char *buf, size_t buflen)
 
void wpa_auth_countermeasures_start (struct wpa_authenticator *wpa_auth)
 
int wpa_auth_pairwise_set (struct wpa_state_machine *sm)
 
int wpa_auth_get_pairwise (struct wpa_state_machine *sm)
 
int wpa_auth_sta_key_mgmt (struct wpa_state_machine *sm)
 
int wpa_auth_sta_wpa_version (struct wpa_state_machine *sm)
 
int wpa_auth_sta_clear_pmksa (struct wpa_state_machine *sm, struct rsn_pmksa_cache_entry *entry)
 
struct rsn_pmksa_cache_entrywpa_auth_sta_get_pmksa (struct wpa_state_machine *sm)
 
void wpa_auth_sta_local_mic_failure_report (struct wpa_state_machine *sm)
 
const u8 * wpa_auth_get_wpa_ie (struct wpa_authenticator *wpa_auth, size_t *len)
 
int wpa_auth_pmksa_add (struct wpa_state_machine *sm, const u8 *pmk, int session_timeout, struct eapol_state_machine *eapol)
 
int wpa_auth_pmksa_add_preauth (struct wpa_authenticator *wpa_auth, const u8 *pmk, size_t len, const u8 *sta_addr, int session_timeout, struct eapol_state_machine *eapol)
 
int wpa_auth_pmksa_add_sae (struct wpa_authenticator *wpa_auth, const u8 *addr, const u8 *pmk)
 
void wpa_auth_pmksa_remove (struct wpa_authenticator *wpa_auth, const u8 *sta_addr)
 
int wpa_auth_sta_set_vlan (struct wpa_state_machine *sm, int vlan_id)
 
void wpa_auth_eapol_key_tx_status (struct wpa_authenticator *wpa_auth, struct wpa_state_machine *sm, int ack)
 
int wpa_auth_uses_sae (struct wpa_state_machine *sm)
 
int wpa_auth_uses_ft_sae (struct wpa_state_machine *sm)
 
int wpa_auth_get_ip_addr (struct wpa_state_machine *sm, u8 *addr)
 
int wpa_auth_radius_das_disconnect_pmksa (struct wpa_authenticator *wpa_auth, struct radius_das_attrs *attr)
 
void wpa_auth_reconfig_group_keys (struct wpa_authenticator *wpa_auth)
 

Detailed Description

IEEE 802.11 RSN / WPA Authenticator.

Function Documentation

void wpa_deinit ( struct wpa_authenticator wpa_auth)

Deinitialize WPA authenticator.

Parameters
wpa_authPointer to WPA authenticator data from wpa_init()
struct wpa_authenticator* wpa_init ( const u8 *  addr,
struct wpa_auth_config conf,
struct wpa_auth_callbacks cb 
)

Initialize WPA authenticator.

Parameters
addrAuthenticator address
confConfiguration for WPA authenticator
cbCallback functions for WPA authenticator
Returns
Pointer to WPA authenticator data or NULL on failure
int wpa_reconfig ( struct wpa_authenticator wpa_auth,
struct wpa_auth_config conf 
)

Update WPA authenticator configuration.

Parameters
wpa_authPointer to WPA authenticator data from wpa_init()
confConfiguration for WPA authenticator