summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2008-06-28 02:50:13 +0300
committerJohn W. Linville <linville@tuxdriver.com>2008-06-30 15:43:53 -0400
commit23976efedd5ecb420b87455787c537eb4aed1981 (patch)
tree902550e2716af5682de8219da1f228e13a5f0adb /net
parent1bcca3c463e4930cef9986b05165bb0b3eb46f63 (diff)
downloadop-kernel-dev-23976efedd5ecb420b87455787c537eb4aed1981.zip
op-kernel-dev-23976efedd5ecb420b87455787c537eb4aed1981.tar.gz
mac80211: don't accept WEP keys other than WEP40 and WEP104
This patch makes mac80211 refuse a WEP key whose length is not WEP40 nor WEP104. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/wext.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 6106cb7..e840421 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -95,6 +95,13 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr,
}
}
+ if (alg == ALG_WEP &&
+ key_len != LEN_WEP40 && key_len != LEN_WEP104) {
+ ieee80211_key_free(key);
+ err = -EINVAL;
+ goto out_unlock;
+ }
+
ieee80211_key_link(key, sdata, sta);
if (set_tx_key || (!sta && !sdata->default_key && key))
OpenPOWER on IntegriCloud