#include "includes.h"
#include "common.h"
#include "eap_i.h"
#include "config_ssid.h"
#include "tls.h"
#include "crypto.h"
#include "pcsc_funcs.h"
#include "wpa_ctrl.h"
#include "state_machine.h"
Include dependency graph for eap.c:
Go to the source code of this file.
Defines | |
#define | STATE_MACHINE_DATA struct eap_sm |
#define | STATE_MACHINE_DEBUG_PREFIX "EAP" |
#define | EAP_MAX_AUTH_ROUNDS 50 |
Enumerations | |
enum | eap_ctrl_req_type { TYPE_IDENTITY, TYPE_PASSWORD, TYPE_OTP, TYPE_PIN, TYPE_NEW_PASSWORD, TYPE_PASSPHRASE } |
Functions | |
SM_STATE (EAP, INITIALIZE) | |
SM_STATE (EAP, DISABLED) | |
SM_STATE (EAP, IDLE) | |
SM_STATE (EAP, RECEIVED) | |
SM_STATE (EAP, GET_METHOD) | |
SM_STATE (EAP, METHOD) | |
SM_STATE (EAP, SEND_RESPONSE) | |
SM_STATE (EAP, DISCARD) | |
SM_STATE (EAP, IDENTITY) | |
SM_STATE (EAP, NOTIFICATION) | |
SM_STATE (EAP, RETRANSMIT) | |
SM_STATE (EAP, SUCCESS) | |
SM_STATE (EAP, FAILURE) | |
SM_STEP (EAP) | |
u8 * | eap_sm_buildIdentity (struct eap_sm *sm, int id, size_t *len, int encrypted) |
Build EAP-Identity/Response for the current network. | |
eap_sm * | eap_sm_init (void *eapol_ctx, struct eapol_callbacks *eapol_cb, void *msg_ctx, struct eap_config *conf) |
Allocate and initialize EAP state machine. | |
void | eap_sm_deinit (struct eap_sm *sm) |
Deinitialize and free an EAP state machine. | |
int | eap_sm_step (struct eap_sm *sm) |
Step EAP state machine. | |
void | eap_sm_abort (struct eap_sm *sm) |
Abort EAP authentication. | |
int | eap_sm_get_status (struct eap_sm *sm, char *buf, size_t buflen, int verbose) |
Get EAP state machine status. | |
void | eap_sm_request_identity (struct eap_sm *sm) |
Request identity from user (ctrl_iface). | |
void | eap_sm_request_password (struct eap_sm *sm) |
Request password from user (ctrl_iface). | |
void | eap_sm_request_new_password (struct eap_sm *sm) |
Request new password from user (ctrl_iface). | |
void | eap_sm_request_pin (struct eap_sm *sm) |
Request SIM or smart card PIN from user (ctrl_iface). | |
void | eap_sm_request_otp (struct eap_sm *sm, const char *msg, size_t msg_len) |
Request one time password from user (ctrl_iface). | |
void | eap_sm_request_passphrase (struct eap_sm *sm) |
Request passphrase from user (ctrl_iface). | |
void | eap_sm_notify_ctrl_attached (struct eap_sm *sm) |
Notification of attached monitor. | |
u32 | eap_get_phase2_type (const char *name, int *vendor) |
Get EAP type for the given EAP phase 2 method name. | |
eap_method_type * | eap_get_phase2_types (struct wpa_ssid *config, size_t *count) |
Get list of allowed EAP phase 2 types. | |
void | eap_set_fast_reauth (struct eap_sm *sm, int enabled) |
Update fast_reauth setting. | |
void | eap_set_workaround (struct eap_sm *sm, unsigned int workaround) |
Update EAP workarounds setting. | |
wpa_ssid * | eap_get_config (struct eap_sm *sm) |
Get current network configuration. | |
const u8 * | eap_get_config_identity (struct eap_sm *sm, size_t *len) |
Get identity from the network configuration. | |
const u8 * | eap_get_config_password (struct eap_sm *sm, size_t *len) |
Get password from the network configuration. | |
const u8 * | eap_get_config_new_password (struct eap_sm *sm, size_t *len) |
Get new password from network configuration. | |
const u8 * | eap_get_config_otp (struct eap_sm *sm, size_t *len) |
Get one-time password from the network configuration. | |
void | eap_clear_config_otp (struct eap_sm *sm) |
Clear used one-time password. | |
int | eap_key_available (struct eap_sm *sm) |
Get key availability (eapKeyAvailable variable). | |
void | eap_notify_success (struct eap_sm *sm) |
Notify EAP state machine about external success trigger. | |
void | eap_notify_lower_layer_success (struct eap_sm *sm) |
Notification of lower layer success. | |
const u8 * | eap_get_eapKeyData (struct eap_sm *sm, size_t *len) |
Get master session key (MSK) from EAP state machine. | |
u8 * | eap_get_eapRespData (struct eap_sm *sm, size_t *len) |
Get EAP response data. | |
void | eap_register_scard_ctx (struct eap_sm *sm, void *ctx) |
Notification of smart card context. | |
const u8 * | eap_hdr_validate (int vendor, EapType eap_type, const u8 *msg, size_t msglen, size_t *plen) |
Validate EAP header. | |
void | eap_set_config_blob (struct eap_sm *sm, struct wpa_config_blob *blob) |
Set or add a named configuration blob. | |
const struct wpa_config_blob * | eap_get_config_blob (struct eap_sm *sm, const char *name) |
Get a named configuration blob. | |
void | eap_set_force_disabled (struct eap_sm *sm, int disabled) |
Set force_disabled flag. | |
eap_hdr * | eap_msg_alloc (int vendor, EapType type, size_t *len, size_t payload_len, u8 code, u8 identifier, u8 **payload) |
Allocate a buffer for an EAP message. | |
void | eap_notify_pending (struct eap_sm *sm) |
Notify that EAP method is ready to re-process a request. | |
void | eap_invalidate_cached_session (struct eap_sm *sm) |
Mark cached session data invalid. |
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
This file implements the Peer State Machine as defined in RFC 4137. The used states and state transitions match mostly with the RFC. However, there are couple of additional transitions for working around small issues noticed during testing. These exceptions are explained in comments within the functions in this file. The method functions, m.func(), are similar to the ones used in RFC 4137, but some small changes have used here to optimize operations and to add functionality needed for fast re-authentication (session resumption).
Definition in file eap.c.
|
Clear used one-time password.
Definition at line 1824 of file eap.c. Here is the call graph for this function: |
|
Get current network configuration.
|
|
Get a named configuration blob.
|
|
Get identity from the network configuration.
Definition at line 1754 of file eap.c. Here is the call graph for this function: |
|
Get new password from network configuration.
Definition at line 1788 of file eap.c. Here is the call graph for this function: |
|
Get one-time password from the network configuration.
Definition at line 1805 of file eap.c. Here is the call graph for this function: |
|
Get password from the network configuration.
Definition at line 1771 of file eap.c. Here is the call graph for this function: |
|
Get master session key (MSK) from EAP state machine.
|
|
Get EAP response data.
|
|
Get EAP type for the given EAP phase 2 method name.
Definition at line 1648 of file eap.c. Here is the call graph for this function: |
|
Get list of allowed EAP phase 2 types.
Definition at line 1671 of file eap.c. Here is the call graph for this function: |
|
Validate EAP header.
Definition at line 1983 of file eap.c. Here is the call graph for this function: |
|
Mark cached session data invalid.
|
|
Get key availability (eapKeyAvailable variable).
|
|
Allocate a buffer for an EAP message.
|
|
Notification of lower layer success.
|
|
Notify that EAP method is ready to re-process a request.
|
|
Notify EAP state machine about external success trigger.
|
|
Notification of smart card context.
|
|
Set or add a named configuration blob.
|
|
Update fast_reauth setting.
|
|
Set force_disabled flag.
|
|
Update EAP workarounds setting.
|
|
Abort EAP authentication.
|
|
Build EAP-Identity/Response for the current network.
Definition at line 932 of file eap.c. Here is the call graph for this function: |
|
Deinitialize and free an EAP state machine.
Definition at line 1193 of file eap.c. Here is the call graph for this function: |
|
Get EAP state machine status.
Definition at line 1340 of file eap.c. Here is the call graph for this function: |
|
Allocate and initialize EAP state machine.
Definition at line 1155 of file eap.c. Here is the call graph for this function: |
|
Notification of attached monitor.
Definition at line 1602 of file eap.c. Here is the call graph for this function: |
|
Request identity from user (ctrl_iface).
|
|
Request new password from user (ctrl_iface).
|
|
Request one time password from user (ctrl_iface).
|
|
Request passphrase from user (ctrl_iface).
|
|
Request password from user (ctrl_iface).
|
|
Request SIM or smart card PIN from user (ctrl_iface).
|
|
Step EAP state machine.
|