2 * hostapd / EAP Full Authenticator state machine (RFC 4137)
3 * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
18 #include "common/defs.h"
19 #include "eap_common/eap_defs.h"
20 #include "eap_server/eap_methods.h"
25 #define EAP_TTLS_AUTH_PAP 1
26 #define EAP_TTLS_AUTH_CHAP 2
27 #define EAP_TTLS_AUTH_MSCHAP 4
28 #define EAP_TTLS_AUTH_MSCHAPV2 8
34 } methods[EAP_MAX_METHODS];
37 int password_hash; /* whether password is hashed with
38 * nt_password_hash() */
41 int ttls_auth; /* bitfield of
42 * EAP_TTLS_AUTH_{PAP,CHAP,MSCHAP,MSCHAPV2} */
45 struct eap_eapol_interface {
46 /* Lower layer to full authenticator variables */
47 Boolean eapResp; /* shared with EAPOL Backend Authentication */
48 struct wpabuf *eapRespData;
51 Boolean eapRestart; /* shared with EAPOL Authenticator PAE */
55 /* Full authenticator to lower layer variables */
56 Boolean eapReq; /* shared with EAPOL Backend Authentication */
57 Boolean eapNoReq; /* shared with EAPOL Backend Authentication */
61 struct wpabuf *eapReqData;
64 Boolean eapKeyAvailable; /* called keyAvailable in IEEE 802.1X-2004 */
66 /* AAA interface to full authenticator variables */
71 struct wpabuf *aaaEapReqData;
73 size_t aaaEapKeyDataLen;
74 Boolean aaaEapKeyAvailable;
77 /* Full authenticator to AAA interface variables */
79 struct wpabuf *aaaEapRespData;
80 /* aaaIdentity -> eap_get_identity() */
84 struct eapol_callbacks {
85 int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
86 int phase2, struct eap_user *user);
87 const char * (*get_eap_req_id_text)(void *ctx, size_t *len);
93 void *eap_sim_db_priv;
97 u8 *pac_opaque_encr_key;
99 size_t eap_fast_a_id_len;
100 char *eap_fast_a_id_info;
102 int pac_key_lifetime;
103 int pac_key_refresh_time;
104 int eap_sim_aka_result_ind;
106 struct wps_context *wps;
107 const struct wpabuf *assoc_wps_ie;
108 const struct wpabuf *assoc_p2p_ie;
116 struct eap_sm * eap_server_sm_init(void *eapol_ctx,
117 struct eapol_callbacks *eapol_cb,
118 struct eap_config *eap_conf);
119 void eap_server_sm_deinit(struct eap_sm *sm);
120 int eap_server_sm_step(struct eap_sm *sm);
121 void eap_sm_notify_cached(struct eap_sm *sm);
122 void eap_sm_pending_cb(struct eap_sm *sm);
123 int eap_sm_method_pending(struct eap_sm *sm);
124 const u8 * eap_get_identity(struct eap_sm *sm, size_t *len);
125 struct eap_eapol_interface * eap_get_interface(struct eap_sm *sm);
126 void eap_server_clear_identity(struct eap_sm *sm);