network-manager-applet r993 - in trunk: . src src/gconf-helpers src/utils src/wireless-security



Author: dcbw
Date: Thu Oct 30 18:13:52 2008
New Revision: 993
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=993&view=rev

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

	* src/applet-device-wifi.c
	  src/applet-dialogs.c
	  src/gconf-helpers/gconf-helpers.c
	  src/gconf-helpers/gconf-upgrade.c
	  src/utils/utils.c
	  src/wireless-security/eap-method-leap.c
	  src/wireless-security/eap-method-peap.c
	  src/wireless-security/eap-method-simple.c
	  src/wireless-security/eap-method-tls.c
	  src/wireless-security/eap-method-ttls.c
	  src/wireless-security/eap-method.c
	  src/wireless-security/wireless-security.c
		- Use 802.1x setting accessors



Modified:
   trunk/ChangeLog
   trunk/src/applet-device-wifi.c
   trunk/src/applet-dialogs.c
   trunk/src/gconf-helpers/gconf-helpers.c
   trunk/src/gconf-helpers/gconf-upgrade.c
   trunk/src/utils/utils.c
   trunk/src/wireless-security/eap-method-leap.c
   trunk/src/wireless-security/eap-method-peap.c
   trunk/src/wireless-security/eap-method-simple.c
   trunk/src/wireless-security/eap-method-tls.c
   trunk/src/wireless-security/eap-method-ttls.c
   trunk/src/wireless-security/eap-method.c
   trunk/src/wireless-security/wireless-security.c

Modified: trunk/src/applet-device-wifi.c
==============================================================================
--- trunk/src/applet-device-wifi.c	(original)
+++ trunk/src/applet-device-wifi.c	Thu Oct 30 18:13:52 2008
@@ -287,8 +287,8 @@
 		add_ciphers_from_flags (sec, rsn_flags, FALSE);
 
 		*s_8021x = NM_SETTING_802_1X (nm_setting_802_1x_new ());
-		(*s_8021x)->eap = g_slist_append ((*s_8021x)->eap, g_strdup ("ttls"));
-		(*s_8021x)->phase2_auth = g_strdup ("mschapv2");
+		nm_setting_802_1x_add_eap_method (*s_8021x, "ttls");
+		g_object_set (*s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "mschapv2", NULL);
 		return sec;
 	}
 
@@ -301,8 +301,8 @@
 		add_ciphers_from_flags (sec, wpa_flags, FALSE);
 
 		*s_8021x = NM_SETTING_802_1X (nm_setting_802_1x_new ());
-		(*s_8021x)->eap = g_slist_append ((*s_8021x)->eap, g_strdup ("ttls"));
-		(*s_8021x)->phase2_auth = g_strdup ("mschapv2");
+		nm_setting_802_1x_add_eap_method (*s_8021x, "ttls");
+		g_object_set (*s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "mschapv2", NULL);
 		return sec;
 	}
 

Modified: trunk/src/applet-dialogs.c
==============================================================================
--- trunk/src/applet-dialogs.c	(original)
+++ trunk/src/applet-dialogs.c	Thu Oct 30 18:13:52 2008
@@ -94,16 +94,16 @@
 	if (!s_8021x)
 		goto out;
 
