diff options
Diffstat (limited to 'net/ieee80211/ieee80211_crypt_tkip.c')
-rw-r--r-- | net/ieee80211/ieee80211_crypt_tkip.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c index bba0152e2d71..d12da1da6328 100644 --- a/net/ieee80211/ieee80211_crypt_tkip.c +++ b/net/ieee80211/ieee80211_crypt_tkip.c | |||
@@ -359,15 +359,13 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
359 | u8 rc4key[16], *pos, *icv; | 359 | u8 rc4key[16], *pos, *icv; |
360 | u32 crc; | 360 | u32 crc; |
361 | struct scatterlist sg; | 361 | struct scatterlist sg; |
362 | DECLARE_MAC_BUF(mac); | ||
363 | 362 | ||
364 | if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { | 363 | if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { |
365 | if (net_ratelimit()) { | 364 | if (net_ratelimit()) { |
366 | struct ieee80211_hdr_4addr *hdr = | 365 | struct ieee80211_hdr_4addr *hdr = |
367 | (struct ieee80211_hdr_4addr *)skb->data; | 366 | (struct ieee80211_hdr_4addr *)skb->data; |
368 | printk(KERN_DEBUG ": TKIP countermeasures: dropped " | 367 | printk(KERN_DEBUG ": TKIP countermeasures: dropped " |
369 | "TX packet to %s\n", | 368 | "TX packet to %pM\n", hdr->addr1); |
370 | print_mac(mac, hdr->addr1)); | ||
371 | } | 369 | } |
372 | return -1; | 370 | return -1; |
373 | } | 371 | } |
@@ -420,15 +418,13 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
420 | u32 crc; | 418 | u32 crc; |
421 | struct scatterlist sg; | 419 | struct scatterlist sg; |
422 | int plen; | 420 | int plen; |
423 | DECLARE_MAC_BUF(mac); | ||
424 | 421 | ||
425 | hdr = (struct ieee80211_hdr_4addr *)skb->data; | 422 | hdr = (struct ieee80211_hdr_4addr *)skb->data; |
426 | 423 | ||
427 | if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { | 424 | if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { |
428 | if (net_ratelimit()) { | 425 | if (net_ratelimit()) { |
429 | printk(KERN_DEBUG ": TKIP countermeasures: dropped " | 426 | printk(KERN_DEBUG ": TKIP countermeasures: dropped " |
430 | "received packet from %s\n", | 427 | "received packet from %pM\n", hdr->addr2); |
431 | print_mac(mac, hdr->addr2)); | ||
432 | } | 428 | } |
433 | return -1; | 429 | return -1; |
434 | } | 430 | } |
@@ -441,7 +437,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
441 | if (!(keyidx & (1 << 5))) { | 437 | if (!(keyidx & (1 << 5))) { |
442 | if (net_ratelimit()) { | 438 | if (net_ratelimit()) { |
443 | printk(KERN_DEBUG "TKIP: received packet without ExtIV" | 439 | printk(KERN_DEBUG "TKIP: received packet without ExtIV" |
444 | " flag from %s\n", print_mac(mac, hdr->addr2)); | 440 | " flag from %pM\n", hdr->addr2); |
445 | } | 441 | } |
446 | return -2; | 442 | return -2; |
447 | } | 443 | } |
@@ -453,9 +449,9 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
453 | } | 449 | } |
454 | if (!tkey->key_set) { | 450 | if (!tkey->key_set) { |
455 | if (net_ratelimit()) { | 451 | if (net_ratelimit()) { |
456 | printk(KERN_DEBUG "TKIP: received packet from %s" | 452 | printk(KERN_DEBUG "TKIP: received packet from %pM" |
457 | " with keyid=%d that does not have a configured" | 453 | " with keyid=%d that does not have a configured" |
458 | " key\n", print_mac(mac, hdr->addr2), keyidx); | 454 | " key\n", hdr->addr2, keyidx); |
459 | } | 455 | } |
460 | return -3; | 456 | return -3; |
461 | } | 457 | } |
@@ -465,9 +461,9 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
465 | 461 | ||
466 | if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { | 462 | if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { |
467 | if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { | 463 | if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { |
468 | IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s" | 464 | IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%pM" |
469 | " previous TSC %08x%04x received TSC " | 465 | " previous TSC %08x%04x received TSC " |
470 | "%08x%04x\n", print_mac(mac, hdr->addr2), | 466 | "%08x%04x\n", hdr->addr2, |
471 | tkey->rx_iv32, tkey->rx_iv16, iv32, iv16); | 467 | tkey->rx_iv32, tkey->rx_iv16, iv32, iv16); |
472 | } | 468 | } |
473 | tkey->dot11RSNAStatsTKIPReplays++; | 469 | tkey->dot11RSNAStatsTKIPReplays++; |
@@ -487,8 +483,8 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
487 | if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) { | 483 | if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) { |
488 | if (net_ratelimit()) { | 484 | if (net_ratelimit()) { |
489 | printk(KERN_DEBUG ": TKIP: failed to decrypt " | 485 | printk(KERN_DEBUG ": TKIP: failed to decrypt " |
490 | "received packet from %s\n", | 486 | "received packet from %pM\n", |
491 | print_mac(mac, hdr->addr2)); | 487 | hdr->addr2); |
492 | } | 488 | } |
493 | return -7; | 489 | return -7; |
494 | } | 490 | } |
@@ -506,7 +502,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
506 | } | 502 | } |
507 | if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { | 503 | if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { |
508 | IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA=" | 504 | IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA=" |
509 | "%s\n", print_mac(mac, hdr->addr2)); | 505 | "%pM\n", hdr->addr2); |
510 | } | 506 | } |
511 | tkey->dot11RSNAStatsTKIPICVErrors++; | 507 | tkey->dot11RSNAStatsTKIPICVErrors++; |
512 | return -5; | 508 | return -5; |
@@ -633,7 +629,6 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, | |||
633 | { | 629 | { |
634 | struct ieee80211_tkip_data *tkey = priv; | 630 | struct ieee80211_tkip_data *tkey = priv; |
635 | u8 mic[8]; | 631 | u8 mic[8]; |
636 | DECLARE_MAC_BUF(mac); | ||
637 | 632 | ||
638 | if (!tkey->key_set) | 633 | if (!tkey->key_set) |
639 | return -1; | 634 | return -1; |
@@ -646,8 +641,8 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, | |||
646 | struct ieee80211_hdr_4addr *hdr; | 641 | struct ieee80211_hdr_4addr *hdr; |
647 | hdr = (struct ieee80211_hdr_4addr *)skb->data; | 642 | hdr = (struct ieee80211_hdr_4addr *)skb->data; |
648 | printk(KERN_DEBUG "%s: Michael MIC verification failed for " | 643 | printk(KERN_DEBUG "%s: Michael MIC verification failed for " |
649 | "MSDU from %s keyidx=%d\n", | 644 | "MSDU from %pM keyidx=%d\n", |
650 | skb->dev ? skb->dev->name : "N/A", print_mac(mac, hdr->addr2), | 645 | skb->dev ? skb->dev->name : "N/A", hdr->addr2, |
651 | keyidx); | 646 | keyidx); |
652 | if (skb->dev) | 647 | if (skb->dev) |
653 | ieee80211_michael_mic_failure(skb->dev, hdr, keyidx); | 648 | ieee80211_michael_mic_failure(skb->dev, hdr, keyidx); |