summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAna Cabral <acabral@redhat.com>2022-02-21 16:32:27 +0100
committerAna Cabral <acabral@redhat.com>2022-02-21 20:50:26 +0100
commit38731695f7b38d867e51b3d5cee2d0281c315a71 (patch)
treec8089ae7b505c6d791c5b46596faef4360a73d37
parent9de24dacfc00cf4418d83f30ad07a6c384fc6d35 (diff)
downloadnetwork-manager-applet-38731695f7b38d867e51b3d5cee2d0281c315a71.tar.gz
Wi-Fi/OWE: Fix Enhanced Open (OWE) not being saved properly from nm-connection-editor
When we create a Wi-Fi connection using Enhanced Open (OWE) Security from nm-connection-editor and save it, it was not being saved and the security was being set as "None", with Wireless Security Setting being discarded. This was fixed. This fix is temporary fix. It should (and will) be done from libnma, OWE should be implemented in libnma. Meanwhile this gets done, this solution handles this issue. https://bugzilla.redhat.com/show_bug.cgi?id=2023156 Fixes: b85ed300781ce9f26df9cf8e659d1bc0bc173201 https://gitlab.gnome.org/GNOME/network-manager-applet/-/merge_requests/108
-rw-r--r--src/connection-editor/page-wifi-security.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c
index e8c9d7e2..e8086452 100644
--- a/src/connection-editor/page-wifi-security.c
+++ b/src/connection-editor/page-wifi-security.c
@@ -580,10 +580,24 @@ ce_page_validate_v (CEPage *page, NMConnection *connection, GError **error)
g_object_unref (ws);
} else {
- /* No security, unencrypted */
- nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
- nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
- valid = TRUE;
+
+ if (gtk_combo_box_get_active (priv->security_combo) == 0) {
+ /* No security, unencrypted */
+ nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
+ nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
+ valid = TRUE;
+ } else {
+ /* owe case:
+ * fill the connection manually until libnma implements OWE wireless security
+ */
+ NMSetting *s_wireless_sec;
+
+ s_wireless_sec = nm_setting_wireless_security_new ();
+ g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "owe", NULL);
+ nm_connection_add_setting (connection, s_wireless_sec);
+ nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
+ valid = TRUE;
+ }
}
return valid;