From d4c12c26c4c4cc3ae3362a5fa2efecbb97ddb24b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 5 Sep 2018 12:39:27 +0200 Subject: wifi: trust eap methods from profile to be lower-case NMSetting8021x::verify() checks the string values for eap methods. They must all be non-NULL and are not compared case-insensitive. --- src/supplicant/nm-supplicant-config.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/supplicant/nm-supplicant-config.c b/src/supplicant/nm-supplicant-config.c index 042820708b..41d510e876 100644 --- a/src/supplicant/nm-supplicant-config.c +++ b/src/supplicant/nm-supplicant-config.c @@ -1045,10 +1045,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, for (i = 0; i < num_eap; i++) { const char *method = nm_setting_802_1x_get_eap_method (setting, i); - if (!method) - continue; - - if (strcasecmp (method, "fast") == 0) { + if (nm_streq (method, "fast")) { fast = TRUE; priv->fast_required = TRUE; } @@ -1057,7 +1054,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, if (num_eap == 1) { g_set_error (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG, "Connection settings managed externally to NM, connection" - " cannot be used with wpa_supplicant"); + " cannot be used with wpa_supplicant"); return FALSE; } continue; @@ -1069,7 +1066,8 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, } g_string_ascii_up (eap_str); - if (eap_str->len && !nm_supplicant_config_add_option (self, "eap", eap_str->str, -1, NULL, error)) + if ( eap_str->len + && !nm_supplicant_config_add_option (self, "eap", eap_str->str, -1, NULL, error)) return FALSE; /* Adjust the fragment size according to MTU, but do not set it higher than 1280-14 -- cgit v1.2.1