]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
nm: Add PSK option to auth-dialog
authorTobias Brunner <tobias@strongswan.org>
Fri, 22 Nov 2013 13:02:24 +0000 (14:02 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 27 Nov 2013 17:36:58 +0000 (18:36 +0100)
src/frontends/gnome/auth-dialog/main.c

index a22e34d7774d2574e6749c52b1ee83b127e79e98..57fb4dfe3e47369307778ba1968940310a6c3986 100644 (file)
@@ -99,7 +99,7 @@ static char* get_connection_type(char *uuid)
                fprintf (stderr, "Failed to read data and secrets from stdin.\n");
                return NULL;
        }
-       
+
        method = g_hash_table_lookup (data, "method");
        if (method)
                method = g_strdup(method);
@@ -159,7 +159,8 @@ int main (int argc, char *argv[])
                fprintf(stderr, "Connection lookup failed\n");
                return 1;
        }
-       if (!strcmp(type, "eap") || !strcmp(type, "key") || !strcmp(type, "smartcard"))
+       if (!strcmp(type, "eap") || !strcmp(type, "key") || !strcmp(type, "psk") ||
+               !strcmp(type, "smartcard"))
        {
                pass = lookup_password(name, service);
                if ((!pass || retry) && allow_interaction)
@@ -178,6 +179,13 @@ int main (int argc, char *argv[])
                                                        NULL, NULL, TRUE);
                                gnome_password_dialog_set_show_remember(GNOME_PASSWORD_DIALOG(dialog), TRUE);
                        }
+                       else if (!strcmp(type, "psk"))
+                       {
+                               dialog = gnome_password_dialog_new(_("VPN password required"),
+                                                       _("Pre-shared key required to establish VPN connection:"),
+                                                       NULL, NULL, TRUE);
+                               gnome_password_dialog_set_show_remember(GNOME_PASSWORD_DIALOG(dialog), TRUE);
+                       }
                        else /* smartcard */
                        {
                                dialog = gnome_password_dialog_new(_("VPN password required"),
@@ -244,4 +252,3 @@ int main (int argc, char *argv[])
        wait_for_quit ();
        return 0;
 }
-