|
wpa_supplicant / hostapd 2.0
|
00001 00010 #ifndef EAP_H 00011 #define EAP_H 00012 00013 #include "common/defs.h" 00014 #include "eap_common/eap_defs.h" 00015 #include "eap_peer/eap_methods.h" 00016 00017 struct eap_sm; 00018 struct wpa_config_blob; 00019 struct wpabuf; 00020 00021 struct eap_method_type { 00022 int vendor; 00023 u32 method; 00024 }; 00025 00026 #ifdef IEEE8021X_EAPOL 00027 00036 enum eapol_bool_var { 00043 EAPOL_eapSuccess, 00044 00051 EAPOL_eapRestart, 00052 00059 EAPOL_eapFail, 00060 00067 EAPOL_eapResp, 00068 00075 EAPOL_eapNoResp, 00076 00083 EAPOL_eapReq, 00084 00091 EAPOL_portEnabled, 00092 00099 EAPOL_altAccept, 00100 00107 EAPOL_altReject 00108 }; 00109 00118 enum eapol_int_var { 00129 EAPOL_idleWhile 00130 }; 00131 00142 struct eapol_callbacks { 00148 struct eap_peer_config * (*get_config)(void *ctx); 00149 00156 Boolean (*get_bool)(void *ctx, enum eapol_bool_var variable); 00157 00165 void (*set_bool)(void *ctx, enum eapol_bool_var variable, 00166 Boolean value); 00167 00175 unsigned int (*get_int)(void *ctx, enum eapol_int_var variable); 00176 00184 void (*set_int)(void *ctx, enum eapol_int_var variable, 00185 unsigned int value); 00186 00195 struct wpabuf * (*get_eapReqData)(void *ctx); 00196 00206 void (*set_config_blob)(void *ctx, struct wpa_config_blob *blob); 00207 00215 const struct wpa_config_blob * (*get_config_blob)(void *ctx, 00216 const char *name); 00217 00229 void (*notify_pending)(void *ctx); 00230 00238 void (*eap_param_needed)(void *ctx, enum wpa_ctrl_req_type field, 00239 const char *txt); 00240 00250 void (*notify_cert)(void *ctx, int depth, const char *subject, 00251 const char *cert_hash, const struct wpabuf *cert); 00252 }; 00253 00258 struct eap_config { 00265 const char *opensc_engine_path; 00272 const char *pkcs11_engine_path; 00279 const char *pkcs11_module_path; 00286 struct wps_context *wps; 00287 00292 int cert_in_cb; 00293 }; 00294 00295 struct eap_sm * eap_peer_sm_init(void *eapol_ctx, 00296 struct eapol_callbacks *eapol_cb, 00297 void *msg_ctx, struct eap_config *conf); 00298 void eap_peer_sm_deinit(struct eap_sm *sm); 00299 int eap_peer_sm_step(struct eap_sm *sm); 00300 void eap_sm_abort(struct eap_sm *sm); 00301 int eap_sm_get_status(struct eap_sm *sm, char *buf, size_t buflen, 00302 int verbose); 00303 const char * eap_sm_get_method_name(struct eap_sm *sm); 00304 struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted); 00305 void eap_sm_request_identity(struct eap_sm *sm); 00306 void eap_sm_request_password(struct eap_sm *sm); 00307 void eap_sm_request_new_password(struct eap_sm *sm); 00308 void eap_sm_request_pin(struct eap_sm *sm); 00309 void eap_sm_request_otp(struct eap_sm *sm, const char *msg, size_t msg_len); 00310 void eap_sm_request_passphrase(struct eap_sm *sm); 00311 void eap_sm_notify_ctrl_attached(struct eap_sm *sm); 00312 u32 eap_get_phase2_type(const char *name, int *vendor); 00313 struct eap_method_type * eap_get_phase2_types(struct eap_peer_config *config, 00314 size_t *count); 00315 void eap_set_fast_reauth(struct eap_sm *sm, int enabled); 00316 void eap_set_workaround(struct eap_sm *sm, unsigned int workaround); 00317 void eap_set_force_disabled(struct eap_sm *sm, int disabled); 00318 int eap_key_available(struct eap_sm *sm); 00319 void eap_notify_success(struct eap_sm *sm); 00320 void eap_notify_lower_layer_success(struct eap_sm *sm); 00321 const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len); 00322 struct wpabuf * eap_get_eapRespData(struct eap_sm *sm); 00323 void eap_register_scard_ctx(struct eap_sm *sm, void *ctx); 00324 void eap_invalidate_cached_session(struct eap_sm *sm); 00325 00326 int eap_is_wps_pbc_enrollee(struct eap_peer_config *conf); 00327 int eap_is_wps_pin_enrollee(struct eap_peer_config *conf); 00328 00329 #endif /* IEEE8021X_EAPOL */ 00330 00331 #endif /* EAP_H */ 00332
1.7.3