Commit 7cc4573e authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo

ath10k: fix WPA crypto

Commit 370e5673 ("ath10k: fix broken traffic for 802.1x in client mode")
introduced a regression on WPA crypto. All keys were treated as if they were
WEP which resulted in WPA being incorrectly installed to fw/hw and subsequently
no traffic.
Reported-by: default avatarMarek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent bff414c3
...@@ -4029,6 +4029,11 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -4029,6 +4029,11 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
} }
} }
if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
flags |= WMI_KEY_PAIRWISE;
else
flags |= WMI_KEY_GROUP;
if (is_wep) { if (is_wep) {
if (cmd == SET_KEY) if (cmd == SET_KEY)
arvif->wep_keys[key->keyidx] = key; arvif->wep_keys[key->keyidx] = key;
...@@ -4054,30 +4059,25 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -4054,30 +4059,25 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
*/ */
if (cmd == SET_KEY && arvif->def_wep_key_idx == -1) if (cmd == SET_KEY && arvif->def_wep_key_idx == -1)
flags |= WMI_KEY_TX_USAGE; flags |= WMI_KEY_TX_USAGE;
}
if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) /* mac80211 uploads static WEP keys as groupwise while fw/hw
flags |= WMI_KEY_PAIRWISE; * requires pairwise keys for non-self peers, i.e. BSSID in STA
else * mode and associated stations in AP/IBSS.
flags |= WMI_KEY_GROUP;
/* mac80211 uploads static WEP keys as groupwise while fw/hw requires
* pairwise keys for non-self peers, i.e. BSSID in STA mode and
* associated stations in AP/IBSS.
* *
* Static WEP keys for peer_addr=vif->addr and 802.1X WEP keys work * Static WEP keys for peer_addr=vif->addr and 802.1X WEP keys
* fine when mapped directly from mac80211. * work fine when mapped directly from mac80211.
* *
* Note: When installing first static WEP groupwise key (which should * Note: When installing first static WEP groupwise key (which
* be pairwise) def_wep_key_idx isn't known yet (it's equal to -1). * should be pairwise) def_wep_key_idx isn't known yet (it's
* Since .set_default_unicast_key is called only for static WEP it's * equal to -1). Since .set_default_unicast_key is called only
* used to re-upload the key as pairwise. * for static WEP it's used to re-upload the key as pairwise.
*/ */
if (arvif->def_wep_key_idx >= 0 && if (arvif->def_wep_key_idx >= 0 &&
memcmp(peer_addr, arvif->vif->addr, ETH_ALEN)) { memcmp(peer_addr, arvif->vif->addr, ETH_ALEN)) {
flags &= ~WMI_KEY_GROUP; flags &= ~WMI_KEY_GROUP;
flags |= WMI_KEY_PAIRWISE; flags |= WMI_KEY_PAIRWISE;
} }
}
ret = ath10k_install_key(arvif, key, cmd, peer_addr, flags); ret = ath10k_install_key(arvif, key, cmd, peer_addr, flags);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment