Blame SOURCES/0001-network-Fix-OWE-settings.patch

44c0da
From 5b280e46029f1d857fb69ccc0db2e63b8a0e3c82 Mon Sep 17 00:00:00 2001
44c0da
From: Ana Cabral <acabral@redhat.com>
44c0da
Date: Mon, 21 Feb 2022 21:49:29 +0100
44c0da
Subject: [PATCH] network: Fix OWE settings
44c0da
44c0da
Enhanced Open (OWE) is not being saved properly from connection-editor.
44c0da
When we create a Wi-Fi connection using Enhanced Open (OWE) Security
44c0da
from nm-connection-editor and save it, it was not being saved and the
44c0da
security was being set as "None", with Wireless Security Setting
44c0da
being discarded. This is fixed by this commit. The fix is also being
44c0da
done in libnma (implementing OWE in libnma,
44c0da
https://gitlab.gnome.org/GNOME/libnma/-/issues/9), but this commit
44c0da
fixes meanwhile it gets ready.
44c0da
44c0da
It was solved by adding treatment for the case in which owe was set.
44c0da
OWE is not treated anymore in the same case as None.
44c0da
44c0da
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1521
44c0da
---
44c0da
 .../connection-editor/ce-page-security.c      | 23 +++++++++++++++----
44c0da
 1 file changed, 19 insertions(+), 4 deletions(-)
44c0da
44c0da
diff --git a/panels/network/connection-editor/ce-page-security.c b/panels/network/connection-editor/ce-page-security.c
44c0da
index 52efb9da1..ce42be146 100644
44c0da
--- a/panels/network/connection-editor/ce-page-security.c
44c0da
+++ b/panels/network/connection-editor/ce-page-security.c
44c0da
@@ -435,10 +435,25 @@ validate (CEPage        *page,
44c0da
 
44c0da
                 wireless_security_unref (sec);
44c0da
         } else {
44c0da
-                /* No security, unencrypted */
44c0da
-                nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
44c0da
-                nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
44c0da
-                valid = TRUE;
44c0da
+
44c0da
+    		if (gtk_combo_box_get_active ((CE_PAGE_SECURITY (page))->security_combo) == 0) {
44c0da
+    			/* No security, unencrypted */
44c0da
+    			nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
44c0da
+    			nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
44c0da
+    			valid = TRUE;
44c0da
+    		} else {
44c0da
+    			/* owe case:
44c0da
+    			 * fill the connection manually until libnma implements OWE wireless security
44c0da
+    			 */
44c0da
+    			NMSetting *sws;
44c0da
+
44c0da
+    			sws = nm_setting_wireless_security_new ();
44c0da
+    			g_object_set (sws, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "owe", NULL);
44c0da
+    			nm_connection_add_setting (connection, sws);
44c0da
+    			nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
44c0da
+    			valid = TRUE;
44c0da
+    		}
44c0da
+
44c0da
         }
44c0da
 
44c0da
         return valid;
44c0da
-- 
44c0da
2.35.1
44c0da