From cc529478dc9796d3a1879cfa7208b25e8d17df60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Poho=C5=99elsk=C3=BD?= Date: Tue, 7 Nov 2023 15:19:48 +0100 Subject: [PATCH] network: remove `wpa-none` from `key_mgmt` Network Manager dropped `wpa-none` value from `key_mgmt` a while ago[0] There is no need to test for this option anymore. [0]https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/c97e0ce30b8b9b118d47d0e02e6ebe7556e9f0c4 --- panels/network/cc-qr-code.c | 9 ++------- panels/network/connection-editor/ce-page-security.c | 3 +-- panels/network/net-device-wifi.c | 6 ++---- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/panels/network/cc-qr-code.c b/panels/network/cc-qr-code.c index 4a272c64f..c611e9ccb 100644 --- a/panels/network/cc-qr-code.c +++ b/panels/network/cc-qr-code.c @@ -233,8 +233,7 @@ get_connection_security_type (NMConnection *c) if (g_strcmp0 (key_mgmt, "none") == 0) return "WEP"; - if (g_strcmp0 (key_mgmt, "wpa-none") == 0 || - g_strcmp0 (key_mgmt, "wpa-psk") == 0) + if (g_strcmp0 (key_mgmt, "wpa-psk") == 0) return "WPA"; return "nopass"; @@ -255,11 +254,7 @@ is_qr_code_supported (NMConnection *c) key_mgmt = nm_setting_wireless_security_get_key_mgmt (setting); - /* No IEEE 802.1x */ - if (g_str_equal (key_mgmt, "none")) - return TRUE; - - if (g_str_equal (key_mgmt, "wpa-none") || + if (g_str_equal (key_mgmt, "none") || g_str_equal (key_mgmt, "wpa-psk")) return TRUE; diff --git a/panels/network/connection-editor/ce-page-security.c b/panels/network/connection-editor/ce-page-security.c index ae6fbd45c..04d5b9da2 100644 --- a/panels/network/connection-editor/ce-page-security.c +++ b/panels/network/connection-editor/ce-page-security.c @@ -98,8 +98,7 @@ get_default_type_for_security (NMSettingWirelessSecurity *sec) } #endif - if ( !strcmp (key_mgmt, "wpa-none") - || !strcmp (key_mgmt, "wpa-psk")) { + if ( !strcmp (key_mgmt, "wpa-psk")) { if (find_proto (sec, "rsn")) return NMU_SEC_WPA2_PSK; else if (find_proto (sec, "wpa")) diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c index 74781cde2..c4792e194 100644 --- a/panels/network/net-device-wifi.c +++ b/panels/network/net-device-wifi.c @@ -222,8 +222,7 @@ device_get_hotspot_security_details (NetDeviceWifi *self, tmp_security = C_("Wifi security", "None"); /* Key management values: - * "none" = WEP - * "wpa-none" = WPAv1 Ad-Hoc mode (not supported in NM >= 0.9.4) + * "none" = WEP or no password protection * "wpa-psk" = WPAv2 Ad-Hoc mode (eg IBSS RSN) and AP-mode WPA v1 and v2 */ key_mgmt = nm_setting_wireless_security_get_key_mgmt (sws); @@ -231,8 +230,7 @@ device_get_hotspot_security_details (NetDeviceWifi *self, tmp_secret = nm_setting_wireless_security_get_wep_key (sws, 0); tmp_security = _("WEP"); } - else if (strcmp (key_mgmt, "wpa-none") == 0 || - strcmp (key_mgmt, "wpa-psk") == 0) { + else if (strcmp (key_mgmt, "wpa-psk") == 0) { tmp_secret = nm_setting_wireless_security_get_psk (sws); tmp_security = _("WPA"); } else {