Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afea0b7a authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

cfg80211: check if WEP is available for shared key auth



When shared key auth is requested, cfg80211
should verify that the device is capable of
WEP crypto which is required.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5daa8a8e
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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;