diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-06-04 11:06:23 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-06-23 05:05:31 -0400 |
commit | ba9030c20a2def223d9b993cb3dfdd3aab3d2b31 (patch) | |
tree | 8256d324629c79986a117d1a28474b99370e1829 /net/mac80211/wep.c | |
parent | b314c669905cbef00fed33028c61c96efeea08f5 (diff) |
mac80211: remove weak WEP IV accounting
Since WEP is practically dead, there seems very little
point in keeping WEP weak IV accounting.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/wep.c')
-rw-r--r-- | net/mac80211/wep.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index 6ee2b5863572..9181fb6d6437 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
@@ -271,22 +271,6 @@ static int ieee80211_wep_decrypt(struct ieee80211_local *local, | |||
271 | return ret; | 271 | return ret; |
272 | } | 272 | } |
273 | 273 | ||
274 | |||
275 | static bool ieee80211_wep_is_weak_iv(struct sk_buff *skb, | ||
276 | struct ieee80211_key *key) | ||
277 | { | ||
278 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | ||
279 | unsigned int hdrlen; | ||
280 | u8 *ivpos; | ||
281 | u32 iv; | ||
282 | |||
283 | hdrlen = ieee80211_hdrlen(hdr->frame_control); | ||
284 | ivpos = skb->data + hdrlen; | ||
285 | iv = (ivpos[0] << 16) | (ivpos[1] << 8) | ivpos[2]; | ||
286 | |||
287 | return ieee80211_wep_weak_iv(iv, key->conf.keylen); | ||
288 | } | ||
289 | |||
290 | ieee80211_rx_result | 274 | ieee80211_rx_result |
291 | ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx) | 275 | ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx) |
292 | { | 276 | { |
@@ -301,16 +285,12 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx) | |||
301 | if (!(status->flag & RX_FLAG_DECRYPTED)) { | 285 | if (!(status->flag & RX_FLAG_DECRYPTED)) { |
302 | if (skb_linearize(rx->skb)) | 286 | if (skb_linearize(rx->skb)) |
303 | return RX_DROP_UNUSABLE; | 287 | return RX_DROP_UNUSABLE; |
304 | if (rx->sta && ieee80211_wep_is_weak_iv(rx->skb, rx->key)) | ||
305 | rx->sta->wep_weak_iv_count++; | ||
306 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) | 288 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) |
307 | return RX_DROP_UNUSABLE; | 289 | return RX_DROP_UNUSABLE; |
308 | } else if (!(status->flag & RX_FLAG_IV_STRIPPED)) { | 290 | } else if (!(status->flag & RX_FLAG_IV_STRIPPED)) { |
309 | if (!pskb_may_pull(rx->skb, ieee80211_hdrlen(fc) + | 291 | if (!pskb_may_pull(rx->skb, ieee80211_hdrlen(fc) + |
310 | IEEE80211_WEP_IV_LEN)) | 292 | IEEE80211_WEP_IV_LEN)) |
311 | return RX_DROP_UNUSABLE; | 293 | return RX_DROP_UNUSABLE; |
312 | if (rx->sta && ieee80211_wep_is_weak_iv(rx->skb, rx->key)) | ||
313 | rx->sta->wep_weak_iv_count++; | ||
314 | ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key); | 294 | ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key); |
315 | /* remove ICV */ | 295 | /* remove ICV */ |
316 | if (pskb_trim(rx->skb, rx->skb->len - IEEE80211_WEP_ICV_LEN)) | 296 | if (pskb_trim(rx->skb, rx->skb->len - IEEE80211_WEP_ICV_LEN)) |