-	if (s_8021x->eap && s_8021x->eap->data) {
-		char *eap_str = g_ascii_strup (s_8021x->eap->data, -1);
+	if (nm_setting_802_1x_get_num_eap_methods (s_8021x)) {
+		char *eap_str = g_ascii_strup (nm_setting_802_1x_get_eap_method (s_8021x, 0), -1);
 		g_string_append_printf (str, ", EAP-%s", eap_str);
 		g_free (eap_str);
 	}
 
-	if (s_8021x->phase2_auth)
-		phase2_str = g_ascii_strup (s_8021x->phase2_auth, -1);
-	else if (s_8021x->phase2_autheap)
-		phase2_str = g_ascii_strup (s_8021x->phase2_autheap, -1);
+	if (nm_setting_802_1x_get_phase2_auth (s_8021x))
+		phase2_str = g_ascii_strup (nm_setting_802_1x_get_phase2_auth (s_8021x), -1);
+	else if (nm_setting_802_1x_get_phase2_autheap (s_8021x))
+		phase2_str = g_ascii_strup (nm_setting_802_1x_get_phase2_autheap (s_8021x), -1);
 
 	if (phase2_str) {
 		g_string_append (str, ", ");

Modified: trunk/src/gconf-helpers/gconf-helpers.c
==============================================================================
--- trunk/src/gconf-helpers/gconf-helpers.c	(original)
+++ trunk/src/gconf-helpers/gconf-helpers.c	Thu Oct 30 18:13:52 2008
@@ -1498,8 +1498,10 @@
 	 */
 	s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (info->connection, NM_TYPE_SETTING_802_1X));
 	if (s_8021x) {
-		write_ignore_ca_cert_helper (info, NMA_CA_CERT_IGNORE_TAG, s_8021x->ca_cert);
-		write_ignore_ca_cert_helper (info, NMA_PHASE2_CA_CERT_IGNORE_TAG, s_8021x->phase2_ca_cert);
+		write_ignore_ca_cert_helper (info, NMA_CA_CERT_IGNORE_TAG,
+		                             nm_setting_802_1x_get_ca_cert (s_8021x));
+		write_ignore_ca_cert_helper (info, NMA_PHASE2_CA_CERT_IGNORE_TAG,
+		                             nm_setting_802_1x_get_phase2_ca_cert (s_8021x));
 
 		/* Binary certificate and key data doesn't get stored in GConf.  Instead,
 		 * the path to the certificate gets stored in a special key and the
@@ -1646,14 +1648,15 @@
 
 	if (filename) {
 		NMSetting8021x *setting;
+		const GByteArray *tmp;
 
 		setting = (NMSetting8021x *) nm_setting_802_1x_new ();
-		nm_setting_802_1x_set_private_key (setting, filename, password, error);
+		nm_setting_802_1x_set_private_key_from_file (setting, filename, password, error);
 
 		/* Steal the private key */
-		array = setting->private_key;
-		setting->private_key = NULL;
-
+		tmp = nm_setting_802_1x_get_private_key (setting);
+		array = g_byte_array_sized_new (tmp->len);
+		memcpy (array->data, tmp->data, tmp->len);
 		g_object_unref (setting);
 	}
 

Modified: trunk/src/gconf-helpers/gconf-upgrade.c
==============================================================================
--- trunk/src/gconf-helpers/gconf-upgrade.c	(original)
+++ trunk/src/gconf-helpers/gconf-upgrade.c	Thu Oct 30 18:13:52 2008
@@ -250,53 +250,54 @@
                                 const char *network,
                                 NMSetting8021x **s_8021x)
 {
-	NMSettingWirelessSecurity *s_wireless_sec;
+	NMSettingWirelessSecurity *wsec = NULL;
 	GSList *eap = NULL, *key_type = NULL, *proto = NULL, *iter;
 	char *phase2_type = NULL, *identity = NULL, *anon_identity = NULL;
 
 	if (!get_bitfield_helper (client, path, "wpa_eap_eap_method", network, eap_methods, &eap))
-		goto fail;
+		goto out;
 	if (!get_bitfield_helper (client, path, "wpa_eap_key_type", network, eap_key_types, &key_type))
-		goto fail;
+		goto out;
 	if (!get_enum_helper (client, path, "wpa_eap_phase2_type", network, eap_phase2_types, &phase2_type))
-		goto fail;
+		goto out;
 	if (!get_bitfield_helper (client, path, "wpa_eap_wpa_version", network, wpa_versions, &proto))
-		goto fail;
+		goto out;
 
 	if (!get_mandatory_string_helper (client, path, "wpa_eap_identity", network, &identity))
-		goto fail;
+		goto out;
 	nm_gconf_get_string_helper (client, path, "wpa_eap_anon_identity", network, &anon_identity);
 
-	s_wireless_sec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
+	wsec = NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ());
 	/* AFAICT, 0.6 reads this value from gconf, and then ignores it and always uses IW_AUTH_KEY_MGMT_802_1X */
-	g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", NULL);  /* FIXME: wpa-eap? */
+	g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", NULL);  /* FIXME: wpa-eap? */
 
 	for (iter = proto; iter; iter = g_slist_next (iter))
-		nm_setting_wireless_security_add_proto (s_wireless_sec, (const char *) iter->data);
+		nm_setting_wireless_security_add_proto (wsec, (const char *) iter->data);
 	nm_utils_slist_free (proto, g_free);
 
 	/* FIXME: what's the right mapping here? */
 	for (iter = key_type; iter; iter = g_slist_next (iter))
