|
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_server/eap_methods.h" 00016 #include "wpabuf.h" 00017 00018 struct eap_sm; 00019 00020 #define EAP_TTLS_AUTH_PAP 1 00021 #define EAP_TTLS_AUTH_CHAP 2 00022 #define EAP_TTLS_AUTH_MSCHAP 4 00023 #define EAP_TTLS_AUTH_MSCHAPV2 8 00024 00025 struct eap_user { 00026 struct { 00027 int vendor; 00028 u32 method; 00029 } methods[EAP_MAX_METHODS]; 00030 u8 *password; 00031 size_t password_len; 00032 int password_hash; /* whether password is hashed with 00033 * nt_password_hash() */ 00034 int phase2; 00035 int force_version; 00036 int ttls_auth; /* bitfield of 00037 * EAP_TTLS_AUTH_{PAP,CHAP,MSCHAP,MSCHAPV2} */ 00038 }; 00039 00040 struct eap_eapol_interface { 00041 /* Lower layer to full authenticator variables */ 00042 Boolean eapResp; /* shared with EAPOL Backend Authentication */ 00043 struct wpabuf *eapRespData; 00044 Boolean portEnabled; 00045 int retransWhile; 00046 Boolean eapRestart; /* shared with EAPOL Authenticator PAE */ 00047 int eapSRTT; 00048 int eapRTTVAR; 00049 00050 /* Full authenticator to lower layer variables */ 00051 Boolean eapReq; /* shared with EAPOL Backend Authentication */ 00052 Boolean eapNoReq; /* shared with EAPOL Backend Authentication */ 00053 Boolean eapSuccess; 00054 Boolean eapFail; 00055 Boolean eapTimeout; 00056 struct wpabuf *eapReqData; 00057 u8 *eapKeyData; 00058 size_t eapKeyDataLen; 00059 Boolean eapKeyAvailable; /* called keyAvailable in IEEE 802.1X-2004 */ 00060 00061 /* AAA interface to full authenticator variables */ 00062 Boolean aaaEapReq; 00063 Boolean aaaEapNoReq; 00064 Boolean aaaSuccess; 00065 Boolean aaaFail; 00066 struct wpabuf *aaaEapReqData; 00067 u8 *aaaEapKeyData; 00068 size_t aaaEapKeyDataLen; 00069 Boolean aaaEapKeyAvailable; 00070 int aaaMethodTimeout; 00071 00072 /* Full authenticator to AAA interface variables */ 00073 Boolean aaaEapResp; 00074 struct wpabuf *aaaEapRespData; 00075 /* aaaIdentity -> eap_get_identity() */ 00076 Boolean aaaTimeout; 00077 }; 00078 00079 struct eapol_callbacks { 00080 int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len, 00081 int phase2, struct eap_user *user); 00082 const char * (*get_eap_req_id_text)(void *ctx, size_t *len); 00083 }; 00084 00085 struct eap_config { 00086 void *ssl_ctx; 00087 void *msg_ctx; 00088 void *eap_sim_db_priv; 00089 Boolean backend_auth; 00090 int eap_server; 00091 u16 pwd_group; 00092 u8 *pac_opaque_encr_key; 00093 u8 *eap_fast_a_id; 00094 size_t eap_fast_a_id_len; 00095 char *eap_fast_a_id_info; 00096 int eap_fast_prov; 00097 int pac_key_lifetime; 00098 int pac_key_refresh_time; 00099 int eap_sim_aka_result_ind; 00100 int tnc; 00101 struct wps_context *wps; 00102 const struct wpabuf *assoc_wps_ie; 00103 const struct wpabuf *assoc_p2p_ie; 00104 const u8 *peer_addr; 00105 int fragment_size; 00106 00107 int pbc_in_m1; 00108 }; 00109 00110 00111 struct eap_sm * eap_server_sm_init(void *eapol_ctx, 00112 struct eapol_callbacks *eapol_cb, 00113 struct eap_config *eap_conf); 00114 void eap_server_sm_deinit(struct eap_sm *sm); 00115 int eap_server_sm_step(struct eap_sm *sm); 00116 void eap_sm_notify_cached(struct eap_sm *sm); 00117 void eap_sm_pending_cb(struct eap_sm *sm); 00118 int eap_sm_method_pending(struct eap_sm *sm); 00119 const u8 * eap_get_identity(struct eap_sm *sm, size_t *len); 00120 struct eap_eapol_interface * eap_get_interface(struct eap_sm *sm); 00121 void eap_server_clear_identity(struct eap_sm *sm); 00122 00123 #endif /* EAP_H */ 00124
1.7.3