diff --git a/ChangeLog b/ChangeLog index aafe342a64..0451a8adc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-04-25 Robert Love + + * src/nm-ap-security-wep.c: Bug fix: We stopped setting the + key mode (the authentication algorithm), e.g. open or shared, when we + moved to using wpa_supplicant. wpa_supplicant defaults to open, so + only shared was broken. If the user specified a shared key, set it + explicitly, otherwise let wpa_supplicant go with the default. + 2006-04-24 Dan Williams * src/nm-device-802-11-wireless.c diff --git a/src/nm-ap-security-wep.c b/src/nm-ap-security-wep.c index bfe487420d..c11953e0ad 100644 --- a/src/nm-ap-security-wep.c +++ b/src/nm-ap-security-wep.c @@ -39,6 +39,11 @@ struct _NMAPSecurityWEPPrivate int auth_algorithm; }; +static int get_auth_algorithm (NMAPSecurityWEP *security) +{ + return security->priv->auth_algorithm; +} + static void set_description (NMAPSecurityWEP *security) { NMAPSecurity * parent = NM_AP_SECURITY (security); @@ -121,6 +126,16 @@ real_write_supplicant_config (NMAPSecurity *instance, "SET_NETWORK %i key_mgmt NONE", nwid)) goto out; + /* + * If the user selected "Shared" (aka restricted) key, set it explicitly. Otherwise, + * let wpa_supplicant default to the right thing, which is an open key. + */ + if (get_auth_algorithm (NM_AP_SECURITY_WEP (instance)) == IW_AUTH_ALG_SHARED_KEY) + { + if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, msg, + "SET_NETWORK %i auth_alg SHARED", nwid)); + } + msg = g_strdup_printf ("SET_NETWORK %i wep_key0 ", nwid); if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, msg, "SET_NETWORK %i wep_key0 %s", nwid, key))