network-manager-applet r958 - in trunk: . src/wireless-security



Author: dcbw
Date: Mon Oct 20 21:47:00 2008
New Revision: 958
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=958&view=rev

Log:
2008-10-20  Dan Williams  <dcbw redhat com>

	* src/wireless-security/wireless-security.c
	  src/wireless-security/wireless-security.h
		- (ws_wpa_fill_default_ciphers): remove; the supplicant is smart enough
			to figure out the intersection of the card's capabilities and the
			AP's capabilities
		- (wireless_security_clear_ciphers): new function

	* src/wireless-security/ws-wpa-psk.c
		- (fill_connection): unbreak WPA adhoc connections by actually writing
			a valid config (rh #461197)

	* src/wireless-security/ws-wpa-eap.c
		- (fill_connection): don't call ws_wpa_fill_default_ciphers(), un-needed



Modified:
   trunk/ChangeLog
   trunk/src/wireless-security/wireless-security.c
   trunk/src/wireless-security/wireless-security.h
   trunk/src/wireless-security/ws-wpa-eap.c
   trunk/src/wireless-security/ws-wpa-psk.c

Modified: trunk/src/wireless-security/wireless-security.c
==============================================================================
--- trunk/src/wireless-security/wireless-security.c	(original)
+++ trunk/src/wireless-security/wireless-security.c	Mon Oct 20 21:47:00 2008
@@ -163,7 +163,7 @@
 }
 
 void
-ws_wpa_fill_default_ciphers (NMConnection *connection)
+wireless_security_clear_ciphers (NMConnection *connection)
 {
 	NMSettingWirelessSecurity *s_wireless_sec;
 
@@ -173,25 +173,20 @@
 										  NM_TYPE_SETTING_WIRELESS_SECURITY));
 	g_assert (s_wireless_sec);
 
-	// FIXME: allow protocol selection and filter on device capabilities
+	/* Protocol */
 	g_slist_foreach (s_wireless_sec->proto, (GFunc) g_free, NULL);
 	g_slist_free (s_wireless_sec->proto);
-	s_wireless_sec->proto = g_slist_append (NULL, g_strdup ("wpa"));
-	s_wireless_sec->proto = g_slist_append (s_wireless_sec->proto, g_strdup ("rsn"));
+	s_wireless_sec->proto = NULL;
 
-	// FIXME: allow pairwise cipher selection and filter on device capabilities
+	/* Pairwise cipher */
 	g_slist_foreach (s_wireless_sec->pairwise, (GFunc) g_free, NULL);
 	g_slist_free (s_wireless_sec->pairwise);
-	s_wireless_sec->pairwise = g_slist_append (NULL, g_strdup ("tkip"));
-	s_wireless_sec->pairwise = g_slist_append (s_wireless_sec->pairwise, g_strdup ("ccmp"));
+	s_wireless_sec->pairwise = NULL;
 
-	// FIXME: allow group cipher selection and filter on device capabilities
+	/* Group cipher */
 	g_slist_foreach (s_wireless_sec->group, (GFunc) g_free, NULL);
 	g_slist_free (s_wireless_sec->group);
-	s_wireless_sec->group = g_slist_append (NULL, g_strdup ("wep40"));
-	s_wireless_sec->group = g_slist_append (s_wireless_sec->group, g_strdup ("wep104"));
-	s_wireless_sec->group = g_slist_append (s_wireless_sec->group, g_strdup ("tkip"));
-	s_wireless_sec->group = g_slist_append (s_wireless_sec->group, g_strdup ("ccmp"));
+	s_wireless_sec->group = NULL;
 }
 
 void

Modified: trunk/src/wireless-security/wireless-security.h
==============================================================================
--- trunk/src/wireless-security/wireless-security.h	(original)
+++ trunk/src/wireless-security/wireless-security.h	Mon Oct 20 21:47:00 2008
@@ -97,7 +97,7 @@
 
 void wireless_security_changed_cb (GtkWidget *entry, gpointer user_data);
 
-void ws_wpa_fill_default_ciphers (NMConnection *connection);
+void wireless_security_clear_ciphers (NMConnection *connection);
 
 #define AUTH_NAME_COLUMN   0
 #define AUTH_METHOD_COLUMN 1

Modified: trunk/src/wireless-security/ws-wpa-eap.c
==============================================================================
--- trunk/src/wireless-security/ws-wpa-eap.c	(original)
+++ trunk/src/wireless-security/ws-wpa-eap.c	Mon Oct 20 21:47:00 2008
@@ -71,7 +71,6 @@
 	g_assert (s_wireless_sec);
 
 	s_wireless_sec->key_mgmt = g_strdup ("wpa-eap");
-	ws_wpa_fill_default_ciphers (connection);
 }
 
 static void

Modified: trunk/src/wireless-security/ws-wpa-psk.c
==============================================================================
--- trunk/src/wireless-security/ws-wpa-psk.c	(original)
+++ trunk/src/wireless-security/ws-wpa-psk.c	Mon Oct 20 21:47:00 2008
@@ -135,16 +135,26 @@
 		g_free (buf);
 	}
 
+	wireless_security_clear_ciphers (connection);
+
 	s_wireless_sec->psk = hashed;
-	if (is_adhoc)
+	if (is_adhoc) {
+		/* Ad-Hoc settings as specified by the supplicant */
 		s_wireless_sec->key_mgmt = g_strdup ("wpa-none");
-	else
+		s_wireless_sec->proto = g_slist_append (NULL, g_strdup ("wpa"));
+		s_wireless_sec->pairwise = g_slist_append (NULL, g_strdup ("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.
+		 */
+		s_wireless_sec->group = g_slist_append (NULL, g_strdup ("tkip"));
+	} else {
 		s_wireless_sec->key_mgmt = g_strdup ("wpa-psk");
 
-	// FIXME: allow protocol selection and filter on device capabilities
-	// FIXME: allow pairwise cipher selection and filter on device capabilities
-	// FIXME: allow group cipher selection and filter on device capabilities
-	ws_wpa_fill_default_ciphers (connection);
+		/* Just leave ciphers and protocol empty, the supplicant will
+		 * figure that out magically based on the AP IEs and card capabilities.
+		 */
+	}
 }
 
 WirelessSecurityWPAPSK *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]