-		nm_setting_wireless_security_add_group (s_wireless_sec, (const char *) iter->data);
+		nm_setting_wireless_security_add_group (wsec, (const char *) iter->data);
 	nm_utils_slist_free (key_type, g_free);
 
-	*s_8021x = (NMSetting8021x *) nm_setting_802_1x_new ();
-	(*s_8021x)->eap = eap;
-	(*s_8021x)->phase2_auth = phase2_type; /* FIXME? phase2_autheap? */
-	(*s_8021x)->identity = identity;
-	(*s_8021x)->anonymous_identity = anon_identity;
+	*s_8021x = NM_SETTING_802_1X (nm_setting_802_1x_new ());
+	g_object_set (s_8021x,
+	              NM_SETTING_802_1X_PHASE2_AUTH, phase2_type,
+	              NM_SETTING_802_1X_IDENTITY, identity,
+	              NM_SETTING_802_1X_ANONYMOUS_IDENTITY, anon_identity,
+	              NULL);
 
-	return s_wireless_sec;
+	for (iter = eap; iter; iter = g_slist_next (iter))
+		nm_setting_802_1x_add_eap_method (*s_8021x, (const char *) iter->data);
 
-fail:
+out:
 	nm_utils_slist_free (proto, g_free);
 	nm_utils_slist_free (eap, g_free);
 	nm_utils_slist_free (key_type, g_free);
 	g_free (phase2_type);
 	g_free (identity);
 	g_free (anon_identity);
-
-	return NULL;
+	return wsec;
 }
 
 static NMSettingWirelessSecurity *

Modified: trunk/src/utils/utils.c
==============================================================================
--- trunk/src/utils/utils.c	(original)
+++ trunk/src/utils/utils.c	Thu Oct 30 18:13:52 2008
@@ -214,17 +214,6 @@
 	return description;
 }
 
-static void
-clear_one_byte_array_field (GByteArray **field)
-{
-	g_return_if_fail (field != NULL);
-
-	if (!*field)
-		return;
-	g_byte_array_free (*field, TRUE);
-	*field = NULL;
-}
-
 void
 utils_fill_connection_certs (NMConnection *connection)
 {
@@ -239,19 +228,19 @@
 
 	filename = g_object_get_data (G_OBJECT (connection), NMA_PATH_CA_CERT_TAG);
 	if (filename)
-		nm_setting_802_1x_set_ca_cert (s_8021x, filename, NULL);
+		nm_setting_802_1x_set_ca_cert_from_file (s_8021x, filename, NULL);
 
 	filename = g_object_get_data (G_OBJECT (connection), NMA_PATH_CLIENT_CERT_TAG);
 	if (filename)
-		nm_setting_802_1x_set_client_cert (s_8021x, filename, NULL);
+		nm_setting_802_1x_set_client_cert_from_file (s_8021x, filename, NULL);
 
 	filename = g_object_get_data (G_OBJECT (connection), NMA_PATH_PHASE2_CA_CERT_TAG);
 	if (filename)
-		nm_setting_802_1x_set_phase2_ca_cert (s_8021x, filename, NULL);
+		nm_setting_802_1x_set_phase2_ca_cert_from_file (s_8021x, filename, NULL);
 
 	filename = g_object_get_data (G_OBJECT (connection), NMA_PATH_PHASE2_CLIENT_CERT_TAG);
 	if (filename)
-		nm_setting_802_1x_set_phase2_client_cert (s_8021x, filename, NULL);
+		nm_setting_802_1x_set_phase2_client_cert_from_file (s_8021x, filename, NULL);
 }
 
 void
@@ -265,12 +254,14 @@
 	if (!s_8021x)
 		return;
 
-	clear_one_byte_array_field (&s_8021x->ca_cert);
-	clear_one_byte_array_field (&s_8021x->client_cert);
-	clear_one_byte_array_field (&s_8021x->private_key);
-	clear_one_byte_array_field (&s_8021x->phase2_ca_cert);
-	clear_one_byte_array_field (&s_8021x->phase2_client_cert);
-	clear_one_byte_array_field (&s_8021x->phase2_private_key);
+	g_object_set (s_8021x,
+	              NM_SETTING_802_1X_CA_CERT, NULL,
+	              NM_SETTING_802_1X_CLIENT_CERT, NULL,
+	              NM_SETTING_802_1X_PRIVATE_KEY, NULL,
+	              NM_SETTING_802_1X_PHASE2_CA_CERT, NULL,
+	              NM_SETTING_802_1X_PHASE2_CLIENT_CERT, NULL,
+	              NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, NULL,
+	              NULL);
 }
 
 

