From 2c52303f59b2b4fa00a664a6b9757d841c58934b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 30 Jan 2012 18:07:35 +0100 Subject: [PATCH] supplicant: fix checking config for EAP-FAST authentication We do not want to break other methods, when EAP-FAST specific error condition is detected: no PAC file provided and automatic PAC provisioning is disabled. --- src/supplicant-manager/nm-supplicant-config.c | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c index 7044ef90bc..249ea9f58b 100644 --- a/src/supplicant-manager/nm-supplicant-config.c +++ b/src/supplicant-manager/nm-supplicant-config.c @@ -720,7 +720,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, gboolean success, added; GString *phase1, *phase2; const GByteArray *array; - gboolean peap = FALSE; + gboolean peap = FALSE, fast = FALSE; guint32 i, num_eap; gboolean fast_provisoning_allowed = FALSE; @@ -759,15 +759,15 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, ADD_STRING_LIST_VAL (setting, 802_1x, eap_method, eap_methods, "eap", ' ', TRUE, FALSE); - /* Check for PEAP + GTC */ + /* Check EAP method for special handling: PEAP + GTC, FAST */ num_eap = nm_setting_802_1x_get_num_eap_methods (setting); for (i = 0; i < num_eap; i++) { const char *method = nm_setting_802_1x_get_eap_method (setting, i); - if (method && (strcasecmp (method, "peap") == 0)) { + if (method && (strcasecmp (method, "peap") == 0)) peap = TRUE; - break; - } + if (method && (strcasecmp (method, "fast") == 0)) + fast = TRUE; } /* When using PEAP-GTC, we're likely using Cisco kit, so we want to turn @@ -857,8 +857,14 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, return FALSE; } g_free (blob_name); - } else - return FALSE; + } else { + /* This is only error for EAP-FAST; don't disturb other methods. */ + if (fast) { + nm_log_err (LOGD_SUPPLICANT, "EAP-FAST error: no PAC file provided and " + "automatic PAC provisioning is disabled."); + return FALSE; + } + } } /* CA path */