Commit d0833a6a authored by Andriy Tkachuk's avatar Andriy Tkachuk Committed by John W. Linville

lib80211: Cosmetics - make room for MIC/CRC near the actual calculation

Signed-off-by: default avatarAndriy V. Tkachuk <andrit@ukr.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ab5132a2
...@@ -237,7 +237,6 @@ static int lib80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -237,7 +237,6 @@ static int lib80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
return -1; return -1;
pos = skb->data + hdr_len + CCMP_HDR_LEN; pos = skb->data + hdr_len + CCMP_HDR_LEN;
mic = skb_put(skb, CCMP_MIC_LEN);
hdr = (struct ieee80211_hdr *)skb->data; hdr = (struct ieee80211_hdr *)skb->data;
ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, b, s0); ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, b, s0);
...@@ -257,6 +256,7 @@ static int lib80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -257,6 +256,7 @@ static int lib80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
pos += len; pos += len;
} }
mic = skb_put(skb, CCMP_MIC_LEN);
for (i = 0; i < CCMP_MIC_LEN; i++) for (i = 0; i < CCMP_MIC_LEN; i++)
mic[i] = b[i] ^ s0[i]; mic[i] = b[i] ^ s0[i];
......
...@@ -384,9 +384,8 @@ static int lib80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -384,9 +384,8 @@ static int lib80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
if ((lib80211_tkip_hdr(skb, hdr_len, rc4key, 16, priv)) < 0) if ((lib80211_tkip_hdr(skb, hdr_len, rc4key, 16, priv)) < 0)
return -1; return -1;
icv = skb_put(skb, 4);
crc = ~crc32_le(~0, pos, len); crc = ~crc32_le(~0, pos, len);
icv = skb_put(skb, 4);
icv[0] = crc; icv[0] = crc;
icv[1] = crc >> 8; icv[1] = crc >> 8;
icv[2] = crc >> 16; icv[2] = crc >> 16;
......
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