diff --git a/ChangeLog b/ChangeLog index 05beee652..0a9e31487 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-21 Robert Love + + * src/backends/NetworkManagerSuSE.c: Strip hypens from hex key in + configuration file. + 2006-03-17 Robert Love * src/backends/NetworkManagerSuSE.c: Do "rcypbind reload" to send the diff --git a/src/backends/NetworkManagerSuSE.c b/src/backends/NetworkManagerSuSE.c index 02be89140..6e32d94ff 100644 --- a/src/backends/NetworkManagerSuSE.c +++ b/src/backends/NetworkManagerSuSE.c @@ -545,8 +545,11 @@ found: nm_ap_set_capabilities (ap, NM_802_11_CAP_PROTO_WPA); security = nm_ap_security_wpa_psk_new_from_ap (ap, NM_AUTH_TYPE_WPA_PSK_AUTO); hash = ieee_802_11_cipher_hash (cipher, buf, key); - nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash)); - nm_ap_set_security (ap, NM_AP_SECURITY (security)); + if (hash) + { + nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash)); + nm_ap_set_security (ap, NM_AP_SECURITY (security)); + } ieee_802_11_cipher_unref (cipher); g_object_unref (G_OBJECT (security)); @@ -594,14 +597,23 @@ found: } else { + char **keyv; + cipher = cipher_wep128_hex_new (); - real_key = key; + + keyv = g_strsplit (key, "-", 0); + real_key = g_strjoinv (NULL, keyv); + g_strfreev (keyv); + free (key); } security = nm_ap_security_wep_new_from_ap (ap, IW_AUTH_CIPHER_WEP104); } hash = ieee_802_11_cipher_hash (cipher, buf, real_key); - nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash)); - nm_ap_set_security (ap, NM_AP_SECURITY (security)); + if (hash) + { + nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash)); + nm_ap_set_security (ap, NM_AP_SECURITY (security)); + } ieee_802_11_cipher_unref (cipher); g_object_unref (G_OBJECT (security));