From 129e00e81f0f83db1352b5c5c34698ca5af7c7bb Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 21 Feb 2006 23:55:38 +0000 Subject: use the specified key index for non-group keys; this fixes static wep key configure at key indices > 0 and 802.1x/EAPOL operation with ap's that want the station to install a key at indices > 0. Hard work by: Joe Love Reviewed by: avatar MFC after: 1 week --- usr.sbin/wpa/wpa_supplicant/driver_freebsd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr.sbin/wpa/wpa_supplicant') diff --git a/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c b/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c index e69dcd5..6a02df6 100644 --- a/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c +++ b/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c @@ -311,10 +311,11 @@ wpa_driver_bsd_set_key(void *priv, wpa_alg alg, if (bcmp(addr, "\xff\xff\xff\xff\xff\xff", IEEE80211_ADDR_LEN) == 0) { wk.ik_flags |= IEEE80211_KEY_GROUP; wk.ik_keyix = key_idx; - if (set_tx) - wk.ik_flags |= IEEE80211_KEY_DEFAULT; - } else - wk.ik_keyix = IEEE80211_KEYIX_NONE; + } else { + wk.ik_keyix = (key_idx == 0 ? IEEE80211_KEYIX_NONE : key_idx); + } + if (wk.ik_keyix != IEEE80211_KEYIX_NONE && set_tx) + wk.ik_flags |= IEEE80211_KEY_DEFAULT; wk.ik_keylen = key_len; memcpy(&wk.ik_keyrsc, seq, seq_len); memcpy(wk.ik_keydata, key, key_len); -- cgit v1.1