Commit 14d5e14c authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Kalle Valo

rt2x00: clear up IV's on key removal

After looking at code I realized that my previous fix
95844124 ("rt2x00: clear IV's on start to fix AP mode regression")
was incomplete. We can still have wrong IV's after re-keyring.
To fix that, clear up IV's also on key removal.

Fixes: 710e6cc1 ("rt2800: do not nullify initialization vector data")
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
tested-by: default avatarEmil Karlson <jekarl@iki.fi>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 968dcfb4
...@@ -1654,6 +1654,7 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev, ...@@ -1654,6 +1654,7 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev,
offset = MAC_IVEIV_ENTRY(key->hw_key_idx); offset = MAC_IVEIV_ENTRY(key->hw_key_idx);
if (crypto->cmd == SET_KEY) {
rt2800_register_multiread(rt2x00dev, offset, rt2800_register_multiread(rt2x00dev, offset,
&iveiv_entry, sizeof(iveiv_entry)); &iveiv_entry, sizeof(iveiv_entry));
if ((crypto->cipher == CIPHER_TKIP) || if ((crypto->cipher == CIPHER_TKIP) ||
...@@ -1661,6 +1662,10 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev, ...@@ -1661,6 +1662,10 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev,
(crypto->cipher == CIPHER_AES)) (crypto->cipher == CIPHER_AES))
iveiv_entry.iv[3] |= 0x20; iveiv_entry.iv[3] |= 0x20;
iveiv_entry.iv[3] |= key->keyidx << 6; iveiv_entry.iv[3] |= key->keyidx << 6;
} else {
memset(&iveiv_entry, 0, sizeof(iveiv_entry));
}
rt2800_register_multiwrite(rt2x00dev, offset, rt2800_register_multiwrite(rt2x00dev, offset,
&iveiv_entry, sizeof(iveiv_entry)); &iveiv_entry, sizeof(iveiv_entry));
} }
......
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