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 extern u8 *g_wpa_anonymous_identity;
23 extern int g_wpa_anonymous_identity_len;
24 extern u8 *g_wpa_username;
25 extern int g_wpa_username_len;
26 extern const u8 *g_wpa_client_cert;
27 extern int g_wpa_client_cert_len;
28 extern const u8 *g_wpa_private_key;
29 extern int g_wpa_private_key_len;
30 extern const u8 *g_wpa_private_key_passwd;
31 extern int g_wpa_private_key_passwd_len;
32 
33 extern const u8 *g_wpa_ca_cert;
34 extern int g_wpa_ca_cert_len;
35 
36 extern u8 *g_wpa_password;
37 extern int g_wpa_password_len;
38 
39 extern u8 *g_wpa_new_password;
40 extern int g_wpa_new_password_len;
41 
42 extern char *g_wpa_ttls_phase2_type;
43 extern char *g_wpa_phase1_options;
44 
45 extern u8 *g_wpa_pac_file;
46 extern int g_wpa_pac_file_len;
47 
48 extern bool g_wpa_suiteb_certification;
49 extern bool g_wpa_default_cert_bundle;
50 extern int (*esp_crt_bundle_attach_fn)(void *conf);
51 
52 const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len);
53 void eap_deinit_prev_method(struct eap_sm *sm, const char *txt);
54 struct wpabuf * eap_sm_build_nak(struct eap_sm *sm, EapType type, u8 id);
55 struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted);
56 int eap_peer_blob_init(struct eap_sm *sm);
57 void eap_peer_blob_deinit(struct eap_sm *sm);
58 int eap_peer_config_init(
59 	struct eap_sm *sm, const u8 *private_key_passwd,
60 	int private_key_passwd_len);
61 void eap_peer_config_deinit(struct eap_sm *sm);
62 void eap_sm_abort(struct eap_sm *sm);
63 int eap_peer_register_methods(void);
64 void eap_sm_request_identity(struct eap_sm *sm);
65 void eap_sm_request_password(struct eap_sm *sm);
66 void eap_sm_request_new_password(struct eap_sm *sm);
67 bool eap_sm_allowMethod(struct eap_sm *sm, int vendor, EapType method);
68 
69 #endif /* EAP_H */
70