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 unsigned int remediation:1;
36 int ttls_auth; /* bitfield of
37 * EAP_TTLS_AUTH_{PAP,CHAP,MSCHAP,MSCHAPV2} */
38 struct hostapd_radius_attr *accept_attr;
41 struct eap_eapol_interface {
42 /* Lower layer to full authenticator variables */
43 Boolean eapResp; /* shared with EAPOL Backend Authentication */
44 struct wpabuf *eapRespData;
47 Boolean eapRestart; /* shared with EAPOL Authenticator PAE */
51 /* Full authenticator to lower layer variables */
52 Boolean eapReq; /* shared with EAPOL Backend Authentication */
53 Boolean eapNoReq; /* shared with EAPOL Backend Authentication */
57 struct wpabuf *eapReqData;
60 Boolean eapKeyAvailable; /* called keyAvailable in IEEE 802.1X-2004 */
62 /* AAA interface to full authenticator variables */
67 struct wpabuf *aaaEapReqData;
69 size_t aaaEapKeyDataLen;
70 Boolean aaaEapKeyAvailable;
73 /* Full authenticator to AAA interface variables */
75 struct wpabuf *aaaEapRespData;
76 /* aaaIdentity -> eap_get_identity() */
80 struct eapol_callbacks {
81 int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
82 int phase2, struct eap_user *user);
83 const char * (*get_eap_req_id_text)(void *ctx, size_t *len);
84 void (*log_msg)(void *ctx, const char *msg);
90 void *eap_sim_db_priv;
94 u8 *pac_opaque_encr_key;
96 size_t eap_fast_a_id_len;
97 char *eap_fast_a_id_info;
100 int pac_key_refresh_time;
101 int eap_sim_aka_result_ind;
103 struct wps_context *wps;
104 const struct wpabuf *assoc_wps_ie;
105 const struct wpabuf *assoc_p2p_ie;
112 size_t server_id_len;
114 #ifdef CONFIG_TESTING_OPTIONS
116 #endif /* CONFIG_TESTING_OPTIONS */
120 struct eap_sm * eap_server_sm_init(void *eapol_ctx,
121 struct eapol_callbacks *eapol_cb,
122 struct eap_config *eap_conf);
123 void eap_server_sm_deinit(struct eap_sm *sm);
124 int eap_server_sm_step(struct eap_sm *sm);
125 void eap_sm_notify_cached(struct eap_sm *sm);
126 void eap_sm_pending_cb(struct eap_sm *sm);
127 int eap_sm_method_pending(struct eap_sm *sm);
128 const u8 * eap_get_identity(struct eap_sm *sm, size_t *len);
129 struct eap_eapol_interface * eap_get_interface(struct eap_sm *sm);
130 void eap_server_clear_identity(struct eap_sm *sm);