Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150261
b: refs/heads/master
c: 0c7c10c
h: refs/heads/master
i:
  150259: 51ae268
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed May 11, 2009
1 parent f402ea0 commit 06e7fff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 782571f46fc7d2bbb0288ab0d676c47a88449a5c
refs/heads/master: 0c7c10c7cc6bc890d23c8c62b81b4feccd92124b
30 changes: 21 additions & 9 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,15 +630,6 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
* possible.
*/

if (!ieee80211_has_protected(hdr->frame_control)) {
if (!ieee80211_is_mgmt(hdr->frame_control) ||
rx->sta == NULL || !test_sta_flags(rx->sta, WLAN_STA_MFP))
return RX_CONTINUE;
mmie_keyidx = ieee80211_get_mmie_keyidx(rx->skb);
if (mmie_keyidx < 0)
return RX_CONTINUE;
}

/*
* No point in finding a key and decrypting if the frame is neither
* addressed to us nor a multicast frame.
Expand All @@ -649,8 +640,14 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
if (rx->sta)
stakey = rcu_dereference(rx->sta->key);

if (!ieee80211_has_protected(hdr->frame_control))
mmie_keyidx = ieee80211_get_mmie_keyidx(rx->skb);

if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
rx->key = stakey;
/* Skip decryption if the frame is not protected. */
if (!ieee80211_has_protected(hdr->frame_control))
return RX_CONTINUE;
} else if (mmie_keyidx >= 0) {
/* Broadcast/multicast robust management frame / BIP */
if ((rx->status->flag & RX_FLAG_DECRYPTED) &&
Expand All @@ -661,6 +658,21 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
mmie_keyidx >= NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS)
return RX_DROP_MONITOR; /* unexpected BIP keyidx */
rx->key = rcu_dereference(rx->sdata->keys[mmie_keyidx]);
} else if (!ieee80211_has_protected(hdr->frame_control)) {
/*
* The frame was not protected, so skip decryption. However, we
* need to set rx->key if there is a key that could have been
* used so that the frame may be dropped if encryption would
* have been expected.
*/
struct ieee80211_key *key = NULL;
if (ieee80211_is_mgmt(hdr->frame_control) &&
is_multicast_ether_addr(hdr->addr1) &&
(key = rcu_dereference(rx->sdata->default_mgmt_key)))
rx->key = key;
else if ((key = rcu_dereference(rx->sdata->default_key)))
rx->key = key;
return RX_CONTINUE;
} else {
/*
* The device doesn't give us the IV so we won't be
Expand Down

0 comments on commit 06e7fff

Please sign in to comment.