mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 09:04:55 +00:00
libnm-util: validate PSK and LEAP passwords
If they exist, they shouldn't be zero-length.
This commit is contained in:
parent
3d81c82e58
commit
6bd0fce1c9
|
@ -590,6 +590,13 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
|
|||
NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME);
|
||||
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 {
|
||||
if ( (strcmp (priv->key_mgmt, "ieee8021x") == 0)
|
||||
|| (strcmp (priv->key_mgmt, "wpa-eap") == 0)) {
|
||||
|
@ -657,6 +664,14 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
|
|||
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)) {
|
||||
g_set_error (error,
|
||||
NM_SETTING_WIRELESS_SECURITY_ERROR,
|
||||
|
|
Loading…
Reference in a new issue