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

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