diff --git a/ChangeLog b/ChangeLog index 4a2b909135..e001541c75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-06-15 Robert Love + + * gnome/applet/nm-gconf-wso-wpa-eap.c: Don't set the set unless there + is a non-empty key to set. Elsewhere, pass an empty string via DBUS + if there is no key to pass. + * libnm-util/dbus-helpers.c: Given the above, we can trust always + receiving a non-NULL key. + 2006-06-14 Robert Love * src/nm-ap-security-wpa-eap.c: In real_copy_constructor(), actually diff --git a/gnome/applet/applet-dbus-info.c b/gnome/applet/applet-dbus-info.c index 5a77aff3ec..624e1267a5 100644 --- a/gnome/applet/applet-dbus-info.c +++ b/gnome/applet/applet-dbus-info.c @@ -178,7 +178,7 @@ nmi_dbus_get_key_for_network (DBusConnection *connection, || !temp) new_key = TRUE; g_free (escaped_network); - + /* It's not a new key, so try to get the key from the keyring. */ if (!new_key) { @@ -825,8 +825,6 @@ nmi_save_network_info (NMApplet *applet, char * key; GConfEntry * gconf_entry; char * escaped_network; - GnomeKeyringResult ret; - guint32 item_id; GConfValue * value; g_return_if_fail (applet != NULL); @@ -919,11 +917,13 @@ nmi_save_network_info (NMApplet *applet, /* Stuff the encryption key into the keyring */ if (nm_gconf_wso_get_we_cipher (gconf_wso) != IW_AUTH_CIPHER_NONE) { - GnomeKeyringAttributeList *attributes; - GnomeKeyringAttribute attr; - char *name; + GnomeKeyringAttributeList * attributes; + GnomeKeyringAttribute attr; + char * display_name; + GnomeKeyringResult ret; + guint32 item_id; - name = g_strdup_printf (_("Passphrase for wireless network %s"), essid); + display_name = g_strdup_printf (_("Passphrase for wireless network %s"), essid); attributes = gnome_keyring_attribute_list_new (); attr.name = g_strdup ("essid"); @@ -933,15 +933,15 @@ nmi_save_network_info (NMApplet *applet, ret = gnome_keyring_item_create_sync (NULL, GNOME_KEYRING_ITEM_GENERIC_SECRET, - name, + display_name, attributes, nm_gconf_wso_get_key (gconf_wso), TRUE, &item_id); if (ret != GNOME_KEYRING_RESULT_OK) - g_warning ("Error saving passphrase in keyring. Ret=%d", ret); + nm_warning ("Error saving secret for wireless network '%s' in keyring: %d", essid, ret); - g_free (name); + g_free (display_name); gnome_keyring_attribute_list_free (attributes); } diff --git a/gnome/applet/nm-gconf-wso-wpa-eap.c b/gnome/applet/nm-gconf-wso-wpa-eap.c index 4ef3106aef..2f8e9f3c8c 100644 --- a/gnome/applet/nm-gconf-wso-wpa-eap.c +++ b/gnome/applet/nm-gconf-wso-wpa-eap.c @@ -77,7 +77,7 @@ nm_gconf_wso_wpa_eap_new_deserialize_dbus (DBusMessageIter *iter, int we_cipher) /* Success, build up our security object */ security = g_object_new (NM_TYPE_GCONF_WSO_WPA_EAP, NULL); nm_gconf_wso_set_we_cipher (NM_GCONF_WSO (security), we_cipher); - if (private_key_passwd) + if (private_key_passwd && strlen (private_key_passwd) > 0) nm_gconf_wso_set_key (NM_GCONF_WSO (security), private_key_passwd, strlen (private_key_passwd)); security->priv->wpa_version = wpa_version; security->priv->eap_method = eap_method; @@ -210,7 +210,7 @@ real_serialize_dbus (NMGConfWSO *instance, DBusMessageIter *iter) self->priv->identity ? : "", self->priv->passwd ? : "", self->priv->anon_identity ? : "", - nm_gconf_wso_get_key (instance), + nm_gconf_wso_get_key (instance) ? : "", self->priv->private_key_file ? : "", self->priv->client_cert_file ? : "", self->priv->ca_cert_file ? : "", diff --git a/libnm-util/dbus-helpers.c b/libnm-util/dbus-helpers.c index 63d0d2dad5..0307331aca 100644 --- a/libnm-util/dbus-helpers.c +++ b/libnm-util/dbus-helpers.c @@ -259,8 +259,6 @@ nmu_security_serialize_wpa_eap (DBusMessageIter *iter, const char *ca_cert_file, int wpa_version) { - const char *fake_private_key_passwd = ""; - g_return_val_if_fail (iter != NULL, FALSE); g_return_val_if_fail ((wpa_version == IW_AUTH_WPA_VERSION_WPA) || (wpa_version == IW_AUTH_WPA_VERSION_WPA2), FALSE); g_return_val_if_fail ((eap_method == NM_EAP_METHOD_MD5) @@ -291,7 +289,7 @@ nmu_security_serialize_wpa_eap (DBusMessageIter *iter, dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, &anon_identity); /* Seventh arg: Private key password (STRING) */ - dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, private_key_passwd ? &private_key_passwd : &fake_private_key_passwd); + dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, &private_key_passwd); /* Eighth arg: Private key file (STRING) */ dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, &private_key_file);