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_MAX_METHODS 8
27 #define EAP_TTLS_AUTH_PAP 1
28 #define EAP_TTLS_AUTH_CHAP 2
29 #define EAP_TTLS_AUTH_MSCHAP 4
30 #define EAP_TTLS_AUTH_MSCHAPV2 8
36 } methods[EAP_MAX_METHODS];
39 int password_hash; /* whether password is hashed with
40 * nt_password_hash() */
43 int ttls_auth; /* bitfield of
44 * EAP_TTLS_AUTH_{PAP,CHAP,MSCHAP,MSCHAPV2} */
47 struct eap_eapol_interface {
48 /* Lower layer to full authenticator variables */
49 Boolean eapResp; /* shared with EAPOL Backend Authentication */
50 struct wpabuf *eapRespData;
53 Boolean eapRestart; /* shared with EAPOL Authenticator PAE */
57 /* Full authenticator to lower layer variables */
58 Boolean eapReq; /* shared with EAPOL Backend Authentication */
59 Boolean eapNoReq; /* shared with EAPOL Backend Authentication */
63 struct wpabuf *eapReqData;
66 Boolean eapKeyAvailable; /* called keyAvailable in IEEE 802.1X-2004 */
68 /* AAA interface to full authenticator variables */
73 struct wpabuf *aaaEapReqData;
75 size_t aaaEapKeyDataLen;
76 Boolean aaaEapKeyAvailable;
79 /* Full authenticator to AAA interface variables */
81 struct wpabuf *aaaEapRespData;
82 /* aaaIdentity -> eap_get_identity() */
86 struct eapol_callbacks {
87 int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
88 int phase2, struct eap_user *user);
89 const char * (*get_eap_req_id_text)(void *ctx, size_t *len);
95 void *eap_sim_db_priv;
98 u8 *pac_opaque_encr_key;
100 size_t eap_fast_a_id_len;
101 char *eap_fast_a_id_info;
103 int pac_key_lifetime;
104 int pac_key_refresh_time;
105 int eap_sim_aka_result_ind;
107 struct wps_context *wps;
108 const struct wpabuf *assoc_wps_ie;
113 struct eap_sm * eap_server_sm_init(void *eapol_ctx,
114 struct eapol_callbacks *eapol_cb,
115 struct eap_config *eap_conf);
116 void eap_server_sm_deinit(struct eap_sm *sm);
117 int eap_server_sm_step(struct eap_sm *sm);
118 void eap_sm_notify_cached(struct eap_sm *sm);
119 void eap_sm_pending_cb(struct eap_sm *sm);
120 int eap_sm_method_pending(struct eap_sm *sm);
121 const u8 * eap_get_identity(struct eap_sm *sm, size_t *len);
122 struct eap_eapol_interface * eap_get_interface(struct eap_sm *sm);