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

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