libnm: fix bug verifying private-key for WireGuard setting

Fixes: aea47ed206 ('libnm: implement "wireguard.private-key" as direct string property')
This commit is contained in:
Thomas Haller
2022-01-20 22:19:40 +01:00
parent 6f0e22a64a
commit b5b9a109e1

View File

@@ -1771,7 +1771,7 @@ verify_secrets(NMSetting *setting, NMConnection *connection, GError **error)
NMSettingWireGuardPrivate *priv = NM_SETTING_WIREGUARD_GET_PRIVATE(setting); NMSettingWireGuardPrivate *priv = NM_SETTING_WIREGUARD_GET_PRIVATE(setting);
guint i; guint i;
if (!priv->private_key_valid) { if (priv->private_key && !priv->private_key_valid) {
g_set_error_literal(error, g_set_error_literal(error,
NM_CONNECTION_ERROR, NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY, NM_CONNECTION_ERROR_INVALID_PROPERTY,