Skip to content

Commit

Permalink
cfg80211: check if WEP is available for shared key auth
Browse files Browse the repository at this point in the history
When shared key auth is requested, cfg80211
should verify that the device is capable of
WEP crypto which is required.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Aug 16, 2010
1 parent 5daa8a8 commit afea0b7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3572,6 +3572,21 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
if (err)
goto unlock_rtnl;

if (key.idx >= 0) {
int i;
bool ok = false;
for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) {
if (key.p.cipher == rdev->wiphy.cipher_suites[i]) {
ok = true;
break;
}
}
if (!ok) {
err = -EINVAL;
goto out;
}
}

if (!rdev->ops->auth) {
err = -EOPNOTSUPP;
goto out;
Expand Down

0 comments on commit afea0b7

Please sign in to comment.