[network-manager-openvpn/nm-1-0: 3/3] properties: show special cipher "none"



commit 2ec2078f46f6a3053938a2db7cbcb0cdfab8dcae
Author: Thomas Haller <thaller redhat com>
Date:   Mon Sep 14 13:58:30 2015 +0200

    properties: show special cipher "none"
    
    We show all ciphers reported by `openvpn --show-ciphers`. However,
    this does not show the special cipher "none" although it is a valid
    configuration.
    
    (cherry picked from commit be63c404a146704e3e4840f050d5bdd63bc94826)

 properties/auth-helpers.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index 3876241..209cc03 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -1011,6 +1011,15 @@ populate_cipher_combo (GtkComboBox *box, const char *user_cipher)
                            TLS_CIPHER_COL_NAME, _("Default"),
                            TLS_CIPHER_COL_DEFAULT, TRUE, -1);
 
+       gtk_list_store_append (store, &iter);
+       gtk_list_store_set (store, &iter,
+                           TLS_CIPHER_COL_NAME, "none",
+                           TLS_CIPHER_COL_DEFAULT, FALSE, -1);
+       if (g_strcmp0 (user_cipher, "none") == 0) {
+               gtk_combo_box_set_active_iter (box, &iter);
+               user_added = TRUE;
+       }
+
        items = g_strsplit (tmp, "\n", 0);
        g_free (tmp);
 
@@ -1027,12 +1036,15 @@ populate_cipher_combo (GtkComboBox *box, const char *user_cipher)
                if (space)
                        *space = '\0';
 
+               if (strcmp (*item, "none") == 0)
+                       continue;
+
                if (strlen (*item)) {
                        gtk_list_store_append (store, &iter);
                        gtk_list_store_set (store, &iter,
                                            TLS_CIPHER_COL_NAME, *item,
                                            TLS_CIPHER_COL_DEFAULT, FALSE, -1);
-                       if (user_cipher && !strcmp (*item, user_cipher)) {
+                       if (!user_added && user_cipher && !strcmp (*item, user_cipher)) {
                                gtk_combo_box_set_active_iter (box, &iter);
                                user_added = TRUE;
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]