Modified: trunk/src/wireless-security/eap-method-leap.c
==============================================================================
--- trunk/src/wireless-security/eap-method-leap.c	(original)
+++ trunk/src/wireless-security/eap-method-leap.c	Thu Oct 30 18:13:52 2008
@@ -93,15 +93,15 @@
 	s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X));
 	g_assert (s_8021x);
 
-	s_8021x->eap = g_slist_append (s_8021x->eap, g_strdup ("leap"));
+	nm_setting_802_1x_add_eap_method (s_8021x, "leap");
 
 	widget = glade_xml_get_widget (parent->xml, "eap_leap_username_entry");
 	g_assert (widget);
-	s_8021x->identity = g_strdup (gtk_entry_get_text (GTK_ENTRY (widget)));
+	g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, gtk_entry_get_text (GTK_ENTRY (widget)), NULL);
 
 	widget = glade_xml_get_widget (parent->xml, "eap_leap_password_entry");
 	g_assert (widget);
-	s_8021x->password = g_strdup (gtk_entry_get_text (GTK_ENTRY (widget)));
+	g_object_set (s_8021x, NM_SETTING_802_1X_PASSWORD, gtk_entry_get_text (GTK_ENTRY (widget)), NULL);
 }
 
 EAPMethodLEAP *
@@ -149,8 +149,8 @@
 		NMSetting8021x *s_8021x;
 
 		s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X));
-		if (s_8021x && s_8021x->identity)
-			gtk_entry_set_text (GTK_ENTRY (widget), s_8021x->identity);
+		if (s_8021x && nm_setting_802_1x_get_identity (s_8021x))
+			gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_identity (s_8021x));
 	}
 
 	widget = glade_xml_get_widget (xml, "eap_leap_password_entry");

Modified: trunk/src/wireless-security/eap-method-peap.c
==============================================================================
--- trunk/src/wireless-security/eap-method-peap.c	(original)
+++ trunk/src/wireless-security/eap-method-peap.c	Thu Oct 30 18:13:52 2008
@@ -124,13 +124,13 @@
 	s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X));
 	g_assert (s_8021x);
 
-	s_8021x->eap = g_slist_append (s_8021x->eap, g_strdup ("peap"));
+	nm_setting_802_1x_add_eap_method (s_8021x, "peap");
 
 	widget = glade_xml_get_widget (parent->xml, "eap_peap_anon_identity_entry");
 	g_assert (widget);
 	text = gtk_entry_get_text (GTK_ENTRY (widget));
 	if (text && strlen (text))
-		s_8021x->anonymous_identity = g_strdup (text);
+		g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, text, NULL);
 
 	widget = glade_xml_get_widget (parent->xml, "eap_peap_ca_cert_button");
 	g_assert (widget);
@@ -409,7 +409,10 @@
 	widget = glade_xml_get_widget (xml, "eap_peap_version_combo");
 	g_assert (widget);
 	if (s_8021x) {
-		if (s_8021x->phase1_peapver && !strcmp (s_8021x->phase1_peapver, "0"))
+		const char *peapver;
+
+		peapver = nm_setting_802_1x_get_phase1_peapver (s_8021x);
+		if (peapver && !strcmp (peapver, "0"))
 			gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
 		else
 			gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 1);
@@ -420,8 +423,8 @@
 	                  parent);
 
 	widget = glade_xml_get_widget (xml, "eap_peap_anon_identity_entry");
-	if (s_8021x && s_8021x->anonymous_identity)
-		gtk_entry_set_text (GTK_ENTRY (widget), s_8021x->anonymous_identity);
+	if (s_8021x && nm_setting_802_1x_get_anonymous_identity (s_8021x))
+		gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_anonymous_identity (s_8021x));
 	g_signal_connect (G_OBJECT (widget), "changed",
 	                  (GCallback) wireless_security_changed_cb,
 	                  parent);

Modified: trunk/src/wireless-security/eap-method-simple.c
==============================================================================
--- trunk/src/wireless-security/eap-method-simple.c	(original)
+++ trunk/src/wireless-security/eap-method-simple.c	Thu Oct 30 18:13:52 2008
@@ -96,19 +96,19 @@
 
 	switch (method->type) {
 		case EAP_METHOD_SIMPLE_TYPE_PAP:
-			s_8021x->phase2_auth = g_strdup ("pap");
+			g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "pap", NULL);
 			break;
 		case EAP_METHOD_SIMPLE_TYPE_MSCHAP:
