wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
eap.h
Go to the documentation of this file.
1 
5 #ifndef EAP_H
6 #define EAP_H
7 
8 #include "common/defs.h"
9 #include "eap_common/eap_defs.h"
10 #include "eap_peer/eap_methods.h"
11 
12 struct eap_sm;
13 struct wpa_config_blob;
14 struct wpabuf;
15 
17  int vendor;
18  u32 method;
19 };
20 
21 #ifdef IEEE8021X_EAPOL
22 
40 
48 
56 
64 
72 
80 
88 
96 
104 
112 };
113 
135 };
136 
152  struct eap_peer_config * (*get_config)(void *ctx);
153 
159  Boolean (*get_bool)(void *ctx, enum eapol_bool_var variable);
160 
167  void (*set_bool)(void *ctx, enum eapol_bool_var variable,
168  Boolean value);
169 
176  unsigned int (*get_int)(void *ctx, enum eapol_int_var variable);
177 
184  void (*set_int)(void *ctx, enum eapol_int_var variable,
185  unsigned int value);
186 
194  struct wpabuf * (*get_eapReqData)(void *ctx);
195 
204  void (*set_config_blob)(void *ctx, struct wpa_config_blob *blob);
205 
212  const struct wpa_config_blob * (*get_config_blob)(void *ctx,
213  const char *name);
214 
225  void (*notify_pending)(void *ctx);
226 
233  void (*eap_param_needed)(void *ctx, enum wpa_ctrl_req_type field,
234  const char *txt);
235 
246  void (*notify_cert)(void *ctx, int depth, const char *subject,
247  const char *altsubject[], int num_altsubject,
248  const char *cert_hash, const struct wpabuf *cert);
249 
256  void (*notify_status)(void *ctx, const char *status,
257  const char *parameter);
258 
259 #ifdef CONFIG_EAP_PROXY
260 
264  void (*eap_proxy_cb)(void *ctx);
265 #endif /* CONFIG_EAP_PROXY */
266 
273  void (*set_anon_id)(void *ctx, const u8 *id, size_t len);
274 };
275 
280 struct eap_config {
287  const char *opensc_engine_path;
294  const char *pkcs11_engine_path;
301  const char *pkcs11_module_path;
310  const char *openssl_ciphers;
317  struct wps_context *wps;
318 
324 };
325 
326 struct eap_sm * eap_peer_sm_init(void *eapol_ctx,
327  const struct eapol_callbacks *eapol_cb,
328  void *msg_ctx, struct eap_config *conf);
329 void eap_peer_sm_deinit(struct eap_sm *sm);
330 int eap_peer_sm_step(struct eap_sm *sm);
331 void eap_sm_abort(struct eap_sm *sm);
332 int eap_sm_get_status(struct eap_sm *sm, char *buf, size_t buflen,
333  int verbose);
334 const char * eap_sm_get_method_name(struct eap_sm *sm);
335 struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted);
336 void eap_sm_request_identity(struct eap_sm *sm);
337 void eap_sm_request_password(struct eap_sm *sm);
338 void eap_sm_request_new_password(struct eap_sm *sm);
339 void eap_sm_request_pin(struct eap_sm *sm);
340 void eap_sm_request_otp(struct eap_sm *sm, const char *msg, size_t msg_len);
341 void eap_sm_request_passphrase(struct eap_sm *sm);
342 void eap_sm_request_sim(struct eap_sm *sm, const char *req);
343 void eap_sm_notify_ctrl_attached(struct eap_sm *sm);
344 u32 eap_get_phase2_type(const char *name, int *vendor);
346  size_t *count);
347 void eap_set_fast_reauth(struct eap_sm *sm, int enabled);
348 void eap_set_workaround(struct eap_sm *sm, unsigned int workaround);
349 void eap_set_force_disabled(struct eap_sm *sm, int disabled);
350 void eap_set_external_sim(struct eap_sm *sm, int external_sim);
351 int eap_key_available(struct eap_sm *sm);
352 void eap_notify_success(struct eap_sm *sm);
353 void eap_notify_lower_layer_success(struct eap_sm *sm);
354 const u8 * eap_get_eapSessionId(struct eap_sm *sm, size_t *len);
355 const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len);
356 struct wpabuf * eap_get_eapRespData(struct eap_sm *sm);
357 void eap_register_scard_ctx(struct eap_sm *sm, void *ctx);
358 void eap_invalidate_cached_session(struct eap_sm *sm);
359 
360 int eap_is_wps_pbc_enrollee(struct eap_peer_config *conf);
361 int eap_is_wps_pin_enrollee(struct eap_peer_config *conf);
362 
363 struct ext_password_data;
364 void eap_sm_set_ext_pw_ctx(struct eap_sm *sm, struct ext_password_data *ext);
365 void eap_set_anon_id(struct eap_sm *sm, const u8 *id, size_t len);
366 int eap_peer_was_failure_expected(struct eap_sm *sm);
367 void eap_peer_erp_free_keys(struct eap_sm *sm);
368 
369 #endif /* IEEE8021X_EAPOL */
370 
371 #endif /* EAP_H */
void eap_peer_sm_deinit(struct eap_sm *sm)
Deinitialize and free an EAP peer state machine.
Definition: eap.c:1963
EAP request available from lower layer.
Definition: eap.h:79
const char * pkcs11_module_path
OpenSC PKCS#11 module for OpenSSL engine.
Definition: eap.h:301
void(* set_anon_id)(void *ctx, const u8 *id, size_t len)
Set or add anonymous identity.
Definition: eap.h:273
void(* notify_status)(void *ctx, const char *status, const char *parameter)
Notification of the current EAP state.
Definition: eap.h:256
void(* set_config_blob)(void *ctx, struct wpa_config_blob *blob)
Set named configuration blob.
Definition: eap.h:204
void(* notify_pending)(void *ctx)
Notify that a pending request can be retried.
Definition: eap.h:225
void eap_sm_request_sim(struct eap_sm *sm, const char *req)
Request external SIM processing.
Definition: eap.c:2338
Alternate indication of success (RFC3748)
Definition: eap.h:95
void eap_sm_request_otp(struct eap_sm *sm, const char *msg, size_t msg_len)
Request one time password from user (ctrl_iface)
Definition: eap.c:2312
Request has been process; no response to send.
Definition: eap.h:71
Lower layer is ready for communication.
Definition: eap.h:87
void eap_sm_request_pin(struct eap_sm *sm)
Request SIM or smart card PIN from user (ctrl_iface)
Definition: eap.c:2296
void eap_sm_request_new_password(struct eap_sm *sm)
Request new password from user (ctrl_iface)
Definition: eap.c:2281
int eap_sm_get_status(struct eap_sm *sm, char *buf, size_t buflen, int verbose)
Get EAP state machine status.
Definition: eap.c:2111
WPA Supplicant - Common definitions.
Boolean(* get_bool)(void *ctx, enum eapol_bool_var variable)
Get a boolean EAPOL state variable.
Definition: eap.h:159
EAP SUCCESS state reached.
Definition: eap.h:39
eapol_bool_var
EAPOL boolean state variables for EAP state machine.
Definition: eap.h:32
void eap_sm_request_passphrase(struct eap_sm *sm)
Request passphrase from user (ctrl_iface)
Definition: eap.c:2327
u32 eap_get_phase2_type(const char *name, int *vendor)
Get EAP type for the given EAP phase 2 method name.
Definition: eap.c:2396
void(* eap_param_needed)(void *ctx, enum wpa_ctrl_req_type field, const char *txt)
Notify that EAP parameter is needed.
Definition: eap.h:233
Definition: wpabuf.h:16
void(* notify_cert)(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: eap.h:246
eapol_int_var
EAPOL integer state variables for EAP state machine.
Definition: eap.h:123
void eap_set_anon_id(struct eap_sm *sm, const u8 *id, size_t len)
Set or add anonymous identity.
Definition: eap.c:2936
Outside time for EAP peer timeout.
Definition: eap.h:134
Lower layer request to restart authentication.
Definition: eap.h:47
const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len)
Get master session key (MSK) from EAP state machine.
Definition: eap.c:2761
void eap_invalidate_cached_session(struct eap_sm *sm)
Mark cached session data invalid.
Definition: eap.c:2889
EAP peer: Method registration.
void eap_set_workaround(struct eap_sm *sm, unsigned int workaround)
Update EAP workarounds setting.
Definition: eap.c:2469
Definition: eap.h:16
void(* set_int)(void *ctx, enum eapol_int_var variable, unsigned int value)
Set an integer EAPOL state variable.
Definition: eap.h:184
int cert_in_cb
Include server certificates in callback.
Definition: eap.h:323
void eap_set_force_disabled(struct eap_sm *sm, int disabled)
Set force_disabled flag.
Definition: eap.c:2853
void eap_register_scard_ctx(struct eap_sm *sm, void *ctx)
Notification of smart card context.
Definition: eap.c:2805
Named configuration blob.
Definition: eap_config.h:812
Definition: ext_password.c:26
EAP server/peer: Shared EAP definitions.
Callback functions from EAP to lower layer.
Definition: eap.h:147
const char * pkcs11_engine_path
PKCS#11 engine for OpenSSL engine support.
Definition: eap.h:294
void eap_sm_request_password(struct eap_sm *sm)
Request password from user (ctrl_iface)
Definition: eap.c:2266
void eap_set_fast_reauth(struct eap_sm *sm, int enabled)
Update fast_reauth setting.
Definition: eap.c:2458
Alternate indication of failure (RFC3748)
Definition: eap.h:103
void eap_sm_abort(struct eap_sm *sm)
Abort EAP authentication.
Definition: eap.c:2006
EAP-based trigger to send EAPOL-Start.
Definition: eap.h:111
wpa_ctrl_req_type
Control interface request types.
Definition: defs.h:315
void eap_sm_notify_ctrl_attached(struct eap_sm *sm)
Notification of attached monitor.
Definition: eap.c:2351
int eap_key_available(struct eap_sm *sm)
Get key availability (eapKeyAvailable variable)
Definition: eap.c:2677
void eap_notify_success(struct eap_sm *sm)
Notify EAP state machine about external success trigger.
Definition: eap.c:2692
struct eap_method_type * eap_get_phase2_types(struct eap_peer_config *config, size_t *count)
Get list of allowed EAP phase 2 types.
Definition: eap.c:2418
const char * openssl_ciphers
OpenSSL cipher string.
Definition: eap.h:310
unsigned int(* get_int)(void *ctx, enum eapol_int_var variable)
Get an integer EAPOL state variable.
Definition: eap.h:176
Global (for all networks) EAPOL state machine context.
Definition: eapol_supp_sm.h:87
void eap_sm_request_identity(struct eap_sm *sm)
Request identity from user (ctrl_iface)
Definition: eap.c:2251
struct eap_sm * eap_peer_sm_init(void *eapol_ctx, const struct eapol_callbacks *eapol_cb, void *msg_ctx, struct eap_config *conf)
Allocate and initialize EAP peer state machine.
Definition: eap.c:1909
struct wpabuf * eap_get_eapRespData(struct eap_sm *sm)
Get EAP response data.
Definition: eap.c:2783
Configuration for EAP state machine.
Definition: eap.h:280
const char * opensc_engine_path
OpenSC engine for OpenSSL engine support.
Definition: eap.h:287
EAP state machine data.
Definition: eap_i.h:302
void(* set_bool)(void *ctx, enum eapol_bool_var variable, Boolean value)
Set a boolean EAPOL state variable.
Definition: eap.h:167
void eap_notify_lower_layer_success(struct eap_sm *sm)
Notification of lower layer success.
Definition: eap.c:2708
EAP peer configuration/credentials.
Definition: eap_config.h:12
char * name
Blob name.
Definition: eap_config.h:817
struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted)
Build EAP-Identity/Response for the current network.
Definition: eap.c:1422
const u8 * eap_get_eapSessionId(struct eap_sm *sm, size_t *len)
Get Session-Id from EAP state machine.
Definition: eap.c:2738
Response to send.
Definition: eap.h:63
struct wps_context * wps
WPS context data.
Definition: eap.h:317
int eap_peer_sm_step(struct eap_sm *sm)
Step EAP peer state machine.
Definition: eap.c:1986
Long term WPS context data.
Definition: wps.h:623
void eap_set_external_sim(struct eap_sm *sm, int external_sim)
Set external_sim flag.
Definition: eap.c:2864
EAP FAILURE state reached.
Definition: eap.h:55