aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wep.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/wep.c')
-rw-r--r--net/mac80211/wep.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index 6675261e958f..cc806d640f7a 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
@@ -138,9 +138,7 @@ void ieee80211_wep_encrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key,
138 *icv = cpu_to_le32(~crc32_le(~0, data, data_len)); 138 *icv = cpu_to_le32(~crc32_le(~0, data, data_len));
139 139
140 crypto_blkcipher_setkey(tfm, rc4key, klen); 140 crypto_blkcipher_setkey(tfm, rc4key, klen);
141 sg.page = virt_to_page(data); 141 sg_init_one(&sg, data, data_len + WEP_ICV_LEN);
142 sg.offset = offset_in_page(data);
143 sg.length = data_len + WEP_ICV_LEN;
144 crypto_blkcipher_encrypt(&desc, &sg, &sg, sg.length); 142 crypto_blkcipher_encrypt(&desc, &sg, &sg, sg.length);
145} 143}
146 144
@@ -204,9 +202,7 @@ int ieee80211_wep_decrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key,
204 __le32 crc; 202 __le32 crc;
205 203
206 crypto_blkcipher_setkey(tfm, rc4key, klen); 204 crypto_blkcipher_setkey(tfm, rc4key, klen);
207 sg.page = virt_to_page(data); 205 sg_init_one(&sg, data, data_len + WEP_ICV_LEN);
208 sg.offset = offset_in_page(data);
209 sg.length = data_len + WEP_ICV_LEN;
210 crypto_blkcipher_decrypt(&desc, &sg, &sg, sg.length); 206 crypto_blkcipher_decrypt(&desc, &sg, &sg, sg.length);
211 207
212 crc = cpu_to_le32(~crc32_le(~0, data, data_len)); 208 crc = cpu_to_le32(~crc32_le(~0, data, data_len));