mac80211: check RX crypto for sta key
Johannes Berg
maintainerPATCH 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.
Reported-by Juuso Oikarinen <[email protected]>
Tested-by Juuso Oikarinen <[email protected]>
Signed-off-by Johannes Berg <[email protected]>
--- 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 ;