wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Fields
eap_method Struct Reference

EAP method interface This structure defines the EAP method interface. Each method will need to register its own EAP type, EAP name, and set of function pointers for method specific operations. This interface is based on section 4.4 of RFC 4137. More...

#include <eap_i.h>

Data Fields

int vendor
 EAP Vendor-ID (EAP_VENDOR_*) (0 = IETF)
 
EapType method
 EAP type number (EAP_TYPE_*)
 
const char * name
 Name of the method (e.g., "TLS")
 
void *(* init )(struct eap_sm *sm)
 Initialize an EAP method. More...
 
void(* deinit )(struct eap_sm *sm, void *priv)
 Deinitialize an EAP method. More...
 
struct wpabuf *(* process )(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, const struct wpabuf *reqData)
 Process an EAP request. More...
 
Boolean(* isKeyAvailable )(struct eap_sm *sm, void *priv)
 Find out whether EAP method has keying material. More...
 
u8 *(* getKey )(struct eap_sm *sm, void *priv, size_t *len)
 Get EAP method specific keying material (eapKeyData) More...
 
int(* get_status )(struct eap_sm *sm, void *priv, char *buf, size_t buflen, int verbose)
 Get EAP method status. More...
 
Boolean(* has_reauth_data )(struct eap_sm *sm, void *priv)
 Whether method is ready for fast reauthentication. More...
 
void(* deinit_for_reauth )(struct eap_sm *sm, void *priv)
 Release data that is not needed for fast re-auth. More...
 
void *(* init_for_reauth )(struct eap_sm *sm, void *priv)
 Prepare for start of fast re-authentication. More...
 
const u8 *(* get_identity )(struct eap_sm *sm, void *priv, size_t *len)
 Get method specific identity for re-authentication. More...
 
void(* free )(struct eap_method *method)
 Free EAP method data. More...
 
int version
 Version of the EAP peer method interface. More...
 
struct eap_methodnext
 Pointer to the next EAP method. More...
 
u8 *(* get_emsk )(struct eap_sm *sm, void *priv, size_t *len)
 Get EAP method specific keying extended material (EMSK) More...
 
u8 *(* getSessionId )(struct eap_sm *sm, void *priv, size_t *len)
 Get EAP method specific Session-Id. More...
 
void *(* initPickUp )(struct eap_sm *sm)
 
void(* reset )(struct eap_sm *sm, void *priv)
 
struct wpabuf *(* buildReq )(struct eap_sm *sm, void *priv, u8 id)
 
int(* getTimeout )(struct eap_sm *sm, void *priv)
 
Boolean(* check )(struct eap_sm *sm, void *priv, struct wpabuf *respData)
 
void(* process )(struct eap_sm *sm, void *priv, struct wpabuf *respData)
 
Boolean(* isDone )(struct eap_sm *sm, void *priv)
 
Boolean(* isSuccess )(struct eap_sm *sm, void *priv)
 

Detailed Description

EAP method interface This structure defines the EAP method interface. Each method will need to register its own EAP type, EAP name, and set of function pointers for method specific operations. This interface is based on section 4.4 of RFC 4137.

EAP method interface This structure defines the EAP method interface. Each method will need to register its own EAP type, EAP name, and set of function pointers for method specific operations. This interface is based on section 5.4 of RFC 4137.

Field Documentation

void(* eap_method::deinit)(struct eap_sm *sm, void *priv)

Deinitialize an EAP method.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
       Deinitialize the EAP method and free any allocated private data.
void(* eap_method::deinit_for_reauth)(struct eap_sm *sm, void *priv)

Release data that is not needed for fast re-auth.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
       This function is an optional handler that only EAP methods
       supporting fast re-authentication need to implement. This is called
       when authentication has been completed and EAP state machine is
       requesting that enough state information is maintained for fast
       re-authentication
void(* eap_method::free)(struct eap_method *method)

Free EAP method data.

Parameters
methodPointer to the method data registered with eap_peer_method_register().

This function will be called when the EAP method is being unregistered. If the EAP method allocated resources during registration (e.g., allocated struct eap_method), they should be freed in this function. No other method functions will be called after this call. If this function is not defined (i.e., function pointer is NULL), a default handler is used to release the method data with free(method). This is suitable for most cases.

Parameters
methodPointer to the method data registered with eap_server_method_register().

This function will be called when the EAP method is being unregistered. If the EAP method allocated resources during registration (e.g., allocated struct eap_method), they should be freed in this function. No other method functions will be called after this call. If this function is not defined (i.e., function pointer is NULL), a default handler is used to release the method data with free(method). This is suitable for most cases.

u8 *(* eap_method::get_emsk)(struct eap_sm *sm, void *priv, size_t *len)

