eap.h

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

Generated on Sat Nov 21 23:16:51 2009 for hostapd by  doxygen 1.6.1