2 * hostapd / EAP Standalone Authenticator state machine (RFC 4137)
3 * Copyright (c) 2004-2005, 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.
20 #include "eap_methods.h"
24 #define EAP_MAX_METHODS 8
29 } methods
[EAP_MAX_METHODS
];
32 int password_hash
; /* whether password is hashed with
33 * nt_password_hash() */
39 EAPOL_eapSuccess
, EAPOL_eapRestart
, EAPOL_eapFail
, EAPOL_eapResp
,
40 EAPOL_eapReq
, EAPOL_eapNoReq
, EAPOL_portEnabled
, EAPOL_eapTimeout
43 struct eapol_callbacks
{
44 Boolean (*get_bool
)(void *ctx
, enum eapol_bool_var variable
);
45 void (*set_bool
)(void *ctx
, enum eapol_bool_var variable
,
47 void (*set_eapReqData
)(void *ctx
, const u8
*eapReqData
,
48 size_t eapReqDataLen
);
49 void (*set_eapKeyData
)(void *ctx
, const u8
*eapKeyData
,
50 size_t eapKeyDataLen
);
51 int (*get_eap_user
)(void *ctx
, const u8
*identity
, size_t identity_len
,
52 int phase2
, struct eap_user
*user
);
53 const char * (*get_eap_req_id_text
)(void *ctx
, size_t *len
);
58 void *eap_sim_db_priv
;
65 struct eap_sm
* eap_sm_init(void *eapol_ctx
, struct eapol_callbacks
*eapol_cb
,
66 struct eap_config
*eap_conf
);
67 void eap_sm_deinit(struct eap_sm
*sm
);
68 int eap_sm_step(struct eap_sm
*sm
);
69 void eap_set_eapRespData(struct eap_sm
*sm
, const u8
*eapRespData
,
70 size_t eapRespDataLen
);
71 void eap_sm_notify_cached(struct eap_sm
*sm
);
72 void eap_sm_pending_cb(struct eap_sm
*sm
);
73 int eap_sm_method_pending(struct eap_sm
*sm
);
75 #else /* EAP_SERVER */
77 static inline struct eap_sm
* eap_sm_init(void *eapol_ctx
,
78 struct eapol_callbacks
*eapol_cb
,
79 struct eap_config
*eap_conf
)
84 static inline void eap_sm_deinit(struct eap_sm
*sm
)
88 static inline int eap_sm_step(struct eap_sm
*sm
)
94 static inline void eap_set_eapRespData(struct eap_sm
*sm
,
95 const u8
*eapRespData
,
96 size_t eapRespDataLen
)
100 static inline void eap_sm_notify_cached(struct eap_sm
*sm
)
104 static inline void eap_sm_pending_cb(struct eap_sm
*sm
)
108 static inline int eap_sm_method_pending(struct eap_sm
*sm
)
113 #endif /* EAP_SERVER */