diff --git a/ChangeLog b/ChangeLog index 6804de327a..8c7bb85299 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-03-27 Robert Love + + Patch by Jon Escombe : + * gnome/applet/nm-gconf-wso.c: Add missing NM_AUTH_TYPE_WPA_EAP case. + * gnome/applet/nm-gconf-wso-wpa-eap.c: If retrieving the gconf values + fail, don't bail out. We don't expect all of the various WPA-EAP + values to be present. + * src/nm-ap-security.c: We need to match all capabilities for each + encryption type, not any one of them. + 2006-03-27 Robert Love * src/backends/NetworkManagerSuSE.c: Revert 2006-03-17 commit and again diff --git a/gnome/applet/nm-gconf-wso-wpa-eap.c b/gnome/applet/nm-gconf-wso-wpa-eap.c index 1df6861248..91a6ddb4a1 100644 --- a/gnome/applet/nm-gconf-wso-wpa-eap.c +++ b/gnome/applet/nm-gconf-wso-wpa-eap.c @@ -106,90 +106,80 @@ nm_gconf_wso_wpa_eap_new_deserialize_gconf (GConfClient *client, const char *net char * private_key_file = NULL; char * client_cert_file = NULL; char * ca_cert_file = NULL; - int wpa_version; - int eap_method; - int key_type; - int key_mgmt; + int wpa_version = 0; + int eap_method = 0; + int key_type = 0; + int key_mgmt = 0; g_return_val_if_fail (client != NULL, NULL); g_return_val_if_fail (network != NULL, NULL); g_return_val_if_fail ((we_cipher == NM_AUTH_TYPE_WPA_EAP), NULL); - if (!nm_gconf_get_int_helper (client, + nm_gconf_get_int_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"eap_method", network, - &eap_method)) - goto out; + &eap_method); - if (!nm_gconf_get_int_helper (client, + nm_gconf_get_int_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"key_type", network, - &key_type)) - goto out; + &key_type); - if (!nm_gconf_get_int_helper (client, + nm_gconf_get_int_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"wpa_version", network, - &wpa_version)) - goto out; + &wpa_version); - if (!nm_gconf_get_int_helper (client, + nm_gconf_get_int_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"key_mgt", network, - &key_mgmt)) + &key_mgmt); - if (!nm_gconf_get_string_helper (client, + nm_gconf_get_string_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"identity", network, - &identity)) - goto out; + &identity); - if (!nm_gconf_get_string_helper (client, + nm_gconf_get_string_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"passwd", network, - &passwd)) - goto out; + &passwd); - if (!nm_gconf_get_string_helper (client, + nm_gconf_get_string_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"anon_identity", network, - &anon_identity)) - goto out; + &anon_identity); - if (!nm_gconf_get_string_helper (client, + nm_gconf_get_string_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"private_key_passwd", network, - &private_key_passwd)) - goto out; + &private_key_passwd); - if (!nm_gconf_get_string_helper (client, + nm_gconf_get_string_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"private_key_file", network, - &private_key_file)) - goto out; + &private_key_file); - if (!nm_gconf_get_string_helper (client, + nm_gconf_get_string_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"client_cert_file", network, - &client_cert_file)) - goto out; + &client_cert_file); - if (!nm_gconf_get_string_helper (client, + nm_gconf_get_string_helper (client, GCONF_PATH_WIRELESS_NETWORKS, WPA_EAP_PREFIX"ca_cert_file", network, - &ca_cert_file)) - goto out; + &ca_cert_file); /* Success, build up our security object */ security = g_object_new (NM_TYPE_GCONF_WSO_WPA_EAP, NULL); @@ -214,7 +204,6 @@ nm_gconf_wso_wpa_eap_new_deserialize_gconf (GConfClient *client, const char *net g_free (client_cert_file); g_free (ca_cert_file); -out: return security; } diff --git a/gnome/applet/nm-gconf-wso.c b/gnome/applet/nm-gconf-wso.c index 0aecef361b..23b6069fe1 100644 --- a/gnome/applet/nm-gconf-wso.c +++ b/gnome/applet/nm-gconf-wso.c @@ -137,6 +137,10 @@ nm_gconf_wso_new_deserialize_gconf (GConfClient *client, security = NM_GCONF_WSO (nm_gconf_wso_wpa_psk_new_deserialize_gconf (client, network, we_cipher)); break; + case NM_AUTH_TYPE_WPA_EAP: + security = NM_GCONF_WSO (nm_gconf_wso_wpa_eap_new_deserialize_gconf (client, network, we_cipher)); + break; + default: break; } diff --git a/src/nm-ap-security.c b/src/nm-ap-security.c index c9161b3da3..3809d2c897 100644 --- a/src/nm-ap-security.c +++ b/src/nm-ap-security.c @@ -125,15 +125,15 @@ nm_ap_security_new_from_ap (NMAccessPoint *ap) /* Deteremine best encryption algorithm to use */ caps = nm_ap_get_capabilities (ap); - if ((caps & WPA_CCMP_PSK) || (caps & WPA2_CCMP_PSK)) + if (((caps & WPA_CCMP_PSK) == WPA_CCMP_PSK) || ((caps & WPA2_CCMP_PSK) == WPA2_CCMP_PSK)) security = NM_AP_SECURITY (nm_ap_security_wpa_psk_new_from_ap (ap, IW_AUTH_CIPHER_CCMP)); - else if ((caps & WPA_TKIP_PSK) || (caps & WPA2_TKIP_PSK)) + else if (((caps & WPA_TKIP_PSK) == WPA_TKIP_PSK) || ((caps & WPA2_TKIP_PSK) == WPA2_TKIP_PSK)) security = NM_AP_SECURITY (nm_ap_security_wpa_psk_new_from_ap (ap, IW_AUTH_CIPHER_TKIP)); - else if ((caps & WPA_EAP) || (caps & WPA2_EAP)) + else if (((caps & WPA_EAP) == WPA_EAP) || ((caps & WPA2_EAP) == WPA2_EAP)) security = NM_AP_SECURITY (nm_ap_security_wpa_eap_new_from_ap (ap)); - else if (caps & WEP_WEP104) + else if ((caps & WEP_WEP104) == WEP_WEP104) security = NM_AP_SECURITY (nm_ap_security_wep_new_from_ap (ap, IW_AUTH_CIPHER_WEP104)); - else if (caps & WEP_WEP40) + else if ((caps & WEP_WEP40) == WEP_WEP40) security = NM_AP_SECURITY (nm_ap_security_wep_new_from_ap (ap, IW_AUTH_CIPHER_WEP40)); else if (!nm_ap_get_encrypted (ap)) security = nm_ap_security_new (IW_AUTH_CIPHER_NONE);