diff options
Diffstat (limited to 'net/mac80211/wpa.c')
-rw-r--r-- | net/mac80211/wpa.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 0adbcc941ac9..8d59d27d887e 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -183,9 +183,8 @@ static int tkip_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
183 | skb_put(skb, TKIP_ICV_LEN); | 183 | skb_put(skb, TKIP_ICV_LEN); |
184 | 184 | ||
185 | hdr = (struct ieee80211_hdr *) skb->data; | 185 | hdr = (struct ieee80211_hdr *) skb->data; |
186 | ieee80211_tkip_encrypt_data(tx->local->wep_tx_tfm, | 186 | return ieee80211_tkip_encrypt_data(tx->local->wep_tx_tfm, |
187 | key, pos, len, hdr->addr2); | 187 | key, pos, len, hdr->addr2); |
188 | return 0; | ||
189 | } | 188 | } |
190 | 189 | ||
191 | 190 | ||
@@ -436,6 +435,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) | |||
436 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | 435 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); |
437 | u8 pn[CCMP_PN_LEN]; | 436 | u8 pn[CCMP_PN_LEN]; |
438 | int data_len; | 437 | int data_len; |
438 | int queue; | ||
439 | 439 | ||
440 | hdrlen = ieee80211_hdrlen(hdr->frame_control); | 440 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
441 | 441 | ||
@@ -453,7 +453,10 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) | |||
453 | 453 | ||
454 | ccmp_hdr2pn(pn, skb->data + hdrlen); | 454 | ccmp_hdr2pn(pn, skb->data + hdrlen); |
455 | 455 | ||
456 | if (memcmp(pn, key->u.ccmp.rx_pn[rx->queue], CCMP_PN_LEN) <= 0) { | 456 | queue = ieee80211_is_mgmt(hdr->frame_control) ? |
457 | NUM_RX_DATA_QUEUES : rx->queue; | ||
458 | |||
459 | if (memcmp(pn, key->u.ccmp.rx_pn[queue], CCMP_PN_LEN) <= 0) { | ||
457 | key->u.ccmp.replays++; | 460 | key->u.ccmp.replays++; |
458 | return RX_DROP_UNUSABLE; | 461 | return RX_DROP_UNUSABLE; |
459 | } | 462 | } |
@@ -470,7 +473,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) | |||
470 | return RX_DROP_UNUSABLE; | 473 | return RX_DROP_UNUSABLE; |
471 | } | 474 | } |
472 | 475 | ||
473 | memcpy(key->u.ccmp.rx_pn[rx->queue], pn, CCMP_PN_LEN); | 476 | memcpy(key->u.ccmp.rx_pn[queue], pn, CCMP_PN_LEN); |
474 | 477 | ||
475 | /* Remove CCMP header and MIC */ | 478 | /* Remove CCMP header and MIC */ |
476 | skb_trim(skb, skb->len - CCMP_MIC_LEN); | 479 | skb_trim(skb, skb->len - CCMP_MIC_LEN); |