aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tkip.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2008-03-20 09:06:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-25 16:41:53 -0400
commit9ae4fda332df616ef47d5bb710c39681641d4303 (patch)
tree7cecfed1dfac8e6fdf7e33957d7da7767a35619c /net/mac80211/tkip.c
parent5d2cdcd4e85c5187db30a6b29f79fbbe59f39f78 (diff)
mac80211: allows driver to request a Phase 1 RX key
This patch makes mac80211 able to send a phase1 key for TKIP decryption. This is needed for drivers that don't do the rekeying by themselves (i.e. iwlwifi). Upon IV16 wrap around, the packet is decrypted in SW, if decryption is ok, mac80211 calls to update_tkip_key with a new phase 1 RX key. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tkip.c')
-rw-r--r--net/mac80211/tkip.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index 5c36b2df3faf..45d59f19c29f 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -291,7 +291,7 @@ void ieee80211_tkip_encrypt_data(struct crypto_blkcipher *tfm,
291int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm, 291int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
292 struct ieee80211_key *key, 292 struct ieee80211_key *key,
293 u8 *payload, size_t payload_len, u8 *ta, 293 u8 *payload, size_t payload_len, u8 *ta,
294 int only_iv, int queue, 294 u8 *ra, int only_iv, int queue,
295 u32 *out_iv32, u16 *out_iv16) 295 u32 *out_iv32, u16 *out_iv16)
296{ 296{
297 u32 iv32; 297 u32 iv32;
@@ -368,6 +368,19 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
368 printk("\n"); 368 printk("\n");
369 } 369 }
370#endif /* CONFIG_TKIP_DEBUG */ 370#endif /* CONFIG_TKIP_DEBUG */
371 if (key->local->ops->update_tkip_key &&
372 key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
373 u8 bcast[ETH_ALEN] =
374 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
375 u8 *sta_addr = key->sta->addr;
376
377 if (is_multicast_ether_addr(ra))
378 sta_addr = bcast;
379
380 key->local->ops->update_tkip_key(
381 local_to_hw(key->local), &key->conf,
382 sta_addr, iv32, key->u.tkip.p1k_rx[queue]);
383 }
371 } 384 }
372 385
373 tkip_mixing_phase2(key->u.tkip.p1k_rx[queue], 386 tkip_mixing_phase2(key->u.tkip.p1k_rx[queue],