summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-09-05 12:39:27 +0200
committerThomas Haller <thaller@redhat.com>2018-09-05 12:39:31 +0200
commitd4c12c26c4c4cc3ae3362a5fa2efecbb97ddb24b (patch)
tree0fca341cb4cbd0d741356614217577eb04a87bce
parenta6043ac3b313e4429e60935bc1a7ffe8db1b935f (diff)
downloadNetworkManager-th/pr/183.tar.gz
wifi: trust eap methods from profile to be lower-caseth/pr/183
NMSetting8021x::verify() checks the string values for eap methods. They must all be non-NULL and are not compared case-insensitive.
-rw-r--r--src/supplicant/nm-supplicant-config.c10
1 files 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