[network-manager-applet/lr/tls-domain-suffix-match-rh1457542: 10/12] wireless-security/peap: add domain suffix match entry



commit 0212388438728acfaca6e7462786b5b5b854dda4
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Jun 9 19:35:25 2017 +0200

    wireless-security/peap: add domain suffix match entry
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1457542

 src/wireless-security/eap-method-peap.c  |   23 +++++++++++++++++-
 src/wireless-security/eap-method-peap.ui |   38 +++++++++++++++++++++++++----
 2 files changed, 54 insertions(+), 7 deletions(-)
---
diff --git a/src/wireless-security/eap-method-peap.c b/src/wireless-security/eap-method-peap.c
index 380dd99..a4f437f 100644
--- a/src/wireless-security/eap-method-peap.c
+++ b/src/wireless-security/eap-method-peap.c
@@ -107,6 +107,10 @@ add_to_size_group (EAPMethod *parent, GtkSizeGroup *group)
        g_assert (widget);
        gtk_size_group_add_widget (group, widget);
 
+       widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_domain_label"));
+       g_assert (widget);
+       gtk_size_group_add_widget (group, widget);
+
        nma_cert_chooser_add_to_size_group (NMA_CERT_CHOOSER (method->ca_cert_chooser), group);
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_version_label"));
@@ -159,6 +163,12 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
        if (text && strlen (text))
                g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, text, NULL);
 
+       widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_domain_entry"));
+       g_assert (widget);
+       text = gtk_entry_get_text (GTK_ENTRY (widget));
+       if (text && strlen (text))
+               g_object_set (s_8021x, NM_SETTING_802_1X_DOMAIN_SUFFIX_MATCH, text, NULL);
+
 #if LIBNM_BUILD
 /* libnm-glib doesn't support this. */
        /* Save CA certificate PIN password flags to the connection */
@@ -384,7 +394,7 @@ eap_method_peap_new (WirelessSecurity *ws_parent,
        method->ca_cert_chooser = nma_cert_chooser_new ("CA",
                                                          NMA_CERT_CHOOSER_FLAG_CERT
                                                        | (secrets_only ? NMA_CERT_CHOOSER_FLAG_PASSWORDS : 
0));
-       gtk_grid_attach (GTK_GRID (widget), method->ca_cert_chooser, 0, 1, 2, 1);
+       gtk_grid_attach (GTK_GRID (widget), method->ca_cert_chooser, 0, 2, 2, 1);
        gtk_widget_show (method->ca_cert_chooser);
 
        g_signal_connect (method->ca_cert_chooser,
@@ -456,11 +466,22 @@ eap_method_peap_new (WirelessSecurity *ws_parent,
                          (GCallback) wireless_security_changed_cb,
                          ws_parent);
 
+       widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_domain_entry"));
+       if (s_8021x && nm_setting_802_1x_get_domain_suffix_match (s_8021x))
+               gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_domain_suffix_match (s_8021x));
+       g_signal_connect (G_OBJECT (widget), "changed",
+                         (GCallback) wireless_security_changed_cb,
+                         ws_parent);
+
        if (secrets_only) {
                widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, 
"eap_peap_anon_identity_label"));
                gtk_widget_hide (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, 
"eap_peap_anon_identity_entry"));
                gtk_widget_hide (widget);
+               widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_domain_label"));
+               gtk_widget_hide (widget);
+               widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_domain_entry"));
+               gtk_widget_hide (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, 
"eap_peap_ca_cert_not_required_checkbox"));
                gtk_widget_hide (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_inner_auth_label"));
diff --git a/src/wireless-security/eap-method-peap.ui b/src/wireless-security/eap-method-peap.ui
index be1bc92..72a7574 100644
--- a/src/wireless-security/eap-method-peap.ui
+++ b/src/wireless-security/eap-method-peap.ui
@@ -79,7 +79,7 @@
           </object>
           <packing>
             <property name="left_attach">1</property>
-            <property name="top_attach">2</property>
+            <property name="top_attach">3</property>
           </packing>
         </child>
         <child>
@@ -92,7 +92,7 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">3</property>
+            <property name="top_attach">4</property>
           </packing>
         </child>
         <child>
@@ -110,7 +110,7 @@
           </object>
           <packing>
             <property name="left_attach">1</property>
-            <property name="top_attach">3</property>
+            <property name="top_attach">4</property>
           </packing>
         </child>
         <child>
@@ -123,7 +123,7 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">4</property>
+            <property name="top_attach">5</property>
           </packing>
         </child>
         <child>
@@ -141,7 +141,7 @@
           </object>
           <packing>
             <property name="left_attach">1</property>
-            <property name="top_attach">4</property>
+            <property name="top_attach">5</property>
           </packing>
         </child>
         <child>
@@ -154,11 +154,37 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">5</property>
+            <property name="top_attach">6</property>
             <property name="width">2</property>
           </packing>
         </child>
         <child>
+          <object class="GtkLabel" id="eap_peap_domain_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">_Domain:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_peap_domain_entry</property>
+            <property name="xalign">0</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="eap_peap_domain_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hexpand">True</property>
+            <property name="activates_default">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">1</property>
+          </packing>
+        </child>
+        <child>
           <placeholder/>
         </child>
         <child>


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