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

EAP peer state machines internal structures (RFC 4137) More...

#include "wpabuf.h"
#include "utils/list.h"
#include "eap_peer/eap.h"
#include "eap_common/eap_common.h"

Go to the source code of this file.

Data Structures

struct  eap_method_ret
 EAP return values from struct eap_method::process() More...
 
struct  eap_method
 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...
 
struct  eap_erp_key
 
struct  eap_sm
 EAP state machine data. More...
 

Macros

#define EAP_PEER_METHOD_INTERFACE_VERSION   1
 

Enumerations

enum  EapDecision { DECISION_FAIL, DECISION_COND_SUCC, DECISION_UNCOND_SUCC }
 
enum  EapMethodState {
  METHOD_NONE, METHOD_INIT, METHOD_CONT, METHOD_MAY_CONT,
  METHOD_DONE
}
 

Functions

const u8 * eap_get_config_identity (struct eap_sm *sm, size_t *len)
 Get identity from the network configuration. More...
 
const u8 * eap_get_config_password (struct eap_sm *sm, size_t *len)
 Get password from the network configuration. More...
 
const u8 * eap_get_config_password2 (struct eap_sm *sm, size_t *len, int *hash)
 Get password from the network configuration. More...
 
const u8 * eap_get_config_new_password (struct eap_sm *sm, size_t *len)
 Get new password from network configuration. More...
 
const u8 * eap_get_config_otp (struct eap_sm *sm, size_t *len)
 Get one-time password from the network configuration. More...
 
void eap_clear_config_otp (struct eap_sm *sm)
 Clear used one-time password. More...
 
const char * eap_get_config_phase1 (struct eap_sm *sm)
 Get phase1 data from the network configuration. More...
 
const char * eap_get_config_phase2 (struct eap_sm *sm)
 Get phase2 data from the network configuration. More...
 
int eap_get_config_fragment_size (struct eap_sm *sm)
 
struct eap_peer_configeap_get_config (struct eap_sm *sm)
 Get current network configuration. More...
 
void eap_set_config_blob (struct eap_sm *sm, struct wpa_config_blob *blob)
 Set or add a named configuration blob. More...
 
const struct wpa_config_blobeap_get_config_blob (struct eap_sm *sm, const char *name)
 Get a named configuration blob. More...
 
void eap_notify_pending (struct eap_sm *sm)
 Notify that EAP method is ready to re-process a request. More...
 
int eap_allowed_method (struct eap_sm *sm, int vendor, u32 method)
 Check whether EAP method is allowed. More...
 

Detailed Description

EAP peer state machines internal structures (RFC 4137)

Function Documentation

int eap_allowed_method ( struct eap_sm sm,
int  vendor,
u32  method 
)

Check whether EAP method is allowed.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
vendorVendor-Id for expanded types or 0 = IETF for legacy types
methodEAP type
Returns
1 = allowed EAP method, 0 = not allowed
void eap_clear_config_otp ( struct eap_sm sm)

Clear used one-time password.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()

This function clears a used one-time password (OTP) from the current network configuration. This should be called when the OTP has been used and is not needed anymore.

struct eap_peer_config* eap_get_config ( struct eap_sm sm)

Get current network configuration.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
Returns
Pointer to the current network configuration or NULL if not found

EAP peer methods should avoid using this function if they can use other access functions, like eap_get_config_identity() and eap_get_config_password(), that do not require direct access to struct eap_peer_config.

const struct wpa_config_blob* eap_get_config_blob ( struct eap_sm sm,
const char *  name 
)

Get a named configuration blob.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
nameName of the blob
Returns
Pointer to blob data or NULL if not found
const u8* eap_get_config_identity ( struct eap_sm sm,
size_t *  len 
)

Get identity from the network configuration.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
lenBuffer for the length of the identity
Returns
Pointer to the identity or NULL if not found
const u8* eap_get_config_new_password ( struct eap_sm sm,
size_t *  len 
)

Get new password from network configuration.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
lenBuffer for the length of the new password
Returns
Pointer to the new password or NULL if not found
const u8* eap_get_config_otp ( struct eap_sm sm,
size_t *  len 
)

Get one-time password from the network configuration.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
lenBuffer for the length of the one-time password
Returns
Pointer to the one-time password or NULL if not found
const u8* eap_get_config_password ( struct eap_sm sm,
size_t *  len 
)

Get password from the network configuration.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
lenBuffer for the length of the password
Returns
Pointer to the password or NULL if not found
const u8* eap_get_config_password2 ( struct eap_sm sm,
size_t *  len,
int *  hash 
)

Get password from the network configuration.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
lenBuffer for the length of the password
hashBuffer for returning whether the password is stored as a NtPasswordHash instead of plaintext password; can be NULL if this information is not needed
Returns
Pointer to the password or NULL if not found
const char* eap_get_config_phase1 ( struct eap_sm sm)

Get phase1 data from the network configuration.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
Returns
Pointer to the phase1 data or NULL if not found
const char* eap_get_config_phase2 ( struct eap_sm sm)

Get phase2 data from the network configuration.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
Returns
Pointer to the phase1 data or NULL if not found
void eap_notify_pending ( struct eap_sm sm)

Notify that EAP method is ready to re-process a request.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()

An EAP method can perform a pending operation (e.g., to get a response from an external process). Once the response is available, this function can be used to request EAPOL state machine to retry delivering the previously received (and still unanswered) EAP request to EAP state machine.

void eap_set_config_blob ( struct eap_sm sm,
struct wpa_config_blob blob 
)

Set or add a named configuration blob.

Parameters
smPointer to EAP state machine allocated with eap_peer_sm_init()
blobNew value for the blob

Adds a new configuration blob or replaces the current value of an existing blob.