]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
nm: Fix password entry for private keys and allow saving it
authorTobias Brunner <tobias@strongswan.org>
Tue, 28 Apr 2020 17:09:15 +0000 (19:09 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 8 May 2020 16:11:41 +0000 (18:11 +0200)
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

index 81c89c1d8bb725338187cb87d10b4e88bfb08715..07bfb1c5630967b719c373443a28f196eb026bad 100644 (file)
@@ -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;