diff options
-rw-r--r-- | net/wireless/nl80211.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 37902a54e9c1..bb5b78eebeb2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3572,6 +3572,21 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info) | |||
3572 | if (err) | 3572 | if (err) |
3573 | goto unlock_rtnl; | 3573 | goto unlock_rtnl; |
3574 | 3574 | ||
3575 | if (key.idx >= 0) { | ||
3576 | int i; | ||
3577 | bool ok = false; | ||
3578 | for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) { | ||
3579 | if (key.p.cipher == rdev->wiphy.cipher_suites[i]) { | ||
3580 | ok = true; | ||
3581 | break; | ||
3582 | } | ||
3583 | } | ||
3584 | if (!ok) { | ||
3585 | err = -EINVAL; | ||
3586 | goto out; | ||
3587 | } | ||
3588 | } | ||
3589 | |||
3575 | if (!rdev->ops->auth) { | 3590 | if (!rdev->ops->auth) { |
3576 | err = -EOPNOTSUPP; | 3591 | err = -EOPNOTSUPP; |
3577 | goto out; | 3592 | goto out; |