Commit 9255dd08 authored by Beniamino Galvani's avatar Beniamino Galvani

wifi: support ad-hoc WPA2 connections

Now that NM supports ad-hoc WPA2 connections, enable them in the applet.

!58
parent 3d7fd849
......@@ -387,7 +387,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++;
......@@ -519,10 +519,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;
......
......@@ -131,14 +131,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);
......@@ -178,7 +174,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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment