summaryrefslogtreecommitdiffstats
path: root/net/mac80211/tkip.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2008-06-21 10:02:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-27 09:09:17 -0400
commitffd7891dc909b3648e87f7cf8f84a6dc12fc1cc6 (patch)
tree563c41b3bce49effd3544081cb54ba5ab6fdfb15 /net/mac80211/tkip.c
parent61243d8e79de67d703b192fae2c4ab80fc0fac34 (diff)
downloadlinux-ffd7891dc909b3648e87f7cf8f84a6dc12fc1cc6.tar.gz
linux-ffd7891dc909b3648e87f7cf8f84a6dc12fc1cc6.tar.bz2
linux-ffd7891dc909b3648e87f7cf8f84a6dc12fc1cc6.zip
mac80211: Let drivers have access to TKIP key offets for TX and RX MIC
Some drivers may want to to use the TKIP key offsets for TX and RX MIC so lets move this out. Lets also clear up a bit how this is used internally in mac80211. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tkip.c')
-rw-r--r--net/mac80211/tkip.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index 699807889988..995f7af3d25e 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -164,7 +164,7 @@ void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
iv16 = data[2] | (data[0] << 8);
iv32 = get_unaligned_le32(&data[4]);
- tk = &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY];
+ tk = &key->conf.key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY];
ctx = &key->u.tkip.tx;
#ifdef CONFIG_MAC80211_TKIP_DEBUG
@@ -205,7 +205,7 @@ void ieee80211_tkip_encrypt_data(struct crypto_blkcipher *tfm,
{
u8 rc4key[16];
struct tkip_ctx *ctx = &key->u.tkip.tx;
- const u8 *tk = &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY];
+ const u8 *tk = &key->conf.key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY];
/* Calculate per-packet key */
if (ctx->iv16 == 0 || !ctx->initialized)
@@ -231,7 +231,7 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
u32 iv16;
u8 rc4key[16], keyid, *pos = payload;
int res;
- const u8 *tk = &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY];
+ const u8 *tk = &key->conf.key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY];
if (payload_len < 12)
return -1;
@@ -286,13 +286,13 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
#ifdef CONFIG_MAC80211_TKIP_DEBUG
{
int i;
+ u8 key_offset = NL80211_TKIP_DATA_OFFSET_ENCR_KEY;
DECLARE_MAC_BUF(mac);
printk(KERN_DEBUG "TKIP decrypt: Phase1 TA=%s"
" TK=", print_mac(mac, ta));
for (i = 0; i < 16; i++)
printk("%02x ",
- key->conf.key[
- ALG_TKIP_TEMP_ENCR_KEY + i]);
+ key->conf.key[key_offset + i]);
printk("\n");
printk(KERN_DEBUG "TKIP decrypt: P1K=");
for (i = 0; i < 5; i++)