mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
mt76: fix tkip configuration for mt7615/7663 devices
[ Upstream commit930e0eaddf] Fix Tx-Rx MIC overwrite during TKIP hw key configuration Fixes:01cfc1b454("mt76: mt7615: add BIP_CMAC_128 cipher support") Tested-by: YN Chen <yn.chen@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e2dea65052
commit
2952eef157
@@ -1046,15 +1046,17 @@ int mt7615_mac_wtbl_update_key(struct mt7615_dev *dev,
|
||||
if (cmd == SET_KEY) {
|
||||
if (cipher == MT_CIPHER_TKIP) {
|
||||
/* Rx/Tx MIC keys are swapped */
|
||||
memcpy(data, key, 16);
|
||||
memcpy(data + 16, key + 24, 8);
|
||||
memcpy(data + 24, key + 16, 8);
|
||||
} else {
|
||||
if (cipher != MT_CIPHER_BIP_CMAC_128 && wcid->cipher)
|
||||
memmove(data + 16, data, 16);
|
||||
if (cipher != MT_CIPHER_BIP_CMAC_128 || !wcid->cipher)
|
||||
memcpy(data, key, keylen);
|
||||
else if (cipher == MT_CIPHER_BIP_CMAC_128)
|
||||
memcpy(data + 16, key, 16);
|
||||
}
|
||||
if (cipher != MT_CIPHER_BIP_CMAC_128 && wcid->cipher)
|
||||
memmove(data + 16, data, 16);
|
||||
if (cipher != MT_CIPHER_BIP_CMAC_128 || !wcid->cipher)
|
||||
memcpy(data, key, keylen);
|
||||
else if (cipher == MT_CIPHER_BIP_CMAC_128)
|
||||
memcpy(data + 16, key, 16);
|
||||
} else {
|
||||
if (wcid->cipher & ~BIT(cipher)) {
|
||||
if (cipher != MT_CIPHER_BIP_CMAC_128)
|
||||
|
||||
Reference in New Issue
Block a user