libnm-util: validate PSK and LEAP passwords
If they exist, they shouldn't be zero-length.
This commit is contained in:
@@ -590,6 +590,13 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
|
|||||||
NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME);
|
NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
if (priv->leap_password && !strlen (priv->leap_password)) {
|
||||||
|
g_set_error (error,
|
||||||
|
NM_SETTING_WIRELESS_SECURITY_ERROR,
|
||||||
|
NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
|
||||||
|
NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( (strcmp (priv->key_mgmt, "ieee8021x") == 0)
|
if ( (strcmp (priv->key_mgmt, "ieee8021x") == 0)
|
||||||
|| (strcmp (priv->key_mgmt, "wpa-eap") == 0)) {
|
|| (strcmp (priv->key_mgmt, "wpa-eap") == 0)) {
|
||||||
@@ -657,6 +664,14 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (priv->psk && !strlen (priv->psk)) {
|
||||||
|
g_set_error (error,
|
||||||
|
NM_SETTING_WIRELESS_SECURITY_ERROR,
|
||||||
|
NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
|
||||||
|
NM_SETTING_WIRELESS_SECURITY_PSK);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (priv->proto && !_nm_utils_string_slist_validate (priv->proto, valid_protos)) {
|
if (priv->proto && !_nm_utils_string_slist_validate (priv->proto, valid_protos)) {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
NM_SETTING_WIRELESS_SECURITY_ERROR,
|
NM_SETTING_WIRELESS_SECURITY_ERROR,
|
||||||
|
Reference in New Issue
Block a user