9 #ifndef EAPOL_SUPP_SM_H 10 #define EAPOL_SUPP_SM_H 12 #include "common/defs.h" 14 typedef enum { Unauthorized, Authorized } PortStatus;
15 typedef enum { Auto, ForceUnauthorized, ForceAuthorized } PortControl;
31 #define EAPOL_REQUIRE_KEY_UNICAST BIT(0) 32 #define EAPOL_REQUIRE_KEY_BROADCAST BIT(1) 62 #define EAPOL_LOCAL_WPS_IN_USE BIT(0) 63 #define EAPOL_PEER_IS_WPS20_AP BIT(1) 73 enum eapol_supp_result {
74 EAPOL_SUPP_RESULT_FAILURE,
75 EAPOL_SUPP_RESULT_SUCCESS,
76 EAPOL_SUPP_RESULT_EXPECTED_FAILURE
107 void (*cb)(
struct eapol_sm *eapol,
enum eapol_supp_result result,
140 void (*eapol_done_cb)(
void *ctx);
150 int (*eapol_send)(
void *ctx,
int type,
const u8 *buf,
size_t len);
161 int (*set_wep_key)(
void *ctx,
int unicast,
int keyidx,
162 const u8 *key,
size_t keylen);
187 void (*aborted_cached)(
void *ctx);
236 void (*eap_param_needed)(
void *ctx,
enum wpa_ctrl_req_type field,
244 void (*port_cb)(
void *ctx,
int authorized);
256 void (*cert_cb)(
void *ctx,
int depth,
const char *subject,
257 const char *altsubject[],
int num_altsubject,
258 const char *cert_hash,
const struct wpabuf *cert);
271 void (*status_cb)(
void *ctx,
const char *status,
272 const char *parameter);
274 #ifdef CONFIG_EAP_PROXY 279 void (*eap_proxy_cb)(
void *ctx);
286 void (*eap_proxy_notify_sim_status)(
void *ctx,
287 enum eap_proxy_sim_state sim_state);
296 void (*set_anon_id)(
void *ctx,
const u8 *id,
size_t len);
303 #ifdef IEEE8021X_EAPOL 305 void eapol_sm_deinit(
struct eapol_sm *sm);
306 void eapol_sm_step(
struct eapol_sm *sm);
307 int eapol_sm_get_status(
struct eapol_sm *sm,
char *buf,
size_t buflen,
309 int eapol_sm_get_mib(
struct eapol_sm *sm,
char *buf,
size_t buflen);
310 void eapol_sm_configure(
struct eapol_sm *sm,
int heldPeriod,
int authPeriod,
311 int startPeriod,
int maxStart);
312 int eapol_sm_rx_eapol(
struct eapol_sm *sm,
const u8 *src,
const u8 *buf,
314 void eapol_sm_notify_tx_eapol_key(
struct eapol_sm *sm);
315 void eapol_sm_notify_portEnabled(
struct eapol_sm *sm, Boolean enabled);
316 void eapol_sm_notify_portValid(
struct eapol_sm *sm, Boolean valid);
317 void eapol_sm_notify_eap_success(
struct eapol_sm *sm, Boolean success);
318 void eapol_sm_notify_eap_fail(
struct eapol_sm *sm, Boolean fail);
319 void eapol_sm_notify_config(
struct eapol_sm *sm,
322 int eapol_sm_get_key(
struct eapol_sm *sm, u8 *key,
size_t len);
323 const u8 * eapol_sm_get_session_id(
struct eapol_sm *sm,
size_t *len);
324 void eapol_sm_notify_logoff(
struct eapol_sm *sm, Boolean logoff);
325 void eapol_sm_notify_cached(
struct eapol_sm *sm);
326 void eapol_sm_notify_pmkid_attempt(
struct eapol_sm *sm);
327 void eapol_sm_register_scard_ctx(
struct eapol_sm *sm,
void *ctx);
328 void eapol_sm_notify_portControl(
struct eapol_sm *sm, PortControl portControl);
329 void eapol_sm_notify_ctrl_attached(
struct eapol_sm *sm);
330 void eapol_sm_notify_ctrl_response(
struct eapol_sm *sm);
331 void eapol_sm_request_reauth(
struct eapol_sm *sm);
332 void eapol_sm_notify_lower_layer_success(
struct eapol_sm *sm,
int in_eapol_sm);
333 void eapol_sm_invalidate_cached_session(
struct eapol_sm *sm);
334 const char * eapol_sm_get_method_name(
struct eapol_sm *sm);
335 void eapol_sm_set_ext_pw_ctx(
struct eapol_sm *sm,
337 int eapol_sm_failed(
struct eapol_sm *sm);
338 void eapol_sm_erp_flush(
struct eapol_sm *sm);
339 struct wpabuf * eapol_sm_build_erp_reauth_start(
struct eapol_sm *sm);
340 void eapol_sm_process_erp_finish(
struct eapol_sm *sm,
const u8 *buf,
342 int eapol_sm_get_eap_proxy_imsi(
struct eapol_sm *sm,
char *imsi,
size_t *len);
349 static inline void eapol_sm_deinit(
struct eapol_sm *sm)
352 static inline void eapol_sm_step(
struct eapol_sm *sm)
355 static inline int eapol_sm_get_status(
struct eapol_sm *sm,
char *buf,
356 size_t buflen,
int verbose)
360 static inline int eapol_sm_get_mib(
struct eapol_sm *sm,
char *buf,
365 static inline void eapol_sm_configure(
struct eapol_sm *sm,
int heldPeriod,
366 int authPeriod,
int startPeriod,
370 static inline int eapol_sm_rx_eapol(
struct eapol_sm *sm,
const u8 *src,
371 const u8 *buf,
size_t len)
375 static inline void eapol_sm_notify_tx_eapol_key(
struct eapol_sm *sm)
378 static inline void eapol_sm_notify_portEnabled(
struct eapol_sm *sm,
382 static inline void eapol_sm_notify_portValid(
struct eapol_sm *sm,
386 static inline void eapol_sm_notify_eap_success(
struct eapol_sm *sm,
390 static inline void eapol_sm_notify_eap_fail(
struct eapol_sm *sm, Boolean fail)
393 static inline void eapol_sm_notify_config(
struct eapol_sm *sm,
398 static inline int eapol_sm_get_key(
struct eapol_sm *sm, u8 *key,
size_t len)
402 static inline const u8 *
403 eapol_sm_get_session_id(
struct eapol_sm *sm,
size_t *len)
407 static inline void eapol_sm_notify_logoff(
struct eapol_sm *sm, Boolean logoff)
410 static inline void eapol_sm_notify_cached(
struct eapol_sm *sm)
413 static inline void eapol_sm_notify_pmkid_attempt(
struct eapol_sm *sm)
416 #define eapol_sm_register_scard_ctx(sm, ctx) do { } while (0) 417 static inline void eapol_sm_notify_portControl(
struct eapol_sm *sm,
418 PortControl portControl)
421 static inline void eapol_sm_notify_ctrl_attached(
struct eapol_sm *sm)
424 static inline void eapol_sm_notify_ctrl_response(
struct eapol_sm *sm)
427 static inline void eapol_sm_request_reauth(
struct eapol_sm *sm)
430 static inline void eapol_sm_notify_lower_layer_success(
struct eapol_sm *sm,
434 static inline void eapol_sm_invalidate_cached_session(
struct eapol_sm *sm)
437 static inline const char * eapol_sm_get_method_name(
struct eapol_sm *sm)
441 static inline void eapol_sm_set_ext_pw_ctx(
struct eapol_sm *sm,
445 static inline int eapol_sm_failed(
struct eapol_sm *sm)
449 static inline void eapol_sm_erp_flush(
struct eapol_sm *sm)
452 static inline struct wpabuf *
453 eapol_sm_build_erp_reauth_start(
struct eapol_sm *sm)
457 static inline void eapol_sm_process_erp_finish(
struct eapol_sm *sm,
458 const u8 *buf,
size_t len)
const char * pkcs11_engine_path
pkcs11_engine_path - Path to the OpenSSL engine for PKCS#11
Definition: eapol_supp_sm.h:203
int external_sim
external_sim - Use external processing for SIM/USIM operations
Definition: eapol_supp_sm.h:60
void * cb_ctx
cb_ctx - Callback context for cb()
Definition: eapol_supp_sm.h:113
const char * openssl_ciphers
openssl_ciphers - OpenSSL cipher string
Definition: eapol_supp_sm.h:221
void * eapol_send_ctx
eapol_send_ctx - Callback context for eapol_send() calls
Definition: eapol_supp_sm.h:130
unsigned int workaround
workaround - Whether EAP workarounds are enabled
Definition: eapol_supp_sm.h:50
const char * pkcs11_module_path
pkcs11_module_path - Path to the OpenSSL OpenSC/PKCS#11 module
Definition: eapol_supp_sm.h:212
int accept_802_1x_keys
accept_802_1x_keys - Accept IEEE 802.1X (non-WPA) EAPOL-Key frames
Definition: eapol_supp_sm.h:29
int preauth
preauth - IEEE 802.11i/RSN pre-authentication
Definition: eapol_supp_sm.h:94
int cert_in_cb
cert_in_cb - Include server certificates in callback
Definition: eapol_supp_sm.h:263
int fast_reauth
fast_reauth - Whether fast EAP reauthentication is enabled
Definition: eapol_supp_sm.h:45
struct wpa_config_blob - Named configuration blob
Definition: eap_config.h:766
struct eapol_config - Per network configuration for EAPOL state machines
Definition: eapol_supp_sm.h:20
Definition: ext_password.c:26
int eap_disabled
eap_disabled - Whether EAP is disabled
Definition: eapol_supp_sm.h:55
struct wps_context * wps
wps - WPS context data
Definition: eapol_supp_sm.h:228
void * msg_ctx
msg_ctx - Callback context for wpa_msg() calls
Definition: eapol_supp_sm.h:118
struct eapol_ctx - Global (for all networks) EAPOL state machine context
Definition: eapol_supp_sm.h:82
struct eapol_sm - Internal data for EAPOL state machines
Definition: eapol_supp_sm.c:31
void * ctx
ctx - Pointer to arbitrary upper level context
Definition: eapol_supp_sm.h:86
struct eap_peer_config - EAP peer configuration/credentials
Definition: eap_config.h:15
char * name
name - Blob name
Definition: eap_config.h:770
const char * opensc_engine_path
opensc_engine_path - Path to the OpenSSL engine for opensc
Definition: eapol_supp_sm.h:195
int wps
wps - Whether this connection is used for WPS
Definition: eapol_supp_sm.h:67
void * scard_ctx
scard_ctx - Callback context for PC/SC scard_*() function calls
Definition: eapol_supp_sm.h:125
struct wps_context - Long term WPS context data
Definition: wps.h:594
int required_keys
required_keys - Which EAPOL-Key packets are required
Definition: eapol_supp_sm.h:40