Skip to contentSkip to conversation

mac80211: check RX crypto for sta key

PATCH New Johannes Berg 1 participant 1 message Aug 12, 2010 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: check RX crypto for sta key

From: Johannes Berg <[email protected]>

My previous patch removing decrypted && iv-stripped checks from the crypto algorithms turned out to be completely wrong since in the common case of using a per-station key the check wasn't there. Rather than revert it, add a check to this case so that the crypto algorithms don't need to be able to deal with already decrypted and verified frames.

---
 net/mac80211/rx.c |    3 +++
 1 file changed, 3 insertions(+)
net/mac80211/rx.c +3 -0
@@ -873,6 +873,9 @@ ieee80211_rx_h_decrypt(struct ieee80211_
 
 	if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
 		rx->key = stakey;
+		if ((status->flag & RX_FLAG_DECRYPTED) &&
+		    (status->flag & RX_FLAG_IV_STRIPPED))
+			return RX_CONTINUE;
 		/* Skip decryption if the frame is not protected. */
 		if (!ieee80211_has_protected(fc))
 			return RX_CONTINUE;