xref: /freebsd/contrib/wpa/src/eap_peer/eap_teap_pac.h (revision c5c3ba6b43cac20dc9432eac15758d41cb2b8b1f)
1*206b73d0SCy Schubert /*
2*206b73d0SCy Schubert  * EAP peer method: EAP-TEAP PAC file processing
3*206b73d0SCy Schubert  * Copyright (c) 2004-2019, Jouni Malinen <j@w1.fi>
4*206b73d0SCy Schubert  *
5*206b73d0SCy Schubert  * This software may be distributed under the terms of the BSD license.
6*206b73d0SCy Schubert  * See README for more details.
7*206b73d0SCy Schubert  */
8*206b73d0SCy Schubert 
9*206b73d0SCy Schubert #ifndef EAP_TEAP_PAC_H
10*206b73d0SCy Schubert #define EAP_TEAP_PAC_H
11*206b73d0SCy Schubert 
12*206b73d0SCy Schubert #include "eap_common/eap_teap_common.h"
13*206b73d0SCy Schubert 
14*206b73d0SCy Schubert struct eap_teap_pac {
15*206b73d0SCy Schubert 	struct eap_teap_pac *next;
16*206b73d0SCy Schubert 
17*206b73d0SCy Schubert 	u8 pac_key[EAP_TEAP_PAC_KEY_LEN];
18*206b73d0SCy Schubert 	u8 *pac_opaque;
19*206b73d0SCy Schubert 	size_t pac_opaque_len;
20*206b73d0SCy Schubert 	u8 *pac_info;
21*206b73d0SCy Schubert 	size_t pac_info_len;
22*206b73d0SCy Schubert 	u8 *a_id;
23*206b73d0SCy Schubert 	size_t a_id_len;
24*206b73d0SCy Schubert 	u8 *i_id;
25*206b73d0SCy Schubert 	size_t i_id_len;
26*206b73d0SCy Schubert 	u8 *a_id_info;
27*206b73d0SCy Schubert 	size_t a_id_info_len;
28*206b73d0SCy Schubert 	u16 pac_type;
29*206b73d0SCy Schubert };
30*206b73d0SCy Schubert 
31*206b73d0SCy Schubert 
32*206b73d0SCy Schubert void eap_teap_free_pac(struct eap_teap_pac *pac);
33*206b73d0SCy Schubert struct eap_teap_pac * eap_teap_get_pac(struct eap_teap_pac *pac_root,
34*206b73d0SCy Schubert 				       const u8 *a_id, size_t a_id_len,
35*206b73d0SCy Schubert 				       u16 pac_type);
36*206b73d0SCy Schubert int eap_teap_add_pac(struct eap_teap_pac **pac_root,
37*206b73d0SCy Schubert 		     struct eap_teap_pac **pac_current,
38*206b73d0SCy Schubert 		     struct eap_teap_pac *entry);
39*206b73d0SCy Schubert int eap_teap_load_pac(struct eap_sm *sm, struct eap_teap_pac **pac_root,
40*206b73d0SCy Schubert 		      const char *pac_file);
41*206b73d0SCy Schubert int eap_teap_save_pac(struct eap_sm *sm, struct eap_teap_pac *pac_root,
42*206b73d0SCy Schubert 		      const char *pac_file);
43*206b73d0SCy Schubert size_t eap_teap_pac_list_truncate(struct eap_teap_pac *pac_root,
44*206b73d0SCy Schubert 				  size_t max_len);
45*206b73d0SCy Schubert int eap_teap_load_pac_bin(struct eap_sm *sm, struct eap_teap_pac **pac_root,
46*206b73d0SCy Schubert 			  const char *pac_file);
47*206b73d0SCy Schubert int eap_teap_save_pac_bin(struct eap_sm *sm, struct eap_teap_pac *pac_root,
48*206b73d0SCy Schubert 			  const char *pac_file);
49*206b73d0SCy Schubert 
50*206b73d0SCy Schubert #endif /* EAP_TEAP_PAC_H */
51