-			s_8021x->phase2_auth = g_strdup ("mschap");
+			g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "mschap", NULL);
 			break;
 		case EAP_METHOD_SIMPLE_TYPE_MSCHAP_V2:
-			s_8021x->phase2_auth = g_strdup ("mschapv2");
+			g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "mschapv2", NULL);
 			break;
 		case EAP_METHOD_SIMPLE_TYPE_MD5:
-			s_8021x->phase2_auth = g_strdup ("md5");
+			g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "md5", NULL);
 			break;
 		case EAP_METHOD_SIMPLE_TYPE_CHAP:
-			s_8021x->phase2_auth = g_strdup ("chap");
+			g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "chap", NULL);
 			break;
 		default:
 			g_assert_not_reached ();
@@ -117,11 +117,11 @@
 
 	widget = glade_xml_get_widget (parent->xml, "eap_simple_username_entry");
 	g_assert (widget);
-	s_8021x->identity = g_strdup (gtk_entry_get_text (GTK_ENTRY (widget)));
+	g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, gtk_entry_get_text (GTK_ENTRY (widget)), NULL);
 
 	widget = glade_xml_get_widget (parent->xml, "eap_simple_password_entry");
 	g_assert (widget);
-	s_8021x->password = g_strdup (gtk_entry_get_text (GTK_ENTRY (widget)));
+	g_object_set (s_8021x, NM_SETTING_802_1X_PASSWORD, gtk_entry_get_text (GTK_ENTRY (widget)), NULL);
 }
 
 EAPMethodSimple *
@@ -172,8 +172,8 @@
 		NMSetting8021x *s_8021x;
 
 		s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X));
-		if (s_8021x && s_8021x->identity)
-			gtk_entry_set_text (GTK_ENTRY (widget), s_8021x->identity);
+		if (s_8021x && nm_setting_802_1x_get_identity (s_8021x))
+			gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_identity (s_8021x));
 	}
 
 	widget = glade_xml_get_widget (xml, "eap_simple_password_entry");

Modified: trunk/src/wireless-security/eap-method-tls.c
==============================================================================
--- trunk/src/wireless-security/eap-method-tls.c	(original)
+++ trunk/src/wireless-security/eap-method-tls.c	Thu Oct 30 18:13:52 2008
@@ -139,13 +139,13 @@
 	g_assert (s_8021x);
 
 	if (method->phase2)
-		s_8021x->phase2_auth = g_strdup ("tls");
+		g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "tls", NULL);
 	else
-		s_8021x->eap = g_slist_append (s_8021x->eap, g_strdup ("tls"));
+		nm_setting_802_1x_add_eap_method (s_8021x, "tls");
 
 	widget = glade_xml_get_widget (parent->xml, "eap_tls_identity_entry");
 	g_assert (widget);
-	s_8021x->identity = g_strdup (gtk_entry_get_text (GTK_ENTRY (widget)));
+	g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, gtk_entry_get_text (GTK_ENTRY (widget)), NULL);
 
 	widget = glade_xml_get_widget (parent->xml, "eap_tls_user_cert_button");
 	g_assert (widget);
@@ -196,13 +196,13 @@
 	                        g_strdup (filename),
 	                        (GDestroyNotify) g_free);
 	if (method->phase2) {
-		nm_setting_802_1x_set_phase2_private_key (s_8021x, filename, password, &error);
+		nm_setting_802_1x_set_phase2_private_key_from_file (s_8021x, filename, password, &error);
 		if (error) {
 			g_warning ("Couldn't read phase2 private key: %s", error->message);
 			g_clear_error (&error);
 		}
 	} else {
-		nm_setting_802_1x_set_private_key (s_8021x, filename, password, &error);
+		nm_setting_802_1x_set_private_key_from_file (s_8021x, filename, password, &error);
 		if (error) {
 			g_warning ("Couldn't read private key: %s", error->message);
 			g_clear_error (&error);
@@ -391,8 +391,8 @@
 	g_signal_connect (G_OBJECT (widget), "changed",
 	                  (GCallback) wireless_security_changed_cb,
 	                  parent);
-	if (s_8021x && s_8021x->identity)
-		gtk_entry_set_text (GTK_ENTRY (widget), s_8021x->identity);
+	if (s_8021x && nm_setting_802_1x_get_identity (s_8021x))
+		gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_identity (s_8021x));
 
 	widget = glade_xml_get_widget (xml, "eap_tls_private_key_password_entry");
 	g_assert (widget);

Modified: trunk/src/wireless-security/eap-method-ttls.c
==============================================================================
--- trunk/src/wireless-security/eap-method-ttls.c	(original)
+++ trunk/src/wireless-security/eap-method-ttls.c	Thu Oct 30 18:13:52 2008
@@ -118,13 +118,13 @@
 	s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X));
 	g_assert (s_8021x);
 
