Lines Matching defs:pac
27 * - encrypt PAC-Key in the PAC file
41 "wpa_supplicant EAP-FAST PAC file - version 1";
104 int provisioning_allowed; /* is PAC provisioning allowed */
105 int provisioning; /* doing PAC provisioning (not the normal auth) */
111 struct eap_fast_pac *pac;
121 static void eap_fast_free_pac(struct eap_fast_pac *pac)
123 os_free(pac->pac_opaque);
124 os_free(pac->pac_info);
125 os_free(pac->a_id);
126 os_free(pac->i_id);
127 os_free(pac->a_id_info);
128 os_free(pac);
135 struct eap_fast_pac *pac = data->pac;
137 while (pac) {
138 if (pac->a_id_len == a_id_len &&
139 os_memcmp(pac->a_id, a_id, a_id_len) == 0) {
140 return pac;
142 pac = pac->next;
151 struct eap_fast_pac *pac, *prev;
157 pac = data->pac;
159 while (pac) {
160 if (pac->a_id_len == entry->a_id_len &&
161 os_memcmp(pac->a_id, entry->a_id, pac->a_id_len) == 0) {
163 data->pac = pac->next;
165 prev->next = pac->next;
167 if (data->current_pac == pac)
169 eap_fast_free_pac(pac);
172 prev = pac;
173 pac = pac->next;
177 pac = os_zalloc(sizeof(*pac));
178 if (pac == NULL)
181 os_memcpy(pac->pac_key, entry->pac_key, EAP_FAST_PAC_KEY_LEN);
183 pac->pac_opaque = os_malloc(entry->pac_opaque_len);
184 if (pac->pac_opaque == NULL) {
185 eap_fast_free_pac(pac);
188 os_memcpy(pac->pac_opaque, entry->pac_opaque,
190 pac->pac_opaque_len = entry->pac_opaque_len;
193 pac->pac_info = os_malloc(entry->pac_info_len);
194 if (pac->pac_info == NULL) {
195 eap_fast_free_pac(pac);
198 os_memcpy(pac->pac_info, entry->pac_info,
200 pac->pac_info_len = entry->pac_info_len;
203 pac->a_id = os_malloc(entry->a_id_len);
204 if (pac->a_id == NULL) {
205 eap_fast_free_pac(pac);
208 os_memcpy(pac->a_id, entry->a_id,
210 pac->a_id_len = entry->a_id_len;
213 pac->i_id = os_malloc(entry->i_id_len);
214 if (pac->i_id == NULL) {
215 eap_fast_free_pac(pac);
218 os_memcpy(pac->i_id, entry->i_id,
220 pac->i_id_len = entry->i_id_len;
223 pac->a_id_info = os_malloc(entry->a_id_info_len);
224 if (pac->a_id_info == NULL) {
225 eap_fast_free_pac(pac);
228 os_memcpy(pac->a_id_info, entry->a_id_info,
230 pac->a_id_info_len = entry->a_id_info_len;
232 pac->next = data->pac;
233 data->pac = pac;
308 struct eap_fast_pac *pac = NULL;
323 wpa_printf(MSG_INFO, "EAP-FAST: No PAC blob '%s' - "
324 "assume no PAC entries have been "
333 wpa_printf(MSG_INFO, "EAP-FAST: No PAC file '%s' - "
334 "assume no PAC entries have been "
349 "PAC file '%s'", pac_file);
364 if (pac) {
371 pac = os_zalloc(sizeof(*pac));
372 if (pac == NULL) {
374 "PAC entry");
379 if (pac == NULL) {
386 pac->next = data->pac;
387 data->pac = pac;
388 pac = NULL;
390 } else if (pac && os_strcmp(buf, "PAC-Key") == 0) {
396 "PAC-Key '%s:%d'", pac_file, line);
402 os_memcpy(pac->pac_key, key, EAP_FAST_PAC_KEY_LEN);
404 } else if (pac && os_strcmp(buf, "PAC-Opaque") == 0) {
405 os_free(pac->pac_opaque);
406 pac->pac_opaque =
407 eap_fast_parse_hex(pos, &pac->pac_opaque_len);
408 if (pac->pac_opaque == NULL) {
410 "PAC-Opaque '%s:%d'",
415 } else if (pac && os_strcmp(buf, "A-ID") == 0) {
416 os_free(pac->a_id);
417 pac->a_id = eap_fast_parse_hex(pos, &pac->a_id_len);
418 if (pac->a_id == NULL) {
424 } else if (pac && os_strcmp(buf, "I-ID") == 0) {
425 os_free(pac->i_id);
426 pac->i_id = eap_fast_parse_hex(pos, &pac->i_id_len);
427 if (pac->i_id == NULL) {
433 } else if (pac && os_strcmp(buf, "A-ID-Info") == 0) {
434 os_free(pac->a_id_info);
435 pac->a_id_info =
436 eap_fast_parse_hex(pos, &pac->a_id_info_len);
437 if (pac->a_id_info == NULL) {
447 if (pac) {
448 wpa_printf(MSG_INFO, "EAP-FAST: PAC block not terminated with "
450 eap_fast_free_pac(pac);
459 wpa_printf(MSG_DEBUG, "EAP-FAST: read %d PAC entries from "
527 struct eap_fast_pac *pac;
547 pac = data->pac;
548 while (pac) {
555 eap_fast_write(&buf, &pos, &buf_len, "PAC-Key", pac->pac_key,
557 eap_fast_write(&buf, &pos, &buf_len, "PAC-Opaque",
558 pac->pac_opaque, pac->pac_opaque_len, 0);
559 eap_fast_write(&buf, &pos, &buf_len, "PAC-Info", pac->pac_info,
560 pac->pac_info_len, 0);
561 eap_fast_write(&buf, &pos, &buf_len, "A-ID", pac->a_id,
562 pac->a_id_len, 0);
563 eap_fast_write(&buf, &pos, &buf_len, "I-ID", pac->i_id,
564 pac->i_id_len, 1);
566 pac->a_id_info, pac->a_id_info_len, 1);
568 wpa_printf(MSG_DEBUG, "EAP-FAST: No memory for PAC "
579 pac = pac->next;
602 wpa_printf(MSG_INFO, "EAP-FAST: Failed to open PAC "
612 wpa_printf(MSG_DEBUG, "EAP-FAST: wrote %d PAC entries into '%s'",
632 wpa_printf(MSG_DEBUG, "EAP-FAST: Automatic PAC "
719 if (data->pac == NULL && !data->provisioning_allowed) {
720 wpa_printf(MSG_INFO, "EAP-FAST: No PAC configured and "
733 struct eap_fast_pac *pac, *prev;
743 pac = data->pac;
745 while (pac) {
746 prev = pac;
747 pac = pac->next;
903 wpa_hexdump_key(MSG_MSGDUMP, "EAP-FAST: PAC-Key",
905 /* master_secret = T-PRF(PAC-Key, "PAC to master secret label hash",
908 "PAC to master secret label hash",
1378 u8 *pac, size_t pac_len, size_t *resp_len)
1388 pos = pac;
1397 wpa_printf(MSG_DEBUG, "EAP-FAST: PAC TLV overrun "
1406 wpa_hexdump_key(MSG_DEBUG, "EAP-FAST: PAC-Key",
1410 "PAC-Key length %lu",
1418 wpa_hexdump(MSG_DEBUG, "EAP-FAST: PAC-Opaque",
1424 wpa_hexdump(MSG_DEBUG, "EAP-FAST: PAC-Info",
1430 wpa_printf(MSG_DEBUG, "EAP-FAST: Ignored unknown PAC "
1440 wpa_printf(MSG_DEBUG, "EAP-FAST: PAC TLV does not include "
1455 wpa_printf(MSG_DEBUG, "EAP-FAST: PAC-Info overrun "
1464 wpa_hexdump_ascii(MSG_DEBUG, "EAP-FAST: PAC-Info - "
1470 wpa_hexdump_ascii(MSG_DEBUG, "EAP-FAST: PAC-Info - "
1476 wpa_hexdump_ascii(MSG_DEBUG, "EAP-FAST: PAC-Info - "
1483 "PAC-Info type %d", type);
1492 wpa_printf(MSG_DEBUG, "EAP-FAST: PAC-Info does not include "
1507 wpa_printf(MSG_DEBUG, "EAP-FAST: Send PAC-Acknowledgement TLV "
1510 /* This is PAC refreshing, i.e., normal authentication that is
1512 wpa_printf(MSG_DEBUG, "EAP-FAST: Send PAC-Acknowledgement TLV "
1513 "- PAC refreshing completed successfully");
1533 u8 *eap_payload_tlv = NULL, *pac = NULL;
1668 wpa_hexdump(MSG_MSGDUMP, "EAP-FAST: PAC TLV",
1670 pac = pos;
1757 if (!resp && pac && result != EAP_TLV_RESULT_SUCCESS) {
1758 wpa_printf(MSG_DEBUG, "EAP-FAST: PAC TLV without Result TLV "
1768 if (!resp && pac && result == EAP_TLV_RESULT_SUCCESS) {
1769 resp = eap_fast_process_pac(sm, data, ret, pac, pac_len,
1849 wpa_printf(MSG_DEBUG, "EAP-FAST: PAC found for this "
1858 "session - do not add PAC-Opaque to TLS "
1864 "remove PAC-Opaque TLS extension");
1888 "add PAC-Opaque TLS extension");
1896 wpa_printf(MSG_DEBUG, "EAP-FAST: No PAC found "
1900 wpa_printf(MSG_DEBUG, "EAP-FAST: No PAC found - "
1916 "remove PAC-Opaque TLS extension");