~cyphermox/network-manager-applet/deep_water_horizon

« back to all changes in this revision

Viewing changes to debian/patches/applet_adhoc_use_wpa_rsn_part1.patch

  • Committer: Mathieu Trudel-Lapierre
  • Date: 2012-09-07 20:06:36 UTC
  • Revision ID: mathieu-tl@ubuntu.com-20120907200636-1mh12xplj1ateowu
debian/patches/applet_adhoc_use_wpa_rsn_part1.patch: enable the use of
WPA2/RSN for adhoc again, instead of WPA-None; to provide a way to get a
"good" encryption method available for adhoc networks. (LP: #1046918)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Nicolas Cavallari <cavallar@lri.fr>
 
2
Subject: [PATCH 3/3 applet] Allow to create and connect to Ad-Hoc RSN networks.
 
3
 
 
4
This follows changes to Network Manager, which now
 
5
supports WPA2/RSN in Ad-Hoc/IBSS mode.
 
6
---
 
7
 src/applet-dialogs.c                           |    2 --
 
8
 src/connection-editor/page-wireless-security.c |    9 ++-------
 
9
 src/libnm-gtk/nm-wireless-dialog.c             |    3 +--
 
10
 src/wireless-security/ws-wpa-psk.c             |   15 +++++++--------
 
11
 4 files changed, 10 insertions(+), 19 deletions(-)
 
12
 
 
13
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c
 
14
index b9ebc47..bb893af 100644
 
15
--- a/src/applet-dialogs.c
 
16
+++ b/src/applet-dialogs.c
 
17
@@ -241,8 +241,6 @@ create_info_label_security (NMConnection *connection)
 
18
 
 
19
                        if (!strcmp (key_mgmt, "none"))
 
20
                                label = g_strdup (_("WEP"));
 
21
-                       else if (!strcmp (key_mgmt, "wpa-none"))
 
22
-                               label = g_strdup (_("WPA/WPA2"));
 
23
                        else if (!strcmp (key_mgmt, "wpa-psk"))
 
24
                                label = g_strdup (_("WPA/WPA2"));
 
25
                        else
 
26
diff --git a/src/connection-editor/page-wireless-security.c b/src/connection-editor/page-wireless-security.c
 
27
index 09a6744..855f783 100644
 
28
--- a/src/connection-editor/page-wireless-security.c
 
29
+++ b/src/connection-editor/page-wireless-security.c
 
30
@@ -79,8 +79,7 @@ get_default_type_for_security (NMSettingWirelessSecurity *sec)
 
31
                return NMU_SEC_DYNAMIC_WEP;
 
32
        }
 
