5 #ifndef EAPOL_SUPP_SM_H
6 #define EAPOL_SUPP_SM_H
10 typedef enum { Unauthorized, Authorized } PortStatus;
11 typedef enum { Auto, ForceUnauthorized, ForceAuthorized } PortControl;
29 #define EAPOL_REQUIRE_KEY_UNICAST BIT(0)
30 #define EAPOL_REQUIRE_KEY_BROADCAST BIT(1)
65 #define EAPOL_LOCAL_WPS_IN_USE BIT(0)
66 #define EAPOL_PEER_IS_WPS20_AP BIT(1)
77 enum eapol_supp_result {
78 EAPOL_SUPP_RESULT_FAILURE,
79 EAPOL_SUPP_RESULT_SUCCESS,
80 EAPOL_SUPP_RESULT_EXPECTED_FAILURE
114 void (*
cb)(
struct eapol_sm *eapol,
enum eapol_supp_result result,
173 const u8 *key,
size_t keylen);
273 const char *altsubject[],
int num_altsubject,
274 const char *cert_hash,
const struct wpabuf *cert);
289 const char *parameter);
291 #ifdef CONFIG_EAP_PROXY
296 void (*eap_proxy_cb)(
void *
ctx);
312 #ifdef IEEE8021X_EAPOL
320 int startPeriod,
int maxStart);
344 void eapol_sm_set_ext_pw_ctx(
struct eapol_sm *sm,
346 int eapol_sm_failed(
struct eapol_sm *sm);
347 void eapol_sm_erp_flush(
struct eapol_sm *sm);
348 int eapol_sm_get_eap_proxy_imsi(
struct eapol_sm *sm,
char *imsi,
size_t *len);
362 size_t buflen,
int verbose)
372 int authPeriod,
int startPeriod,
377 const u8 *buf,
size_t len)
408 static inline const u8 *
422 #define eapol_sm_register_scard_ctx(sm, ctx) do { } while (0)
424 PortControl portControl)
447 static inline void eapol_sm_set_ext_pw_ctx(
struct eapol_sm *sm,
451 static inline int eapol_sm_failed(
struct eapol_sm *sm)
455 static inline void eapol_sm_erp_flush(
struct eapol_sm *sm)
const char * pkcs11_engine_path
Path to the OpenSSL engine for PKCS#11.
Definition: eapol_supp_sm.h:216
void(* set_anon_id)(void *ctx, const u8 *id, size_t len)
Set or add anonymous identity.
Definition: eapol_supp_sm.h:305
const u8 * eapol_sm_get_session_id(struct eapol_sm *sm, size_t *len)
Get EAP Session-Id.
Definition: eapol_supp_sm.c:1594
int external_sim
Use external processing for SIM/USIM operations.
Definition: eapol_supp_sm.h:63
void eapol_sm_notify_eap_fail(struct eapol_sm *sm, Boolean fail)
Notification of external EAP failure trigger.
Definition: eapol_supp_sm.c:1470
void eapol_sm_notify_ctrl_response(struct eapol_sm *sm)
Notification of received user input.
Definition: eapol_supp_sm.c:1734
void * cb_ctx
Callback context for cb()
Definition: eapol_supp_sm.h:121
void eapol_sm_notify_tx_eapol_key(struct eapol_sm *sm)
Notification about transmitted EAPOL packet.
Definition: eapol_supp_sm.c:1392
const char * openssl_ciphers
OpenSSL cipher string.
Definition: eapol_supp_sm.h:236
void * eapol_send_ctx
Callback context for eapol_send() calls.
Definition: eapol_supp_sm.h:141
void eapol_sm_step(struct eapol_sm *sm)
EAPOL state machine step function.
Definition: eapol_supp_sm.c:928
void(* cb)(struct eapol_sm *eapol, enum eapol_supp_result result, void *ctx)
Function to be called when EAPOL negotiation has been completed.
Definition: eapol_supp_sm.h:114
void(* cert_cb)(void *ctx, int depth, const char *subject, const char *altsubject[], int num_altsubject, const char *cert_hash, const struct wpabuf *cert)
Notification of a peer certificate.
Definition: eapol_supp_sm.h:272
void(* status_cb)(void *ctx, const char *status, const char *parameter)
Notification of a change in EAP status.
Definition: eapol_supp_sm.h:288
void(* eapol_done_cb)(void *ctx)
Function to be called at successful completion.
Definition: eapol_supp_sm.h:151
unsigned int workaround
Whether EAP workarounds are enabled.
Definition: eapol_supp_sm.h:51
void(* port_cb)(void *ctx, int authorized)
Set port authorized/unauthorized callback (optional)
Definition: eapol_supp_sm.h:260
const char * pkcs11_module_path
Path to the OpenSSL OpenSC/PKCS#11 module.
Definition: eapol_supp_sm.h:226
void(* eap_param_needed)(void *ctx, enum wpa_ctrl_req_type field, const char *txt)
Notify that EAP parameter is needed.
Definition: eapol_supp_sm.h:252
void eapol_sm_notify_lower_layer_success(struct eapol_sm *sm, int in_eapol_sm)
Notification of lower layer success.
Definition: eapol_supp_sm.c:1774
WPA Supplicant - Common definitions.
void eapol_sm_notify_cached(struct eapol_sm *sm)
Notification of successful PMKSA caching.
Definition: eapol_supp_sm.c:1631
void eapol_sm_notify_portEnabled(struct eapol_sm *sm, Boolean enabled)
Notification about portEnabled change.
Definition: eapol_supp_sm.c:1406
void eapol_sm_notify_config(struct eapol_sm *sm, struct eap_peer_config *config, const struct eapol_config *conf)
Notification of EAPOL configuration change.
Definition: eapol_supp_sm.c:1494
int accept_802_1x_keys
Accept IEEE 802.1X (non-WPA) EAPOL-Key frames.
Definition: eapol_supp_sm.h:27
void eapol_sm_deinit(struct eapol_sm *sm)
Deinitialize EAPOL state machine.
Definition: eapol_supp_sm.c:2098
void eapol_sm_register_scard_ctx(struct eapol_sm *sm, void *ctx)
Notification of smart card context.
Definition: eapol_supp_sm.c:1685
int preauth
IEEE 802.11i/RSN pre-authentication.
Definition: eapol_supp_sm.h:101
int cert_in_cb
Include server certificates in callback.
Definition: eapol_supp_sm.h:280
int fast_reauth
Whether fast EAP reauthentication is enabled.
Definition: eapol_supp_sm.h:45
void eapol_sm_request_reauth(struct eapol_sm *sm)
Request reauthentication.
Definition: eapol_supp_sm.c:1756
void eapol_sm_notify_portValid(struct eapol_sm *sm, Boolean valid)
Notification about portValid change.
Definition: eapol_supp_sm.c:1426
Named configuration blob.
Definition: eap_config.h:812
struct eapol_sm * eapol_sm_init(struct eapol_ctx *ctx)
Initialize EAPOL state machine.
Definition: eapol_supp_sm.c:2037
Per network configuration for EAPOL state machines.
Definition: eapol_supp_sm.h:17
Definition: ext_password.c:26
void eapol_sm_notify_ctrl_attached(struct eapol_sm *sm)
Notification of attached monitor.
Definition: eapol_supp_sm.c:1719
int eap_disabled
Whether EAP is disabled.
Definition: eapol_supp_sm.h:57
int(* eapol_send)(void *ctx, int type, const u8 *buf, size_t len)
Send EAPOL packets.
Definition: eapol_supp_sm.h:161
void eapol_sm_notify_logoff(struct eapol_sm *sm, Boolean logoff)
Notification of logon/logoff commands.
Definition: eapol_supp_sm.c:1611
wpa_ctrl_req_type
Control interface request types.
Definition: defs.h:315
void eapol_sm_notify_portControl(struct eapol_sm *sm, PortControl portControl)
Notification of portControl changes.
Definition: eapol_supp_sm.c:1701
void eapol_sm_notify_pmkid_attempt(struct eapol_sm *sm)
Notification of PMKSA caching.
Definition: eapol_supp_sm.c:1648
struct wps_context * wps
WPS context data.
Definition: eapol_supp_sm.h:244
int eapol_sm_get_status(struct eapol_sm *sm, char *buf, size_t buflen, int verbose)
Get EAPOL state machine status.
Definition: eapol_supp_sm.c:1107
void * msg_ctx
Callback context for wpa_msg() calls.
Definition: eapol_supp_sm.h:127
int eapol_sm_get_key(struct eapol_sm *sm, u8 *key, size_t len)
Get master session key (MSK) from EAP.
Definition: eapol_supp_sm.c:1540
Global (for all networks) EAPOL state machine context.
Definition: eapol_supp_sm.h:87
Internal data for EAPOL state machines.
Definition: eapol_supp_sm.c:28
void * ctx
Pointer to arbitrary upper level context.
Definition: eapol_supp_sm.h:92
void eapol_sm_configure(struct eapol_sm *sm, int heldPeriod, int authPeriod, int startPeriod, int maxStart)
Set EAPOL variables.
Definition: eapol_supp_sm.c:1062
void eapol_sm_notify_eap_success(struct eapol_sm *sm, Boolean success)
Notification of external EAP success trigger.
Definition: eapol_supp_sm.c:1448
int(* set_wep_key)(void *ctx, int unicast, int keyidx, const u8 *key, size_t keylen)
Configure WEP keys.
Definition: eapol_supp_sm.h:172
int eapol_sm_rx_eapol(struct eapol_sm *sm, const u8 *src, const u8 *buf, size_t len)
Process received EAPOL frames.
Definition: eapol_supp_sm.c:1236
void eapol_sm_invalidate_cached_session(struct eapol_sm *sm)
Mark cached EAP session data invalid.
Definition: eapol_supp_sm.c:1788
const char * eapol_sm_get_method_name(struct eapol_sm *sm)
Get EAPOL method name.
Definition: eapol_supp_sm.c:1083
EAP peer configuration/credentials.
Definition: eap_config.h:12
void(* aborted_cached)(void *ctx)
Notify that cached PMK attempt was aborted.
Definition: eapol_supp_sm.h:198
char * name
Blob name.
Definition: eap_config.h:817
const char * opensc_engine_path
Path to the OpenSSL engine for opensc.
Definition: eapol_supp_sm.h:207
void(* set_config_blob)(void *ctx, struct wpa_config_blob *blob)
Set or add a named configuration blob.
Definition: eapol_supp_sm.h:183
int wps
Whether this connection is used for WPS.
Definition: eapol_supp_sm.h:71
void * scard_ctx
Callback context for PC/SC scard_*() function calls.
Definition: eapol_supp_sm.h:135
Long term WPS context data.
Definition: wps.h:623
int eapol_sm_get_mib(struct eapol_sm *sm, char *buf, size_t buflen)
Get EAPOL state machine MIBs.
Definition: eapol_supp_sm.c:1166
int required_keys
Which EAPOL-Key packets are required.
Definition: eapol_supp_sm.h:39