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

hostapd / EAP Full Authenticator state machine (RFC 4137) More...

#include "common/defs.h"
#include "utils/list.h"
#include "eap_common/eap_defs.h"
#include "eap_server/eap_methods.h"
#include "wpabuf.h"

Go to the source code of this file.

Data Structures

struct  eap_user
 
struct  eap_eapol_interface
 
struct  eap_server_erp_key
 
struct  eapol_callbacks
 Callback functions from EAP to lower layer. More...
 
struct  eap_config
 Configuration for EAP state machine. More...
 

Macros

#define EAP_TTLS_AUTH_PAP   1
 
#define EAP_TTLS_AUTH_CHAP   2
 
#define EAP_TTLS_AUTH_MSCHAP   4
 
#define EAP_TTLS_AUTH_MSCHAPV2   8
 

Functions

struct eap_smeap_server_sm_init (void *eapol_ctx, const struct eapol_callbacks *eapol_cb, struct eap_config *eap_conf)
 Allocate and initialize EAP server state machine. More...
 
void eap_server_sm_deinit (struct eap_sm *sm)
 Deinitialize and free an EAP server state machine. More...
 
int eap_server_sm_step (struct eap_sm *sm)
 Step EAP server state machine. More...
 
void eap_sm_notify_cached (struct eap_sm *sm)
 Notify EAP state machine of cached PMK. More...
 
void eap_sm_pending_cb (struct eap_sm *sm)
 EAP state machine callback for a pending EAP request. More...
 
int eap_sm_method_pending (struct eap_sm *sm)
 Query whether EAP method is waiting for pending data. More...
 
const u8 * eap_get_identity (struct eap_sm *sm, size_t *len)
 Get the user identity (from EAP-Response/Identity) More...
 
struct eap_eapol_interfaceeap_get_interface (struct eap_sm *sm)
 Get pointer to EAP-EAPOL interface data. More...
 
void eap_server_clear_identity (struct eap_sm *sm)
 Clear EAP identity information. More...
 
void eap_server_mschap_rx_callback (struct eap_sm *sm, const char *source, const u8 *username, size_t username_len, const u8 *challenge, const u8 *response)
 

Detailed Description

hostapd / EAP Full Authenticator state machine (RFC 4137)

Function Documentation

const u8* eap_get_identity ( struct eap_sm sm,
size_t *  len 
)

Get the user identity (from EAP-Response/Identity)

Parameters
smPointer to EAP state machine allocated with eap_server_sm_init()
lenBuffer for returning identity length
Returns
Pointer to the user identity or NULL if not available
struct eap_eapol_interface* eap_get_interface ( struct eap_sm sm)

Get pointer to EAP-EAPOL interface data.

Parameters
smPointer to EAP state machine allocated with eap_server_sm_init()
Returns
Pointer to the EAP-EAPOL interface data
void eap_server_clear_identity ( struct eap_sm sm)

Clear EAP identity information.

Parameters
smPointer to EAP state machine allocated with eap_server_sm_init()

This function can be used to clear the EAP identity information in the EAP server context. This allows the EAP/Identity method to be used again after EAPOL-Start or EAPOL-Logoff.

void eap_server_sm_deinit ( struct eap_sm sm)

Deinitialize and free an EAP server state machine.

Parameters
smPointer to EAP state machine allocated with eap_server_sm_init()

This function deinitializes EAP state machine and frees all allocated resources.

struct eap_sm* eap_server_sm_init ( void *  eapol_ctx,
const struct eapol_callbacks eapol_cb,
struct eap_config conf 
)

Allocate and initialize EAP server state machine.

Parameters
eapol_ctxContext data to be used with eapol_cb calls
eapol_cbPointer to EAPOL callback functions
confEAP configuration
Returns
Pointer to the allocated EAP state machine or NULL on failure

This function allocates and initializes an EAP state machine.

int eap_server_sm_step ( struct eap_sm sm)

Step EAP server state machine.

Parameters
smPointer to EAP state machine allocated with eap_server_sm_init()
Returns
1 if EAP state was changed or 0 if not

This function advances EAP state machine to a new state to match with the current variables. This should be called whenever variables used by the EAP state machine have changed.

int eap_sm_method_pending ( struct eap_sm sm)

Query whether EAP method is waiting for pending data.

Parameters
smPointer to EAP state machine allocated with eap_server_sm_init()
Returns
1 if method is waiting for pending data or 0 if not
void eap_sm_notify_cached ( struct eap_sm sm)

Notify EAP state machine of cached PMK.

Parameters
smPointer to EAP state machine allocated with eap_server_sm_init()

This function is called when PMKSA caching is used to skip EAP authentication.

void eap_sm_pending_cb ( struct eap_sm sm)

EAP state machine callback for a pending EAP request.

Parameters
smPointer to EAP state machine allocated with eap_server_sm_init()

This function is called when data for a pending EAP-Request is received.