linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath: Fix hardware decryption of WEP
@ 2011-08-08 19:19 Bill Jordan
  2011-08-09  2:04 ` Felix Fietkau
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Jordan @ 2011-08-08 19:19 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless, linville; +Cc: Bill Jordan

The first 4 hardware key indexes are reserved for WEP, but
never programmed. The result was that WEP always used
software decryption.

Signed-off-by: Bill Jordan <bjordan@rajant.com>
---
 drivers/net/wireless/ath/key.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c
index 17b0efd..73177f1 100644
--- a/drivers/net/wireless/ath/key.c
+++ b/drivers/net/wireless/ath/key.c
@@ -501,7 +501,11 @@ int ath_key_config(struct ath_common *common,
 	if (key->keylen)
 		memcpy(hk.kv_val, key->key, key->keylen);
 
-	if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
+	if (hk.kv_type == ATH_CIPHER_WEP) {
+		if (key->keyidx >= IEEE80211_WEP_NKID)
+			return -EOPNOTSUPP;
+		idx = key->keyidx;
+	} else if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
 		switch (vif->type) {
 		case NL80211_IFTYPE_AP:
 			memcpy(gmac, vif->addr, ETH_ALEN);
@@ -577,8 +581,6 @@ EXPORT_SYMBOL(ath_key_config);
 void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key)
 {
 	ath_hw_keyreset(common, key->hw_key_idx);
-	if (key->hw_key_idx < IEEE80211_WEP_NKID)
-		return;
 
 	clear_bit(key->hw_key_idx, common->keymap);
 	if (key->cipher != WLAN_CIPHER_SUITE_TKIP)
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-09 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08 19:19 [PATCH] ath: Fix hardware decryption of WEP Bill Jordan
2011-08-09  2:04 ` Felix Fietkau
2011-08-09  8:04   ` [ath9k-devel] " Jouni Malinen
2011-08-09 15:58     ` Bill Jordan
2011-08-09 17:07       ` Jouni Malinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).