aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_fast_pac.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-01-12 15:30:08 (GMT)
committerJouni Malinen <j@w1.fi>2013-01-12 15:33:22 (GMT)
commit34d18540fc5a0f50a81495f59649ec7a7818be3e (patch)
tree61518655471b6efba4863cfc023628a83439ec28 /src/eap_peer/eap_fast_pac.c
parent2e8483bf125d53eda8b437dc5eaace7431542aec (diff)
downloadhostap-34d18540fc5a0f50a81495f59649ec7a7818be3e.zip
hostap-34d18540fc5a0f50a81495f59649ec7a7818be3e.tar.gz
hostap-34d18540fc5a0f50a81495f59649ec7a7818be3e.tar.bz2
EAP-FAST: Allow empty PAC file to be used
Even if the PAC file does not start with the proper header line, allow the file to be used if it is empty. [Bug 423] Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_peer/eap_fast_pac.c')
-rw-r--r--src/eap_peer/eap_fast_pac.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/eap_peer/eap_fast_pac.c b/src/eap_peer/eap_fast_pac.c
index fc987da..8c480b9 100644
--- a/src/eap_peer/eap_fast_pac.c
+++ b/src/eap_peer/eap_fast_pac.c
@@ -422,8 +422,12 @@ int eap_fast_load_pac(struct eap_sm *sm, struct eap_fast_pac **pac_root,
if (eap_fast_init_pac_data(sm, pac_file, &rc) < 0)
return 0;
- if (eap_fast_read_line(&rc, &pos) < 0 ||
- os_strcmp(pac_file_hdr, rc.buf) != 0)
+ if (eap_fast_read_line(&rc, &pos) < 0) {
+ /* empty file - assume it is fine to overwrite */
+ eap_fast_deinit_pac_data(&rc);
+ return 0;
+ }
+ if (os_strcmp(pac_file_hdr, rc.buf) != 0)
err = "Unrecognized header line";
while (!err && eap_fast_read_line(&rc, &pos) == 0) {