aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-02-26 04:18:46 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-05 14:39:31 -0500
commit3f53dd64f192450cb331c0fecfc26ca952fb242f (patch)
tree6659f9fe8abf6514d07ed70a9018207080daf74a /drivers/net/wireless
parent998a5a7d6aabe7e450759e0d82c8a79afd5a97ff (diff)
ath9k: Fix hw crypto configuration for TKIP in AP mode
Incorrect Michael MIC key (RX, should have been TX) was set for the group key in AP mode. This resulted in all broadcast frames triggering Michael MIC errors and eventual TKIP countermeasures. The change here sets the correct Michael MIC key based on whether the local end is the authenticator (well, AP for now). Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Tested-by: Pat Erley <pat-lkml@erley.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath9k/main.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 659ed07f28e3..fd6cc7348a4e 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -648,8 +648,8 @@ static int ath_keyset(struct ath_softc *sc, u16 keyix,
648} 648}
649 649
650static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key, 650static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key,
651 struct ath9k_keyval *hk, 651 struct ath9k_keyval *hk, const u8 *addr,
652 const u8 *addr) 652 bool authenticator)
653{ 653{
654 const u8 *key_rxmic; 654 const u8 *key_rxmic;
655 const u8 *key_txmic; 655 const u8 *key_txmic;
@@ -659,7 +659,13 @@ static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key,
659 659
660 if (addr == NULL) { 660 if (addr == NULL) {
661 /* Group key installation */ 661 /* Group key installation */
662 memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic)); 662 if (authenticator) {
663 memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
664 memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_mic));
665 } else {
666 memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
667 memcpy(hk->kv_txmic, key_rxmic, sizeof(hk->kv_mic));
668 }
663 return ath_keyset(sc, keyix, hk, addr); 669 return ath_keyset(sc, keyix, hk, addr);
664 } 670 }
665 if (!sc->splitmic) { 671 if (!sc->splitmic) {
@@ -769,6 +775,7 @@ static int ath_reserve_key_cache_slot(struct ath_softc *sc)
769} 775}
770 776
771static int ath_key_config(struct ath_softc *sc, 777static int ath_key_config(struct ath_softc *sc,
778 struct ieee80211_vif *vif,
772 struct ieee80211_sta *sta, 779 struct ieee80211_sta *sta,
773 struct ieee80211_key_conf *key) 780 struct ieee80211_key_conf *key)
774{ 781{
@@ -828,7 +835,8 @@ static int ath_key_config(struct ath_softc *sc,
828 } 835 }
829 836
830 if (key->alg == ALG_TKIP) 837 if (key->alg == ALG_TKIP)
831 ret = ath_setkey_tkip(sc, idx, key->key, &hk, mac); 838 ret = ath_setkey_tkip(sc, idx, key->key, &hk, mac,
839 vif->type == NL80211_IFTYPE_AP);
832 else 840 else
833 ret = ath_keyset(sc, idx, &hk, mac); 841 ret = ath_keyset(sc, idx, &hk, mac);
834 842
@@ -2481,7 +2489,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
2481 2489
2482 switch (cmd) { 2490 switch (cmd) {
2483 case SET_KEY: 2491 case SET_KEY:
2484 ret = ath_key_config(sc, sta, key); 2492 ret = ath_key_config(sc, vif, sta, key);
2485 if (ret >= 0) { 2493 if (ret >= 0) {
2486 key->hw_key_idx = ret; 2494 key->hw_key_idx = ret;
2487 /* push IV and Michael MIC generation to stack */ 2495 /* push IV and Michael MIC generation to stack */