From 2997f8d68617b5d1979531284628c90bcfb4b031 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 24 Feb 2022 15:06:19 +0100 Subject: [PATCH] Work around libnma not handling OWE Resolves: #2058163 --- 0001-network-Fix-OWE-settings.patch | 59 +++++++++++++++++++++++++++++ gnome-control-center.spec | 9 ++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 0001-network-Fix-OWE-settings.patch diff --git a/0001-network-Fix-OWE-settings.patch b/0001-network-Fix-OWE-settings.patch new file mode 100644 index 0000000..0cd0505 --- /dev/null +++ b/0001-network-Fix-OWE-settings.patch @@ -0,0 +1,59 @@ +From 43bb1d9200554527cefaa2ce969bebc80d781c73 Mon Sep 17 00:00:00 2001 +From: Ana Cabral +Date: Mon, 21 Feb 2022 21:49:29 +0100 +Subject: [PATCH] network: Fix OWE settings + +Enhanced Open (OWE) is not being saved properly from connection-editor. +When we create a Wi-Fi connection using Enhanced Open (OWE) Security +from nm-connection-editor and save it, it was not being saved and the +security was being set as "None", with Wireless Security Setting +being discarded. This is fixed by this commit. The fix is also being +done in libnma (implementing OWE in libnma, +https://gitlab.gnome.org/GNOME/libnma/-/issues/9), but this commit +fixes meanwhile it gets ready. + +It was solved by adding treatment for the case in which owe was set. +OWE is not treated anymore in the same case as None. + +https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1521 +--- + .../connection-editor/ce-page-security.c | 23 +++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/panels/network/connection-editor/ce-page-security.c b/panels/network/connection-editor/ce-page-security.c +index a63b9394a..c7cd7d940 100644 +--- a/panels/network/connection-editor/ce-page-security.c ++++ b/panels/network/connection-editor/ce-page-security.c +@@ -460,10 +460,25 @@ ce_page_security_validate (CEPage *page, + } + } + } else { +- /* No security, unencrypted */ +- nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); +- nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X); +- valid = TRUE; ++ ++ if (gtk_combo_box_get_active ((CE_PAGE_SECURITY (self))->security_combo) == 0) { ++ /* No security, unencrypted */ ++ nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); ++ nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X); ++ valid = TRUE; ++ } else { ++ /* owe case: ++ * fill the connection manually until libnma implements OWE wireless security ++ */ ++ NMSetting *sws; ++ ++ sws = nm_setting_wireless_security_new (); ++ g_object_set (sws, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "owe", NULL); ++ nm_connection_add_setting (connection, sws); ++ nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X); ++ valid = TRUE; ++ } ++ + } + + return valid; +-- +2.35.1 + diff --git a/gnome-control-center.spec b/gnome-control-center.spec index 9fa70df..975b2f9 100644 --- a/gnome-control-center.spec +++ b/gnome-control-center.spec @@ -14,7 +14,7 @@ Name: gnome-control-center Version: 40.0 -Release: 21%{?dist} +Release: 22%{?dist} Summary: Utilities to configure the GNOME desktop License: GPLv2+ and CC-BY-SA @@ -38,6 +38,9 @@ Patch7: rpminspect-desktop-fixes.patch # Backport monitor config policy (#2046159) Patch8: 0001-display-Only-display-configuration-options-if-apply-.patch +# Workaround for libnma not handling OWE https://gitlab.gnome.org/GNOME/libnma/-/issues/9 +Patch9: 0001-network-Fix-OWE-settings.patch + BuildRequires: chrpath BuildRequires: cups-devel BuildRequires: desktop-file-utils @@ -226,6 +229,10 @@ chrpath --delete $RPM_BUILD_ROOT%{_bindir}/gnome-control-center %dir %{_datadir}/gnome/wm-properties %changelog +* Thu Feb 24 2022 Benjamin Berg - 40.0-22 +- Work around libnma not handling OWE + Resolves: #2058163 + * Fri Feb 04 2022 Jonas Ã…dahl - 40.0-21 - Backport monitor config policy Resolves: #2046159