• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/drivers/staging/rtl8192u/ieee80211/

Lines Matching refs:tkey

308 	struct ieee80211_tkip_data *tkey = priv;
313 struct blkcipher_desc desc = {.tfm = tkey->tx_tfm_arc4};
327 if (!tkey->tx_phase1_done) {
328 tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2,
329 tkey->tx_iv32);
330 tkey->tx_phase1_done = 1;
332 tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak, tkey->tx_iv16);
335 tkey->tx_phase1_done = 1;
345 *pos++ = Hi8(tkey->tx_iv16);
346 *pos++ = (Hi8(tkey->tx_iv16) | 0x20) & 0x7F;
347 *pos++ = Lo8(tkey->tx_iv16);
356 *pos++ = (tkey->key_idx << 6) | (1 << 5) /* Ext IV included */;
357 *pos++ = tkey->tx_iv32 & 0xff;
358 *pos++ = (tkey->tx_iv32 >> 8) & 0xff;
359 *pos++ = (tkey->tx_iv32 >> 16) & 0xff;
360 *pos++ = (tkey->tx_iv32 >> 24) & 0xff;
370 crypto_blkcipher_setkey(tkey->tx_tfm_arc4, rc4key, 16);
375 tkey->tx_iv16++;
376 if (tkey->tx_iv16 == 0) {
377 tkey->tx_phase1_done = 0;
378 tkey->tx_iv32++;
391 struct ieee80211_tkip_data *tkey = priv;
397 struct blkcipher_desc desc = {.tfm = tkey->rx_tfm_arc4};
417 if (tkey->key_idx != keyidx) {
418 printk(KERN_DEBUG "TKIP: RX tkey->key_idx=%d frame "
419 "keyidx=%d priv=%p\n", tkey->key_idx, keyidx, priv);
422 if (!tkey->key_set) {
436 if (iv32 < tkey->rx_iv32 ||
437 (iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) {
442 tkey->rx_iv32, tkey->rx_iv16, iv32, iv16);
444 tkey->dot11RSNAStatsTKIPReplays++;
448 if (iv32 != tkey->rx_iv32 || !tkey->rx_phase1_done) {
449 tkip_mixing_phase1(tkey->rx_ttak, tkey->key, hdr->addr2, iv32);
450 tkey->rx_phase1_done = 1;
452 tkip_mixing_phase2(rc4key, tkey->key, tkey->rx_ttak, iv16);
456 crypto_blkcipher_setkey(tkey->rx_tfm_arc4, rc4key, 16);
475 if (iv32 != tkey->rx_iv32) {
478 tkey->rx_phase1_done = 0;
484 tkey->dot11RSNAStatsTKIPICVErrors++;
492 tkey->rx_iv32_new = iv32;
493 tkey->rx_iv16_new = iv16;
559 struct ieee80211_tkip_data *tkey = priv;
572 michael_mic_hdr(skb, tkey->tx_hdr);
577 tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07;
582 if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr,
613 struct ieee80211_tkip_data *tkey = priv;
619 if (!tkey->key_set)
622 michael_mic_hdr(skb, tkey->rx_hdr);
626 tkey->rx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07;
630 if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr,
642 tkey->dot11RSNAStatsTKIPLocalMICFailures++;
648 tkey->rx_iv32 = tkey->rx_iv32_new;
649 tkey->rx_iv16 = tkey->rx_iv16_new;
659 struct ieee80211_tkip_data *tkey = priv;
661 struct crypto_hash *tfm = tkey->tx_tfm_michael;
662 struct crypto_blkcipher *tfm2 = tkey->tx_tfm_arc4;
663 struct crypto_hash *tfm3 = tkey->rx_tfm_michael;
664 struct crypto_blkcipher *tfm4 = tkey->rx_tfm_arc4;
666 keyidx = tkey->key_idx;
667 memset(tkey, 0, sizeof(*tkey));
668 tkey->key_idx = keyidx;
669 tkey->tx_tfm_michael = tfm;
670 tkey->tx_tfm_arc4 = tfm2;
671 tkey->rx_tfm_michael = tfm3;
672 tkey->rx_tfm_arc4 = tfm4;
675 memcpy(tkey->key, key, TKIP_KEY_LEN);
676 tkey->key_set = 1;
677 tkey->tx_iv16 = 1; /* TSC is initialized to 1 */
679 tkey->rx_iv32 = (seq[5] << 24) | (seq[4] << 16) |
681 tkey->rx_iv16 = (seq[1] << 8) | seq[0];
684 tkey->key_set = 0;
694 struct ieee80211_tkip_data *tkey = priv;
699 if (!tkey->key_set)
701 memcpy(key, tkey->key, TKIP_KEY_LEN);
705 u16 iv16 = tkey->tx_iv16;
706 u32 iv32 = tkey->tx_iv32;
710 seq[0] = tkey->tx_iv16;
711 seq[1] = tkey->tx_iv16 >> 8;
712 seq[2] = tkey->tx_iv32;
713 seq[3] = tkey->tx_iv32 >> 8;
714 seq[4] = tkey->tx_iv32 >> 16;
715 seq[5] = tkey->tx_iv32 >> 24;