X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fmac80211%2Fwext.c;h=e8404212ad57ecdfda2df597a9725c73278627b4;hb=fca515fbfa5ecd9f7b54db311317e2c877d7831a;hp=6106cb79060c928f65e7d5a5d2154f280b55bf5f;hpb=bec95aab8c056ab490fe7fa54da822938562443d;p=linux-2.6 diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 6106cb7906..e8404212ad 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))