Blame SOURCES/0001-Wi-Fi-OWE-Fix-Enhanced-Open-OWE-not-being-saved-prop.patch

5bb4c0
From 38731695f7b38d867e51b3d5cee2d0281c315a71 Mon Sep 17 00:00:00 2001
5bb4c0
From: Ana Cabral <acabral@redhat.com>
5bb4c0
Date: Mon, 21 Feb 2022 16:32:27 +0100
5bb4c0
Subject: [PATCH] Wi-Fi/OWE: Fix Enhanced Open (OWE) not being saved properly
5bb4c0
 from nm-connection-editor
5bb4c0
5bb4c0
When we create a Wi-Fi connection using Enhanced Open (OWE) Security
5bb4c0
from nm-connection-editor and save it, it was not being saved and the
5bb4c0
security was being set as "None", with Wireless Security Setting
5bb4c0
being discarded. This was fixed.
5bb4c0
5bb4c0
This fix is temporary fix. It should (and will) be done from libnma,
5bb4c0
OWE should be implemented in libnma. Meanwhile this gets done,
5bb4c0
this solution handles this issue.
5bb4c0
5bb4c0
https://bugzilla.redhat.com/show_bug.cgi?id=2023156
5bb4c0
5bb4c0
Fixes: b85ed300781ce9f26df9cf8e659d1bc0bc173201
5bb4c0
5bb4c0
https://gitlab.gnome.org/GNOME/network-manager-applet/-/merge_requests/108
5bb4c0
(cherry picked from commit 38731695f7b38d867e51b3d5cee2d0281c315a71)
5bb4c0
---
5bb4c0
 src/connection-editor/page-wifi-security.c | 22 ++++++++++++++++++----
5bb4c0
 1 file changed, 18 insertions(+), 4 deletions(-)
5bb4c0
5bb4c0
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c
5bb4c0
index e8c9d7e2..e8086452 100644
5bb4c0
--- a/src/connection-editor/page-wifi-security.c
5bb4c0
+++ b/src/connection-editor/page-wifi-security.c
5bb4c0
@@ -580,10 +580,24 @@ ce_page_validate_v (CEPage *page, NMConnection *connection, GError **error)
5bb4c0
 
5bb4c0
 		g_object_unref (ws);
5bb4c0
 	} else {
5bb4c0
-		/* No security, unencrypted */
5bb4c0
-		nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
5bb4c0
-		nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
5bb4c0
-		valid = TRUE;
5bb4c0
+
5bb4c0
+		if (gtk_combo_box_get_active (priv->security_combo) == 0) {
5bb4c0
+			/* No security, unencrypted */
5bb4c0
+			nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
5bb4c0
+			nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
5bb4c0
+			valid = TRUE;
5bb4c0
+		} else {
5bb4c0
+			/* owe case:
5bb4c0
+			 * fill the connection manually until libnma implements OWE wireless security
5bb4c0
+			 */
5bb4c0
+			NMSetting *s_wireless_sec;
5bb4c0
+
5bb4c0
+			s_wireless_sec = nm_setting_wireless_security_new ();
5bb4c0
+			g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "owe", NULL);
5bb4c0
+			nm_connection_add_setting (connection, s_wireless_sec);
5bb4c0
+			nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
5bb4c0
+			valid = TRUE;
5bb4c0
+		}
5bb4c0
 	}
5bb4c0
 
5bb4c0
 	return valid;
5bb4c0
-- 
5bb4c0
2.35.1
5bb4c0