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