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

RSN pre-authentication (supplicant) More...

#include "includes.h"
#include "common.h"
#include "wpa.h"
#include "eloop.h"
#include "l2_packet/l2_packet.h"
#include "eapol_supp/eapol_supp_sm.h"
#include "preauth.h"
#include "pmksa_cache.h"
#include "wpa_i.h"

Data Structures

struct  rsn_pmksa_candidate
 

Macros

#define PMKID_CANDIDATE_PRIO_SCAN   1000
 

Functions

void pmksa_candidate_free (struct wpa_sm *sm)
 Free all entries in PMKSA candidate list. More...
 
int rsn_preauth_init (struct wpa_sm *sm, const u8 *dst, struct eap_peer_config *eap_conf)
 Start new RSN pre-authentication. More...
 
void rsn_preauth_deinit (struct wpa_sm *sm)
 Abort RSN pre-authentication. More...
 
void rsn_preauth_candidate_process (struct wpa_sm *sm)
 Process PMKSA candidates. More...
 
void pmksa_candidate_add (struct wpa_sm *sm, const u8 *bssid, int prio, int preauth)
 Add a new PMKSA candidate. More...
 
int rsn_preauth_scan_results (struct wpa_sm *sm)
 Start processing scan results for canditates. More...
 
void rsn_preauth_scan_result (struct wpa_sm *sm, const u8 *bssid, const u8 *ssid, const u8 *rsn)
 Processing scan result for PMKSA canditates. More...
 
int rsn_preauth_get_status (struct wpa_sm *sm, char *buf, size_t buflen, int verbose)
 Get pre-authentication status. More...
 
int rsn_preauth_in_progress (struct wpa_sm *sm)
 Verify whether pre-authentication is in progress. More...
 

Detailed Description

RSN pre-authentication (supplicant)

Function Documentation

void pmksa_candidate_add ( struct wpa_sm sm,
const u8 *  bssid,
int  prio,
int  preauth 
)

Add a new PMKSA candidate.

Parameters
smPointer to WPA state machine data from wpa_sm_init()
bssidBSSID (authenticator address) of the candidate
prioPriority (the smaller number, the higher priority)
preauthWhether the candidate AP advertises support for pre-authentication

This function is used to add PMKSA candidates for RSN pre-authentication. It is called from scan result processing and from driver events for PMKSA candidates, i.e., EVENT_PMKID_CANDIDATE events to wpa_supplicant_event().

void pmksa_candidate_free ( struct wpa_sm sm)

Free all entries in PMKSA candidate list.

Parameters
smPointer to WPA state machine data from wpa_sm_init()
void rsn_preauth_candidate_process ( struct wpa_sm sm)

Process PMKSA candidates.

Parameters
smPointer to WPA state machine data from wpa_sm_init()

Go through the PMKSA candidates and start pre-authentication if a candidate without an existing PMKSA cache entry is found. Processed candidates will be removed from the list.

void rsn_preauth_deinit ( struct wpa_sm sm)

Abort RSN pre-authentication.

Parameters
smPointer to WPA state machine data from wpa_sm_init()

This function aborts the current RSN pre-authentication (if one is started) and frees resources allocated for it.

int rsn_preauth_get_status ( struct wpa_sm sm,
char *  buf,
size_t  buflen,
int  verbose 
)

Get pre-authentication status.

Parameters
smPointer to WPA state machine data from wpa_sm_init()
bufBuffer for status information
buflenMaximum buffer length
verboseWhether to include verbose status information
Returns
Number of bytes written to buf.

Query WPA2 pre-authentication for status information. This function fills in a text area with current status information. If the buffer (buf) is not large enough, status information will be truncated to fit the buffer.

int rsn_preauth_in_progress ( struct wpa_sm sm)

Verify whether pre-authentication is in progress.

Parameters
smPointer to WPA state machine data from wpa_sm_init()
int rsn_preauth_init ( struct wpa_sm sm,
const u8 *  dst,
struct eap_peer_config eap_conf 
)

Start new RSN pre-authentication.

Parameters
smPointer to WPA state machine data from wpa_sm_init()
dstAuthenticator address (BSSID) with which to preauthenticate
eap_confCurrent EAP configuration
Returns
0 on success, -1 on another pre-authentication is in progress, -2 on layer 2 packet initialization failure, -3 on EAPOL state machine initialization failure, -4 on memory allocation failure

This function request an RSN pre-authentication with a given destination address. This is usually called for PMKSA candidates found from scan results or from driver reports. In addition, ctrl_iface PREAUTH command can trigger pre-authentication.

void rsn_preauth_scan_result ( struct wpa_sm sm,
const u8 *  bssid,
const u8 *  ssid,
const u8 *  rsn 
)

Processing scan result for PMKSA canditates.

Parameters
smPointer to WPA state machine data from wpa_sm_init()

Add all suitable APs (Authenticators) from scan results into PMKSA candidate list.

int rsn_preauth_scan_results ( struct wpa_sm sm)

Start processing scan results for canditates.

Parameters
smPointer to WPA state machine data from wpa_sm_init()
Returns
0 if ready to process results or -1 to skip processing

This functions is used to notify RSN code about start of new scan results processing. The actual scan results will be provided by calling rsn_preauth_scan_result() for each BSS if this function returned 0.