2 * hostapd / EAP Full Authenticator state machine (RFC 4137)
3 * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
12 #include "common/defs.h"
13 #include "eap_common/eap_defs.h"
14 #include "eap_server/eap_methods.h"
19 #define EAP_TTLS_AUTH_PAP 1
20 #define EAP_TTLS_AUTH_CHAP 2
21 #define EAP_TTLS_AUTH_MSCHAP 4
22 #define EAP_TTLS_AUTH_MSCHAPV2 8
28 } methods[EAP_MAX_METHODS];
31 int password_hash; /* whether password is hashed with
32 * nt_password_hash() */
35 int ttls_auth; /* bitfield of
36 * EAP_TTLS_AUTH_{PAP,CHAP,MSCHAP,MSCHAPV2} */
39 struct eap_eapol_interface {
40 /* Lower layer to full authenticator variables */
41 Boolean eapResp; /* shared with EAPOL Backend Authentication */
42 struct wpabuf *eapRespData;
45 Boolean eapRestart; /* shared with EAPOL Authenticator PAE */
49 /* Full authenticator to lower layer variables */
50 Boolean eapReq; /* shared with EAPOL Backend Authentication */
51 Boolean eapNoReq; /* shared with EAPOL Backend Authentication */
55 struct wpabuf *eapReqData;
58 Boolean eapKeyAvailable; /* called keyAvailable in IEEE 802.1X-2004 */
60 /* AAA interface to full authenticator variables */
65 struct wpabuf *aaaEapReqData;
67 size_t aaaEapKeyDataLen;
68 Boolean aaaEapKeyAvailable;
71 /* Full authenticator to AAA interface variables */
73 struct wpabuf *aaaEapRespData;
74 /* aaaIdentity -> eap_get_identity() */
78 struct eapol_callbacks {
79 int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
80 int phase2, struct eap_user *user);
81 const char * (*get_eap_req_id_text)(void *ctx, size_t *len);
87 void *eap_sim_db_priv;
91 u8 *pac_opaque_encr_key;
93 size_t eap_fast_a_id_len;
94 char *eap_fast_a_id_info;
97 int pac_key_refresh_time;
98 int eap_sim_aka_result_ind;
100 struct wps_context *wps;
101 const struct wpabuf *assoc_wps_ie;
102 const struct wpabuf *assoc_p2p_ie;
110 struct eap_sm * eap_server_sm_init(void *eapol_ctx,
111 struct eapol_callbacks *eapol_cb,
112 struct eap_config *eap_conf);
113 void eap_server_sm_deinit(struct eap_sm *sm);
114 int eap_server_sm_step(struct eap_sm *sm);
115 void eap_sm_notify_cached(struct eap_sm *sm);
116 void eap_sm_pending_cb(struct eap_sm *sm);
117 int eap_sm_method_pending(struct eap_sm *sm);
118 const u8 * eap_get_identity(struct eap_sm *sm, size_t *len);
119 struct eap_eapol_interface * eap_get_interface(struct eap_sm *sm);
120 void eap_server_clear_identity(struct eap_sm *sm);