[NetworkManager-fortisslvpn] shared: make user name optional
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [NetworkManager-fortisslvpn] shared: make user name optional
- Date: Sun, 14 Feb 2021 10:01:00 +0000 (UTC)
commit 09ec4cde0e2f4e49bbc5c09c8f103ccc338486d9
Author: Kamus Hadenes <kamushadenes hyadesinc com>
Date: Thu Mar 26 15:16:42 2020 -0300
shared: make user name optional
[lkundrak v3 sk: split off "add support for cert-only authentication"
patch].
https://gitlab.gnome.org/GNOME/NetworkManager-fortisslvpn/-/merge_requests/14
shared/nm-fortissl-properties.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/shared/nm-fortissl-properties.c b/shared/nm-fortissl-properties.c
index f9713c3..097c4d8 100644
--- a/shared/nm-fortissl-properties.c
+++ b/shared/nm-fortissl-properties.c
@@ -34,7 +34,7 @@ typedef struct {
static const ValidProperty valid_properties[] = {
{ NM_FORTISSLVPN_KEY_GATEWAY, G_TYPE_STRING, TRUE },
- { NM_FORTISSLVPN_KEY_USER, G_TYPE_STRING, TRUE },
+ { NM_FORTISSLVPN_KEY_USER, G_TYPE_STRING, FALSE },
{ NM_FORTISSLVPN_KEY_CA, G_TYPE_STRING, FALSE },
{ NM_FORTISSLVPN_KEY_TRUSTED_CERT, G_TYPE_STRING, FALSE },
{ NM_FORTISSLVPN_KEY_CERT, G_TYPE_STRING, FALSE },
@@ -223,14 +223,19 @@ nm_fortisslvpn_properties_validate_secrets (NMSettingVpn *s_vpn, GError **error)
{
ValidateInfo info = { &valid_secrets[0], error, FALSE };
+ const char *cert;
+ cert = nm_setting_vpn_get_data_item (s_vpn, NM_FORTISSLVPN_KEY_CERT);
+
nm_setting_vpn_foreach_secret (s_vpn, validate_one_property, &info);
if (!info.have_items) {
- g_set_error (error,
- NM_VPN_PLUGIN_ERROR,
- NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
- "%s",
- _("No VPN secrets!"));
- return FALSE;
+ if (!cert) {
+ g_set_error (error,
+ NM_VPN_PLUGIN_ERROR,
+ NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
+ "%s",
+ _("No VPN secrets!"));
+ return FALSE;
+ }
}
return *error ? FALSE : TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]