From 532d5fc85d8c34c059b1eebcab825fa8a00e0300 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 28 Apr 2020 19:09:15 +0200 Subject: [PATCH] nm: Fix password entry for private keys and allow saving it On newer desktops the auth dialog is called with --external-ui-mode and it seems that the password flag has to be set, otherwise the password is not stored temporarily in the profile and passed to charon-nm (not sure how this works exactly as need_secrets() is called multiple times even after the password was already entered, only before doing so the last time is the password available in that callback, but only if the flag was set). This now also allows storing the password for the private key with the profile. Fixes #3428. --- src/frontends/gnome/properties/nm-strongswan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontends/gnome/properties/nm-strongswan.c b/src/frontends/gnome/properties/nm-strongswan.c index 81c89c1d8..07bfb1c56 100644 --- a/src/frontends/gnome/properties/nm-strongswan.c +++ b/src/frontends/gnome/properties/nm-strongswan.c @@ -178,6 +178,7 @@ static void update_cert_fields (StrongswanPluginUiWidgetPrivate *priv, gboolean gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); /* FALL */ case 0: + update_pass_field (priv, TRUE); cert = key = TRUE; break; case 1: @@ -567,6 +568,8 @@ save_cert (NMSettingVpn *settings, GtkBuilder *builder) { default: case 0: + save_password_and_flags (settings, builder, "passwd-entry", + "password"); cert = key = TRUE; str = "file"; break;