xref: /freebsd/contrib/wpa/src/eap_peer/eap_teap_pac.h (revision cab6a39d7b343596a5823e65c0f7b426551ec22d)
1 /*
2  * EAP peer method: EAP-TEAP PAC file processing
3  * Copyright (c) 2004-2019, 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_TEAP_PAC_H
10 #define EAP_TEAP_PAC_H
11 
12 #include "eap_common/eap_teap_common.h"
13 
14 struct eap_teap_pac {
15 	struct eap_teap_pac *next;
16 
17 	u8 pac_key[EAP_TEAP_PAC_KEY_LEN];
18 	u8 *pac_opaque;
19 	size_t pac_opaque_len;
20 	u8 *pac_info;
21 	size_t pac_info_len;
22 	u8 *a_id;
23 	size_t a_id_len;
24 	u8 *i_id;
25 	size_t i_id_len;
26 	u8 *a_id_info;
27 	size_t a_id_info_len;
28 	u16 pac_type;
29 };
30 
31 
32 void eap_teap_free_pac(struct eap_teap_pac *pac);
33 struct eap_teap_pac * eap_teap_get_pac(struct eap_teap_pac *pac_root,
34 				       const u8 *a_id, size_t a_id_len,
35 				       u16 pac_type);
36 int eap_teap_add_pac(struct eap_teap_pac **pac_root,
37 		     struct eap_teap_pac **pac_current,
38 		     struct eap_teap_pac *entry);
39 int eap_teap_load_pac(struct eap_sm *sm, struct eap_teap_pac **pac_root,
40 		      const char *pac_file);
41 int eap_teap_save_pac(struct eap_sm *sm, struct eap_teap_pac *pac_root,
42 		      const char *pac_file);
43 size_t eap_teap_pac_list_truncate(struct eap_teap_pac *pac_root,
44 				  size_t max_len);
45 int eap_teap_load_pac_bin(struct eap_sm *sm, struct eap_teap_pac **pac_root,
46 			  const char *pac_file);
47 int eap_teap_save_pac_bin(struct eap_sm *sm, struct eap_teap_pac *pac_root,
48 			  const char *pac_file);
49 
50 #endif /* EAP_TEAP_PAC_H */
51