From: Stanislaw Gruszka <sgruszka@redhat.com>
To: linux-wireless@vger.kernel.org
Cc: "Tomislav Požega" <pozega.tomislav@gmail.com>,
"Daniel Golle" <daniel@makrotopia.org>,
"Felix Fietkau" <nbd@nbd.name>, "Mathias Kresin" <dev@kresin.me>
Subject: [RFC/RFT 5/7] rt2800: do not nullify initialization vector data
Date: Mon, 29 Apr 2019 12:54:28 +0200 [thread overview]
Message-ID: <1556535270-3551-6-git-send-email-sgruszka@redhat.com> (raw)
In-Reply-To: <1556535270-3551-1-git-send-email-sgruszka@redhat.com>
If we restart hw we should keep existing IV (initialization vector)
otherwise HW encryption will be broken after restart.
Also fix some coding style issues on the way.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 9a49bb44197c..4a2e15b5aba4 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -1650,14 +1650,15 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev,
offset = MAC_IVEIV_ENTRY(key->hw_key_idx);
- memset(&iveiv_entry, 0, sizeof(iveiv_entry));
+ rt2800_register_multiread(rt2x00dev, offset,
+ &iveiv_entry, sizeof(iveiv_entry));
if ((crypto->cipher == CIPHER_TKIP) ||
(crypto->cipher == CIPHER_TKIP_NO_MIC) ||
(crypto->cipher == CIPHER_AES))
iveiv_entry.iv[3] |= 0x20;
iveiv_entry.iv[3] |= key->keyidx << 6;
rt2800_register_multiwrite(rt2x00dev, offset,
- &iveiv_entry, sizeof(iveiv_entry));
+ &iveiv_entry, sizeof(iveiv_entry));
}
int rt2800_config_shared_key(struct rt2x00_dev *rt2x00dev,
@@ -6082,13 +6083,11 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
* ASIC will keep garbage value after boot, clear encryption keys.
*/
for (i = 0; i < 4; i++)
- rt2800_register_write(rt2x00dev,
- SHARED_KEY_MODE_ENTRY(i), 0);
+ rt2800_register_write(rt2x00dev, SHARED_KEY_MODE_ENTRY(i), 0);
for (i = 0; i < 256; i++) {
rt2800_config_wcid(rt2x00dev, NULL, i);
rt2800_delete_wcid_attr(rt2x00dev, i);
- rt2800_register_write(rt2x00dev, MAC_IVEIV_ENTRY(i), 0);
}
/*
--
2.7.5
next prev parent reply other threads:[~2019-04-29 10:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-29 10:54 [RFC/RFT 0/7] rt2800: add experimental watchdog implementation Stanislaw Gruszka
2019-04-29 10:54 ` [RFC/RFT 1/7] rt2x00: allow to specify watchdog interval Stanislaw Gruszka
2019-04-29 10:54 ` [RFC/RFT 2/7] rt2800: add helpers for reading dma done index Stanislaw Gruszka
2019-04-29 10:54 ` [RFC/RFT 3/7] rt2800: initial watchdog implementation Stanislaw Gruszka
2019-04-29 10:54 ` [RFC/RFT 4/7] rt2800: add pre_reset_hw callback Stanislaw Gruszka
2019-04-29 10:54 ` Stanislaw Gruszka [this message]
2019-04-29 10:54 ` [RFC/RFT 6/7] rt2x00: add restart hw Stanislaw Gruszka
2019-04-29 10:54 ` [RFC/RFT 7/7] rt2800: do not enable watchdog by default Stanislaw Gruszka
2019-04-30 13:25 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1556535270-3551-6-git-send-email-sgruszka@redhat.com \
--to=sgruszka@redhat.com \
--cc=daniel@makrotopia.org \
--cc=dev@kresin.me \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=pozega.tomislav@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox