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

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