-	s_8021x->eap = g_slist_append (s_8021x->eap, g_strdup ("ttls"));
+	nm_setting_802_1x_add_eap_method (s_8021x, "ttls");
 
 	widget = glade_xml_get_widget (parent->xml, "eap_ttls_anon_identity_entry");
 	g_assert (widget);
 	text = gtk_entry_get_text (GTK_ENTRY (widget));
 	if (text && strlen (text))
-		s_8021x->anonymous_identity = g_strdup (text);
+		g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, text, NULL);
 
 	widget = glade_xml_get_widget (parent->xml, "eap_ttls_ca_cert_button");
 	g_assert (widget);
@@ -283,15 +283,15 @@
 	EAPMethodSimple *em_mschap_v2;
 	EAPMethodSimple *em_chap;
 	guint32 active = 0;
-	char *phase2_auth = NULL;
+	const char *phase2_auth = NULL;
 
 	auth_model = gtk_list_store_new (2, G_TYPE_STRING, eap_method_get_g_type ());
 
 	if (s_8021x) {
-		if (s_8021x->phase2_auth)
-			phase2_auth = s_8021x->phase2_auth;
-		else if (s_8021x->phase2_autheap)
-			phase2_auth = s_8021x->phase2_autheap;
+		if (nm_setting_802_1x_get_phase2_auth (s_8021x))
+			phase2_auth = nm_setting_802_1x_get_phase2_auth (s_8021x);
+		else if (nm_setting_802_1x_get_phase2_autheap (s_8021x))
+			phase2_auth = nm_setting_802_1x_get_phase2_autheap (s_8021x);
 	}
 
 	em_pap = eap_method_simple_new (glade_file,
@@ -441,8 +441,8 @@
 	}
 
 	widget = glade_xml_get_widget (xml, "eap_ttls_anon_identity_entry");
-	if (s_8021x && s_8021x->anonymous_identity)
-		gtk_entry_set_text (GTK_ENTRY (widget), s_8021x->anonymous_identity);
+	if (s_8021x && nm_setting_802_1x_get_anonymous_identity (s_8021x))
+		gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_anonymous_identity (s_8021x));
 	g_signal_connect (G_OBJECT (widget), "changed",
 	                  (GCallback) wireless_security_changed_cb,
 	                  parent);

Modified: trunk/src/wireless-security/eap-method.c
==============================================================================
--- trunk/src/wireless-security/eap-method.c	(original)
+++ trunk/src/wireless-security/eap-method.c	Thu Oct 30 18:13:52 2008
@@ -183,9 +183,9 @@
 		if (!pw || !strlen (pw))
 			goto out;
 
-		success = nm_setting_802_1x_set_private_key (setting, filename, pw, NULL);
+		success = nm_setting_802_1x_set_private_key_from_file (setting, filename, pw, NULL);
 	} else {
-		success = nm_setting_802_1x_set_ca_cert (setting, filename, &error);
+		success = nm_setting_802_1x_set_ca_cert_from_file (setting, filename, &error);
 		if (error) {
 			g_warning ("Error: couldn't verify certificate: %d %s",
 			           error->code, error->message);

Modified: trunk/src/wireless-security/wireless-security.c
==============================================================================
--- trunk/src/wireless-security/wireless-security.c	(original)
+++ trunk/src/wireless-security/wireless-security.c	Thu Oct 30 18:13:52 2008
@@ -293,8 +293,8 @@
 			wired = TRUE;
 
 		s_8021x = (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X);
-		if (s_8021x && s_8021x->eap)
-			default_method = g_slist_nth_data (s_8021x->eap, 0);
+		if (s_8021x && nm_setting_802_1x_get_num_eap_methods (s_8021x))
+			default_method = nm_setting_802_1x_get_eap_method (s_8021x, 0);
 	}
 
 	auth_model = gtk_list_store_new (2, G_TYPE_STRING, eap_method_get_g_type ());



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