33
 
 
34
-       if (   !strcmp (key_mgmt, "wpa-none")
 
35
-           || !strcmp (key_mgmt, "wpa-psk")) {
 
36
+       if (!strcmp (key_mgmt, "wpa-psk")) {
 
37
                if (find_proto (sec, "rsn"))
 
38
                        return NMU_SEC_WPA2_PSK;
 
39
                else if (find_proto (sec, "wpa"))
 
40
@@ -337,7 +336,7 @@ finish_setup (CEPageWirelessSecurity *self, gpointer unused, GError *error, gpoi
 
41
                ws_wpa_psk = ws_wpa_psk_new (connection, FALSE);
 
42
                if (ws_wpa_psk) {
 
43
                        add_security_item (self, WIRELESS_SECURITY (ws_wpa_psk), sec_model,
 
44
-                                          &iter, _("WPA & WPA2 Personal"), FALSE);
 
45
+                                          &iter, _("WPA & WPA2 Personal"), TRUE);
 
46
                        if ((active < 0) && ((default_type == NMU_SEC_WPA_PSK) || (default_type == NMU_SEC_WPA2_PSK)))
 
47
                                active = item;
 
48
                        item++;
 
49
@@ -472,10 +471,6 @@ validate (CEPage *page, NMConnection *connection, GError **error)
 
50
        s_wireless = nm_connection_get_setting_wireless (connection);
 
51
        g_assert (s_wireless);
 
52
 
 
53
-       /* Kernel Ad-Hoc WPA support is busted; it creates open networks.  Disable
 
54
-        * WPA when Ad-Hoc is selected.  set_sensitive() will pick up self->adhoc
 
55
-        * and do the right thing.
 
56
-        */
 
57
        mode = nm_setting_wireless_get_mode (s_wireless);
 
58
        if (g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_ADHOC) == 0)
 
59
                self->adhoc = TRUE;
 
60
diff --git a/src/libnm-gtk/nm-wireless-dialog.c b/src/libnm-gtk/nm-wireless-dialog.c
 
61
index 885a1c6..ec7c7e2 100644
 
62
--- a/src/libnm-gtk/nm-wireless-dialog.c
 
63
+++ b/src/libnm-gtk/nm-wireless-dialog.c
 
64
@@ -692,8 +692,7 @@ get_default_type_for_security (NMSettingWirelessSecurity *sec,
 
65
                return NMU_SEC_DYNAMIC_WEP;
 
66
        }
 
67
 
 
68
-       if (   !strcmp (key_mgmt, "wpa-none")
 
69
-           || !strcmp (key_mgmt, "wpa-psk")) {
 
70
+       if (!strcmp (key_mgmt, "wpa-psk")) {
 
71
                if (!have_ap || (ap_flags & NM_802_11_AP_FLAGS_PRIVACY)) {
 
72
                        if (find_proto (sec, "rsn"))
 
73
                                return NMU_SEC_WPA2_PSK;
 
74
diff --git a/src/wireless-security/ws-wpa-psk.c b/src/wireless-security/ws-wpa-psk.c
 
75
index ceb89e1..02be4ad 100644
 
76
--- a/src/wireless-security/ws-wpa-psk.c
 
77
+++ b/src/wireless-security/ws-wpa-psk.c
 
78
@@ -117,14 +117,13 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
 
79
        wireless_security_clear_ciphers (connection);
 
80
        if (is_adhoc) {
 
81
                /* Ad-Hoc settings as specified by the supplicant */
 
82
-               g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-none", NULL);
 
83
-               nm_setting_wireless_security_add_proto (s_wireless_sec, "wpa");
 
84
-               nm_setting_wireless_security_add_pairwise (s_wireless_sec, "none");
 
85
+               g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", NULL);
 
86
+               nm_setting_wireless_security_add_proto (s_wireless_sec, "rsn");
 
87
 
 
88
-               /* Ad-hoc can only have _one_ group cipher... default to TKIP to be more
 
89
-                * compatible for now.  Maybe we'll support selecting CCMP later.
 
90
-                */
 
91
-               nm_setting_wireless_security_add_group (s_wireless_sec, "tkip");
 
92
+               /* The supplicant only supports CCMP with Ad-hoc RSN;
 
93
+                * Selecting something else will make it use CCMP anyway. */
 
94
+               nm_setting_wireless_security_add_pairwise (s_wireless_sec, "ccmp");
 
95
+               nm_setting_wireless_security_add_group (s_wireless_sec, "ccmp");
 
96
        } else {
 
97
                g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", NULL);
 
98
 
 
99
@@ -163,7 +162,7 @@ ws_wpa_psk_new (NMConnection *connection, gboolean secrets_only)
 
100
        if (!parent)
 
101
                return NULL;
 
102
 
 
103
-       parent->adhoc_compatible = FALSE;
 
104
+       parent->adhoc_compatible = TRUE;
 
105
        sec = (WirelessSecurityWPAPSK *) parent;
 
106
 
 
107
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wpa_psk_entry"));
 
108
-- 
 
109
1.7.10.4
 
110
 
 
111
_______________________________________________
 
112
networkmanager-list mailing list
 
113
networkmanager-list@gnome.org
 
114
https://mail.gnome.org/mailman/listinfo/networkmanager-list