diff --git a/ChangeLog b/ChangeLog index 7701abe27..574a47613 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-06-15 Robert Love + + * gnome/applet/nm-gconf-wso-wpa-eap.c: Don't set the Gconf keys unless + we have a value to set. Gconf generates a warning if `val' is NULL. + * src/nm-ap-security-wpa-eap.c: Don't set the key for an Enterprise AP + unless we actually received a valid private key file passphrase or + password. Otherwise, we don't know to later ask the applet to pull + the key from the keyring. + 2006-06-17 Dan Williams * libnm-util/dbus-dict-helpers.[ch] @@ -26,7 +35,7 @@ 2006-06-15 Robert Love - * gnome/applet/nm-gconf-wso-wpa-eap.c: Don't set the set unless there + * gnome/applet/nm-gconf-wso-wpa-eap.c: Don't set the key 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 diff --git a/gnome/applet/nm-gconf-wso-wpa-eap.c b/gnome/applet/nm-gconf-wso-wpa-eap.c index 2f8e9f3c8..7111a4e74 100644 --- a/gnome/applet/nm-gconf-wso-wpa-eap.c +++ b/gnome/applet/nm-gconf-wso-wpa-eap.c @@ -239,31 +239,49 @@ real_serialize_gconf (NMGConfWSO *instance, GConfClient *client, const char *net key = g_strdup_printf ("%s/%s/%skey_mgt", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); gconf_client_set_int (client, key, self->priv->key_mgmt, NULL); - g_free (key); - - key = g_strdup_printf ("%s/%s/%sidentity", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); - gconf_client_set_string (client, key, self->priv->identity, NULL); g_free (key); - key = g_strdup_printf ("%s/%s/%spasswd", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); - gconf_client_set_string (client, key, self->priv->passwd, NULL); - g_free (key); + if (self->priv->identity && strlen (self->priv->identity) > 0) + { + key = g_strdup_printf ("%s/%s/%sidentity", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); + gconf_client_set_string (client, key, self->priv->identity, NULL); + g_free (key); + } - key = g_strdup_printf ("%s/%s/%sanon_identity", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); - gconf_client_set_string (client, key, self->priv->anon_identity, NULL); - g_free (key); + if (self->priv->passwd && strlen (self->priv->passwd) > 0) + { + key = g_strdup_printf ("%s/%s/%spasswd", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); + gconf_client_set_string (client, key, self->priv->passwd, NULL); + g_free (key); + } - key = g_strdup_printf ("%s/%s/%sprivate_key_file", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); - gconf_client_set_string (client, key, self->priv->private_key_file, NULL); - g_free (key); + if (self->priv->anon_identity && strlen (self->priv->anon_identity) > 0) + { + key = g_strdup_printf ("%s/%s/%sanon_identity", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); + gconf_client_set_string (client, key, self->priv->anon_identity, NULL); + g_free (key); + } - key = g_strdup_printf ("%s/%s/%sclient_cert_file", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); - gconf_client_set_string (client, key, self->priv->client_cert_file, NULL); - g_free (key); + if (self->priv->private_key_file && strlen (self->priv->private_key_file) > 0) + { + key = g_strdup_printf ("%s/%s/%sprivate_key_file", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); + gconf_client_set_string (client, key, self->priv->private_key_file, NULL); + g_free (key); + } - key = g_strdup_printf ("%s/%s/%sca_cert_file", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); - gconf_client_set_string (client, key, self->priv->ca_cert_file, NULL); - g_free (key); + if (self->priv->client_cert_file && strlen (self->priv->client_cert_file) > 0) + { + key = g_strdup_printf ("%s/%s/%sclient_cert_file", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); + gconf_client_set_string (client, key, self->priv->client_cert_file, NULL); + g_free (key); + } + + if (self->priv->ca_cert_file && strlen (self->priv->ca_cert_file) > 0) + { + key = g_strdup_printf ("%s/%s/%sca_cert_file", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); + gconf_client_set_string (client, key, self->priv->ca_cert_file, NULL); + g_free (key); + } return TRUE; } diff --git a/src/nm-ap-security-wpa-eap.c b/src/nm-ap-security-wpa-eap.c index d059b6db7..d7a6418bb 100644 --- a/src/nm-ap-security-wpa-eap.c +++ b/src/nm-ap-security-wpa-eap.c @@ -75,7 +75,8 @@ nm_ap_security_wpa_eap_new_deserialize (DBusMessageIter *iter) /* Success, build up our security object */ security = g_object_new (NM_TYPE_AP_SECURITY_WPA_EAP, NULL); nm_ap_security_set_we_cipher (NM_AP_SECURITY (security), NM_AUTH_TYPE_WPA_EAP); - nm_ap_security_set_key (NM_AP_SECURITY (security), "FIXME", 5); /* FIXME: what do we do for Enterprise? */ + if ((private_key_passwd && strlen (private_key_passwd) > 0) || (passwd && strlen (passwd) > 0)) + nm_ap_security_set_key (NM_AP_SECURITY (security), "FIXME", 5); security->priv->eap_method = eap_method; security->priv->key_type = key_type; security->priv->wpa_version = wpa_version;