diff options
author | 2007-07-18 18:10:31 +0000 | |
---|---|---|
committer | 2007-07-18 18:10:31 +0000 | |
commit | 83da4af0a69d142c660fa33826ee250bfed268b2 (patch) | |
tree | 35d083021baf99eeb0cf23cb50812d8c8ed5f7b7 /sys/dev/ic/ath.c | |
parent | Indentation nit. (diff) | |
download | wireguard-openbsd-83da4af0a69d142c660fa33826ee250bfed268b2.tar.xz wireguard-openbsd-83da4af0a69d142c660fa33826ee250bfed268b2.zip |
replace the ieee80211_wepkey structure with a more generic ieee80211_key
one that can be used with other ciphers than WEP.
Diffstat (limited to 'sys/dev/ic/ath.c')
-rw-r--r-- | sys/dev/ic/ath.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c index 5afad58bf7c..0936ffc6a1e 100644 --- a/sys/dev/ic/ath.c +++ b/sys/dev/ic/ath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ath.c,v 1.65 2007/06/16 13:17:05 damien Exp $ */ +/* $OpenBSD: ath.c,v 1.66 2007/07/18 18:10:31 damien Exp $ */ /* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */ /*- @@ -1146,15 +1146,13 @@ ath_initkeytable(struct ath_softc *sc) /* XXX maybe should reset all keys when !WEPON */ for (i = 0; i < IEEE80211_WEP_NKID; i++) { - struct ieee80211_wepkey *k = &ic->ic_nw_keys[i]; - if (k->wk_len == 0) + struct ieee80211_key *k = &ic->ic_nw_keys[i]; + if (k->k_len == 0) ath_hal_reset_key(ah, i); else { HAL_KEYVAL hk; bzero(&hk, sizeof(hk)); - bcopy(k->wk_key, hk.wk_key, k->wk_len); - /* * Pad the key to a supported key length. It * is always a good idea to use full-length @@ -1162,14 +1160,13 @@ ath_initkeytable(struct ath_softc *sc) * to be the default behaviour used by many * implementations. */ - if (k->wk_len <= AR5K_KEYVAL_LENGTH_40) + if (k->k_cipher == IEEE80211_CIPHER_WEP40) hk.wk_len = AR5K_KEYVAL_LENGTH_40; - else if (k->wk_len <= AR5K_KEYVAL_LENGTH_104) + else if (k->k_cipher == IEEE80211_CIPHER_WEP104) hk.wk_len = AR5K_KEYVAL_LENGTH_104; - else if (k->wk_len <= AR5K_KEYVAL_LENGTH_128) - hk.wk_len = AR5K_KEYVAL_LENGTH_128; else return (EINVAL); + bcopy(k->k_key, hk.wk_key, hk.wk_len); if (ath_hal_set_key(ah, i, &hk) != AH_TRUE) return (EINVAL); |