summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2017-06-09 19:35:25 +0200
committerLubomir Rintel <lkundrak@v3.sk>2017-06-13 15:02:26 +0200
commite9cb7074f1f1a4ad08d564a4c085ff8e80ab9e92 (patch)
tree80c167f4fb8beaffdf27f9fb5365db67877d866f
parent22f953eed2ef1cfb5ef036b131421cc2172e0c52 (diff)
downloadnetwork-manager-applet-e9cb7074f1f1a4ad08d564a4c085ff8e80ab9e92.tar.gz
wireless-security/peap: add domain suffix match entry
https://bugzilla.redhat.com/show_bug.cgi?id=1457542
-rw-r--r--src/wireless-security/eap-method-peap.c32
-rw-r--r--src/wireless-security/eap-method-peap.ui39
2 files changed, 64 insertions, 7 deletions
diff --git a/src/wireless-security/eap-method-peap.c b/src/wireless-security/eap-method-peap.c
index 380dd995..4c65adef 100644
--- a/src/wireless-security/eap-method-peap.c
+++ b/src/wireless-security/eap-method-peap.c
@@ -27,6 +27,7 @@
#include "eap-method.h"
#include "wireless-security.h"
+#include "nma-cert-chooser.h"
#include "utils.h"
#define I_NAME_COLUMN 0
@@ -107,6 +108,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"));
@@ -160,6 +165,14 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, text, NULL);
#if LIBNM_BUILD
+ 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);
+#endif
+
+#if LIBNM_BUILD
/* libnm-glib doesn't support this. */
/* Save CA certificate PIN password flags to the connection */
secret_flags = nma_cert_chooser_get_cert_password_flags (NMA_CERT_CHOOSER (method->ca_cert_chooser));
@@ -384,7 +397,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 +469,28 @@ 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 LIBNM_BUILD
+ 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);
+#else
+ gtk_widget_hide (widget);
+ widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_domain_label"));
+ gtk_widget_hide (widget);
+#endif
+
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 be1bc928..fde88fb9 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,38 @@
</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="tooltip_text" translatable="yes">Suffix of the server certificate name.</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>