diff options
Diffstat (limited to 'net/mac80211/tkip.c')
-rw-r--r-- | net/mac80211/tkip.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c index 41621720e560..b9c1d5405180 100644 --- a/net/mac80211/tkip.c +++ b/net/mac80211/tkip.c | |||
@@ -182,7 +182,7 @@ u8 * ieee80211_tkip_add_iv(u8 *pos, struct ieee80211_key *key, | |||
182 | *pos++ = iv0; | 182 | *pos++ = iv0; |
183 | *pos++ = iv1; | 183 | *pos++ = iv1; |
184 | *pos++ = iv2; | 184 | *pos++ = iv2; |
185 | *pos++ = (key->keyidx << 6) | (1 << 5) /* Ext IV */; | 185 | *pos++ = (key->conf.keyidx << 6) | (1 << 5) /* Ext IV */; |
186 | *pos++ = key->u.tkip.iv32 & 0xff; | 186 | *pos++ = key->u.tkip.iv32 & 0xff; |
187 | *pos++ = (key->u.tkip.iv32 >> 8) & 0xff; | 187 | *pos++ = (key->u.tkip.iv32 >> 8) & 0xff; |
188 | *pos++ = (key->u.tkip.iv32 >> 16) & 0xff; | 188 | *pos++ = (key->u.tkip.iv32 >> 16) & 0xff; |
@@ -194,7 +194,7 @@ u8 * ieee80211_tkip_add_iv(u8 *pos, struct ieee80211_key *key, | |||
194 | void ieee80211_tkip_gen_phase1key(struct ieee80211_key *key, u8 *ta, | 194 | void ieee80211_tkip_gen_phase1key(struct ieee80211_key *key, u8 *ta, |
195 | u16 *phase1key) | 195 | u16 *phase1key) |
196 | { | 196 | { |
197 | tkip_mixing_phase1(ta, &key->key[ALG_TKIP_TEMP_ENCR_KEY], | 197 | tkip_mixing_phase1(ta, &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY], |
198 | key->u.tkip.iv32, phase1key); | 198 | key->u.tkip.iv32, phase1key); |
199 | } | 199 | } |
200 | 200 | ||
@@ -204,12 +204,13 @@ void ieee80211_tkip_gen_rc4key(struct ieee80211_key *key, u8 *ta, | |||
204 | /* Calculate per-packet key */ | 204 | /* Calculate per-packet key */ |
205 | if (key->u.tkip.iv16 == 0 || !key->u.tkip.tx_initialized) { | 205 | if (key->u.tkip.iv16 == 0 || !key->u.tkip.tx_initialized) { |
206 | /* IV16 wrapped around - perform TKIP phase 1 */ | 206 | /* IV16 wrapped around - perform TKIP phase 1 */ |
207 | tkip_mixing_phase1(ta, &key->key[ALG_TKIP_TEMP_ENCR_KEY], | 207 | tkip_mixing_phase1(ta, &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY], |
208 | key->u.tkip.iv32, key->u.tkip.p1k); | 208 | key->u.tkip.iv32, key->u.tkip.p1k); |
209 | key->u.tkip.tx_initialized = 1; | 209 | key->u.tkip.tx_initialized = 1; |
210 | } | 210 | } |
211 | 211 | ||
212 | tkip_mixing_phase2(key->u.tkip.p1k, &key->key[ALG_TKIP_TEMP_ENCR_KEY], | 212 | tkip_mixing_phase2(key->u.tkip.p1k, |
213 | &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY], | ||
213 | key->u.tkip.iv16, rc4key); | 214 | key->u.tkip.iv16, rc4key); |
214 | } | 215 | } |
215 | 216 | ||
@@ -266,7 +267,7 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm, | |||
266 | if (!(keyid & (1 << 5))) | 267 | if (!(keyid & (1 << 5))) |
267 | return TKIP_DECRYPT_NO_EXT_IV; | 268 | return TKIP_DECRYPT_NO_EXT_IV; |
268 | 269 | ||
269 | if ((keyid >> 6) != key->keyidx) | 270 | if ((keyid >> 6) != key->conf.keyidx) |
270 | return TKIP_DECRYPT_INVALID_KEYIDX; | 271 | return TKIP_DECRYPT_INVALID_KEYIDX; |
271 | 272 | ||
272 | if (key->u.tkip.rx_initialized[queue] && | 273 | if (key->u.tkip.rx_initialized[queue] && |
@@ -293,7 +294,7 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm, | |||
293 | key->u.tkip.iv32_rx[queue] != iv32) { | 294 | key->u.tkip.iv32_rx[queue] != iv32) { |
294 | key->u.tkip.rx_initialized[queue] = 1; | 295 | key->u.tkip.rx_initialized[queue] = 1; |
295 | /* IV16 wrapped around - perform TKIP phase 1 */ | 296 | /* IV16 wrapped around - perform TKIP phase 1 */ |
296 | tkip_mixing_phase1(ta, &key->key[ALG_TKIP_TEMP_ENCR_KEY], | 297 | tkip_mixing_phase1(ta, &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY], |
297 | iv32, key->u.tkip.p1k_rx[queue]); | 298 | iv32, key->u.tkip.p1k_rx[queue]); |
298 | #ifdef CONFIG_TKIP_DEBUG | 299 | #ifdef CONFIG_TKIP_DEBUG |
299 | { | 300 | { |
@@ -302,7 +303,8 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm, | |||
302 | " TK=", MAC_ARG(ta)); | 303 | " TK=", MAC_ARG(ta)); |
303 | for (i = 0; i < 16; i++) | 304 | for (i = 0; i < 16; i++) |
304 | printk("%02x ", | 305 | printk("%02x ", |
305 | key->key[ALG_TKIP_TEMP_ENCR_KEY + i]); | 306 | key->conf.key[ |
307 | ALG_TKIP_TEMP_ENCR_KEY + i]); | ||
306 | printk("\n"); | 308 | printk("\n"); |
307 | printk(KERN_DEBUG "TKIP decrypt: P1K="); | 309 | printk(KERN_DEBUG "TKIP decrypt: P1K="); |
308 | for (i = 0; i < 5; i++) | 310 | for (i = 0; i < 5; i++) |
@@ -313,7 +315,7 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm, | |||
313 | } | 315 | } |
314 | 316 | ||
315 | tkip_mixing_phase2(key->u.tkip.p1k_rx[queue], | 317 | tkip_mixing_phase2(key->u.tkip.p1k_rx[queue], |
316 | &key->key[ALG_TKIP_TEMP_ENCR_KEY], | 318 | &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY], |
317 | iv16, rc4key); | 319 | iv16, rc4key); |
318 | #ifdef CONFIG_TKIP_DEBUG | 320 | #ifdef CONFIG_TKIP_DEBUG |
319 | { | 321 | { |