diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-08-21 14:39:11 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-08-26 11:05:10 +0200 |
commit | 41d7fd8a09e0e9acec033a66ecb588332653813e (patch) | |
tree | 86f3fd1e32454a7bfa13389349fdf32f68920efe | |
parent | efb0b54177ba6c9db56f62f090703bd70b6d2136 (diff) | |
download | network-manager-applet-bg/wifi-enable-adhoc-wpa2.tar.gz |
wifi: support ad-hoc WPA2 connectionsbg/wifi-enable-adhoc-wpa2
Now that NM supports ad-hoc WPA2 connections, enable them in the applet.
See https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/244
-rw-r--r-- | src/connection-editor/page-wifi-security.c | 6 | ||||
-rw-r--r-- | src/wireless-security/ws-wpa-psk.c | 14 |
2 files changed, 6 insertions, 14 deletions
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c index e53588c4..aaf67a65 100644 --- a/src/connection-editor/page-wifi-security.c +++ b/src/connection-editor/page-wifi-security.c @@ -401,7 +401,7 @@ finish_setup (CEPageWifiSecurity *self, gpointer user_data) ws_wpa_psk = ws_wpa_psk_new (connection, FALSE); if (ws_wpa_psk) { add_security_item (self, WIRELESS_SECURITY (ws_wpa_psk), sec_model, - &iter, _("WPA & WPA2 Personal"), FALSE, TRUE); + &iter, _("WPA & WPA2 Personal"), TRUE, TRUE); if ((active < 0) && ((default_type == NMU_SEC_WPA_PSK) || (default_type == NMU_SEC_WPA2_PSK))) active = item; item++; @@ -533,10 +533,6 @@ ce_page_validate_v (CEPage *page, NMConnection *connection, GError **error) s_wireless = nm_connection_get_setting_wireless (connection); g_assert (s_wireless); - /* Kernel Ad-Hoc WPA support is busted; it creates open networks. Disable - * WPA when Ad-Hoc is selected. set_sensitive() will pick up priv->mode - * and do the right thing. - */ mode = nm_setting_wireless_get_mode (s_wireless); if (g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_ADHOC) == 0) priv->mode = NM_802_11_MODE_ADHOC; diff --git a/src/wireless-security/ws-wpa-psk.c b/src/wireless-security/ws-wpa-psk.c index 1ea1791b..d5ed52c1 100644 --- a/src/wireless-security/ws-wpa-psk.c +++ b/src/wireless-security/ws-wpa-psk.c @@ -145,14 +145,10 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection) wireless_security_clear_ciphers (connection); if (is_adhoc) { /* Ad-Hoc settings as specified by the supplicant */ - g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-none", NULL); - nm_setting_wireless_security_add_proto (s_wireless_sec, "wpa"); - nm_setting_wireless_security_add_pairwise (s_wireless_sec, "none"); - - /* Ad-hoc can only have _one_ group cipher... default to TKIP to be more - * compatible for now. Maybe we'll support selecting CCMP later. - */ - nm_setting_wireless_security_add_group (s_wireless_sec, "tkip"); + g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", NULL); + nm_setting_wireless_security_add_proto (s_wireless_sec, "rsn"); + nm_setting_wireless_security_add_pairwise (s_wireless_sec, "ccmp"); + nm_setting_wireless_security_add_group (s_wireless_sec, "ccmp"); } else { g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", NULL); @@ -192,7 +188,7 @@ ws_wpa_psk_new (NMConnection *connection, gboolean secrets_only) if (!parent) return NULL; - parent->adhoc_compatible = FALSE; + parent->adhoc_compatible = TRUE; sec = (WirelessSecurityWPAPSK *) parent; sec->editing_connection = secrets_only ? FALSE : TRUE; sec->password_flags_name = NM_SETTING_WIRELESS_SECURITY_PSK; |