From f842f234c51dc74cbf9b5fa5533225a586bae0e9 Mon Sep 17 00:00:00 2001 From: Robert Love Date: Tue, 21 Mar 2006 15:22:55 +0000 Subject: [PATCH] 2006-03-21 Robert Love * src/backends/NetworkManagerSuSE.c: Strip hypens from hex key in configuration file. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1625 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 5 +++++ src/backends/NetworkManagerSuSE.c | 22 +++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05beee6520..0a9e31487b 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 02be891405..6e32d94ffc 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));