1 /*
2  * EAP peer state machine functions (RFC 4137)
3  * Copyright (c) 2004-2012, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef EAP_H
10 #define EAP_H
11 
12 #include "common/defs.h"
13 #include "eap_peer/eap_defs.h"
14 
15 struct eap_sm;
16 
17 struct eap_method_type {
18 	int vendor;
19 	EapType method;
20 };
21 
22 u8 *g_wpa_anonymous_identity;
23 int g_wpa_anonymous_identity_len;
24 u8 *g_wpa_username;
25 int g_wpa_username_len;
26 const u8 *g_wpa_client_cert;
27 int g_wpa_client_cert_len;
28 const u8 *g_wpa_private_key;
29 int g_wpa_private_key_len;
30 const u8 *g_wpa_private_key_passwd;
31 int g_wpa_private_key_passwd_len;
32 
33 const u8 *g_wpa_ca_cert;
34 int g_wpa_ca_cert_len;
35 
36 u8 *g_wpa_password;
37 int g_wpa_password_len;
38 
39 u8 *g_wpa_new_password;
40 int g_wpa_new_password_len;
41 
42 char *g_wpa_ttls_phase2_type;
43 char *g_wpa_phase1_options;
44 
45 u8 *g_wpa_pac_file;
46 int g_wpa_pac_file_len;
47 
48 bool g_wpa_suiteb_certification;
49 
50 const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len);
51 void eap_deinit_prev_method(struct eap_sm *sm, const char *txt);
52 struct wpabuf * eap_sm_build_nak(struct eap_sm *sm, EapType type, u8 id);
53 struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted);
54 int eap_peer_blob_init(struct eap_sm *sm);
55 void eap_peer_blob_deinit(struct eap_sm *sm);
56 int eap_peer_config_init(
57 	struct eap_sm *sm, const u8 *private_key_passwd,
58 	int private_key_passwd_len);
59 void eap_peer_config_deinit(struct eap_sm *sm);
60 void eap_sm_abort(struct eap_sm *sm);
61 int eap_peer_register_methods(void);
62 void eap_sm_request_identity(struct eap_sm *sm);
63 void eap_sm_request_password(struct eap_sm *sm);
64 void eap_sm_request_new_password(struct eap_sm *sm);
65 
66 #endif /* EAP_H */
67