Get EAP method specific keying extended material (EMSK)

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
lenPointer to a variable to store EMSK length
Returns
EMSK or NULL if not available
       This function can be used to get the extended keying material from
       the EAP method. The key may already be stored in the method-specific
       private data or this function may derive the key.
Parameters
smPointer to EAP state machine allocated with eap_sm_init()
privPointer to private EAP method data from eap_method::init()
lenPointer to a variable to store EMSK length
Returns
EMSK or NULL if not available
       This function can be used to get the extended keying material from
       the EAP method. The key may already be stored in the method-specific
       private data or this function may derive the key.
const u8*(* eap_method::get_identity)(struct eap_sm *sm, void *priv, size_t *len)

Get method specific identity for re-authentication.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
lenLength of the returned identity
Returns
Pointer to the method specific identity or NULL if default identity is to be used

This function is an optional handler that only EAP methods that use method specific identity need to implement.

int(* eap_method::get_status)(struct eap_sm *sm, void *priv, char *buf, size_t buflen, int verbose)

Get EAP method status.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
bufBuffer for status information
buflenMaximum buffer length
verboseWhether to include verbose status information
Returns
Number of bytes written to buf
       Query EAP method for status information. This function fills in a
       text area with current status information from the EAP method. If
       the buffer (buf) is not large enough, status information will be
       truncated to fit the buffer.
u8 *(* eap_method::getKey)(struct eap_sm *sm, void *priv, size_t *len)

Get EAP method specific keying material (eapKeyData)

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
lenPointer to variable to store key length (eapKeyDataLen)
Returns
Keying material (eapKeyData) or NULL if not available
       This function can be used to get the keying material from the EAP
       method. The key may already be stored in the method-specific private
       data or this function may derive the key.
u8 *(* eap_method::getSessionId)(struct eap_sm *sm, void *priv, size_t *len)

Get EAP method specific Session-Id.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
lenPointer to a variable to store Session-Id length
Returns
Session-Id or NULL if not available
       This function can be used to get the Session-Id from the EAP method.
       The Session-Id may already be stored in the method-specific private
       data or this function may derive the Session-Id.
Parameters
smPointer to EAP state machine allocated with eap_server_sm_init()
privPointer to private EAP method data from eap_method::init()
lenPointer to a variable to store Session-Id length
Returns
Session-Id or NULL if not available
       This function can be used to get the Session-Id from the EAP method.
       The Session-Id may already be stored in the method-specific private
       data or this function may derive the Session-Id.
Boolean(* eap_method::has_reauth_data)(struct eap_sm *sm, void *priv)

Whether method is ready for fast reauthentication.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
Returns
TRUE or FALSE based on whether fast reauthentication is possible

This function is an optional handler that only EAP methods supporting fast re-authentication need to implement.

void *(* eap_method::init)(struct eap_sm *sm)

Initialize an EAP method.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
Returns
Pointer to allocated private data, or NULL on failure
       This function is used to initialize the EAP method explicitly
       instead of using METHOD_INIT state as specific in RFC 4137. The
       method is expected to initialize it method-specific state and return
       a pointer that will be used as the priv argument to other calls.
void*(* eap_method::init_for_reauth)(struct eap_sm *sm, void *priv)

Prepare for start of fast re-authentication.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
       This function is an optional handler that only EAP methods
       supporting fast re-authentication need to implement. This is called
       when EAP authentication is started and EAP state machine is
       requesting fast re-authentication to be used.
Boolean(* eap_method::isKeyAvailable)(struct eap_sm *sm, void *priv)

Find out whether EAP method has keying material.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
Returns
TRUE if key material (eapKeyData) is available
struct eap_method * eap_method::next

Pointer to the next EAP method.

This variable is used internally in the EAP method registration code to create a linked list of registered EAP methods.

struct wpabuf*(* eap_method::process)(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, const struct wpabuf *reqData)

Process an EAP request.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
privPointer to private EAP method data from eap_method::init()
retReturn values from EAP request validation and processing
reqDataEAP request to be processed (eapReqData)
Returns
Pointer to allocated EAP response packet (eapRespData)
       This function is a combination of m.check(), m.process(), and
       m.buildResp() procedures defined in section 4.4 of RFC 4137 In other
       words, this function validates the incoming request, processes it,
       and build a response packet. m.check() and m.process() return values
       are returned through struct eap_method_ret *ret variable. Caller is
       responsible for freeing the returned EAP response packet.
int eap_method::version

Version of the EAP peer method interface.

Version of the EAP server method interface.

The EAP peer method implementation should set this variable to EAP_PEER_METHOD_INTERFACE_VERSION. This is used to verify that the EAP method is using supported API version when using dynamically loadable EAP methods.

The EAP server method implementation should set this variable to EAP_SERVER_METHOD_INTERFACE_VERSION. This is used to verify that the EAP method is using supported API version when using dynamically loadable EAP methods.


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