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.
This commit is contained in:
Thomas Haller 2018-09-05 12:39:27 +02:00
parent 1181f88ef1
commit 13d8455a7c

View file

@ -1045,10 +1045,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
for (i = 0; i < num_eap; i++) { for (i = 0; i < num_eap; i++) {
const char *method = nm_setting_802_1x_get_eap_method (setting, i); const char *method = nm_setting_802_1x_get_eap_method (setting, i);
if (!method) if (nm_streq (method, "fast")) {
continue;
if (strcasecmp (method, "fast") == 0) {
fast = TRUE; fast = TRUE;
priv->fast_required = TRUE; priv->fast_required = TRUE;
} }
@ -1057,7 +1054,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
if (num_eap == 1) { if (num_eap == 1) {
g_set_error (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG, g_set_error (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG,
"Connection settings managed externally to NM, connection" "Connection settings managed externally to NM, connection"
" cannot be used with wpa_supplicant"); " cannot be used with wpa_supplicant");
return FALSE; return FALSE;
} }
continue; continue;
@ -1069,7 +1066,8 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
} }
g_string_ascii_up (eap_str); 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; return FALSE;
/* Adjust the fragment size according to MTU, but do not set it higher than 1280-14 /* Adjust the fragment size according to MTU, but do not set it higher than 1280-14