diff options
Diffstat (limited to 'net/mac80211/wpa.c')
-rw-r--r-- | net/mac80211/wpa.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index b48c1e13e281..42ce9bd4426f 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -405,7 +405,7 @@ static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb, | |||
405 | u8 *pos; | 405 | u8 *pos; |
406 | u8 pn[6]; | 406 | u8 pn[6]; |
407 | u64 pn64; | 407 | u64 pn64; |
408 | u8 aad[2 * AES_BLOCK_SIZE]; | 408 | u8 aad[CCM_AAD_LEN]; |
409 | u8 b_0[AES_BLOCK_SIZE]; | 409 | u8 b_0[AES_BLOCK_SIZE]; |
410 | 410 | ||
411 | if (info->control.hw_key && | 411 | if (info->control.hw_key && |
@@ -461,10 +461,8 @@ static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb, | |||
461 | 461 | ||
462 | pos += IEEE80211_CCMP_HDR_LEN; | 462 | pos += IEEE80211_CCMP_HDR_LEN; |
463 | ccmp_special_blocks(skb, pn, b_0, aad); | 463 | ccmp_special_blocks(skb, pn, b_0, aad); |
464 | ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, | 464 | return ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, |
465 | skb_put(skb, mic_len), mic_len); | 465 | skb_put(skb, mic_len), mic_len); |
466 | |||
467 | return 0; | ||
468 | } | 466 | } |
469 | 467 | ||
470 | 468 | ||
@@ -639,7 +637,7 @@ static int gcmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
639 | u8 *pos; | 637 | u8 *pos; |
640 | u8 pn[6]; | 638 | u8 pn[6]; |
641 | u64 pn64; | 639 | u64 pn64; |
642 | u8 aad[2 * AES_BLOCK_SIZE]; | 640 | u8 aad[GCM_AAD_LEN]; |
643 | u8 j_0[AES_BLOCK_SIZE]; | 641 | u8 j_0[AES_BLOCK_SIZE]; |
644 | 642 | ||
645 | if (info->control.hw_key && | 643 | if (info->control.hw_key && |
@@ -696,10 +694,8 @@ static int gcmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
696 | 694 | ||
697 | pos += IEEE80211_GCMP_HDR_LEN; | 695 | pos += IEEE80211_GCMP_HDR_LEN; |
698 | gcmp_special_blocks(skb, pn, j_0, aad); | 696 | gcmp_special_blocks(skb, pn, j_0, aad); |
699 | ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, | 697 | return ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, |
700 | skb_put(skb, IEEE80211_GCMP_MIC_LEN)); | 698 | skb_put(skb, IEEE80211_GCMP_MIC_LEN)); |
701 | |||
702 | return 0; | ||
703 | } | 699 | } |
704 | 700 | ||
705 | ieee80211_tx_result | 701 | ieee80211_tx_result |
@@ -1123,9 +1119,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx) | |||
1123 | struct ieee80211_key *key = tx->key; | 1119 | struct ieee80211_key *key = tx->key; |
1124 | struct ieee80211_mmie_16 *mmie; | 1120 | struct ieee80211_mmie_16 *mmie; |
1125 | struct ieee80211_hdr *hdr; | 1121 | struct ieee80211_hdr *hdr; |
1126 | u8 aad[20]; | 1122 | u8 aad[GMAC_AAD_LEN]; |
1127 | u64 pn64; | 1123 | u64 pn64; |
1128 | u8 nonce[12]; | 1124 | u8 nonce[GMAC_NONCE_LEN]; |
1129 | 1125 | ||
1130 | if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) | 1126 | if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) |
1131 | return TX_DROP; | 1127 | return TX_DROP; |
@@ -1171,7 +1167,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx) | |||
1171 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | 1167 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); |
1172 | struct ieee80211_key *key = rx->key; | 1168 | struct ieee80211_key *key = rx->key; |
1173 | struct ieee80211_mmie_16 *mmie; | 1169 | struct ieee80211_mmie_16 *mmie; |
1174 | u8 aad[20], mic[16], ipn[6], nonce[12]; | 1170 | u8 aad[GMAC_AAD_LEN], mic[GMAC_MIC_LEN], ipn[6], nonce[GMAC_NONCE_LEN]; |
1175 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1171 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1176 | 1172 | ||
1177 | if (!ieee80211_is_mgmt(hdr->frame_control)) | 1173 | if (!ieee80211_is_mgmt(hdr->frame_control)) |