diff options
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 85b5aa3c76f8..d33cab0e0fb2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -208,6 +208,10 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | |||
208 | NLA_PUT_U16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN, | 208 | NLA_PUT_U16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN, |
209 | dev->wiphy.max_scan_ie_len); | 209 | dev->wiphy.max_scan_ie_len); |
210 | 210 | ||
211 | NLA_PUT(msg, NL80211_ATTR_CIPHER_SUITES, | ||
212 | sizeof(u32) * dev->wiphy.n_cipher_suites, | ||
213 | dev->wiphy.cipher_suites); | ||
214 | |||
211 | nl_modes = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_IFTYPES); | 215 | nl_modes = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_IFTYPES); |
212 | if (!nl_modes) | 216 | if (!nl_modes) |
213 | goto nla_put_failure; | 217 | goto nla_put_failure; |
@@ -979,7 +983,7 @@ static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info) | |||
979 | static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info) | 983 | static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info) |
980 | { | 984 | { |
981 | struct cfg80211_registered_device *drv; | 985 | struct cfg80211_registered_device *drv; |
982 | int err; | 986 | int err, i; |
983 | struct net_device *dev; | 987 | struct net_device *dev; |
984 | struct key_params params; | 988 | struct key_params params; |
985 | u8 key_idx = 0; | 989 | u8 key_idx = 0; |
@@ -1048,6 +1052,14 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info) | |||
1048 | if (err) | 1052 | if (err) |
1049 | goto unlock_rtnl; | 1053 | goto unlock_rtnl; |
1050 | 1054 | ||
1055 | for (i = 0; i < drv->wiphy.n_cipher_suites; i++) | ||
1056 | if (params.cipher == drv->wiphy.cipher_suites[i]) | ||
1057 | break; | ||
1058 | if (i == drv->wiphy.n_cipher_suites) { | ||
1059 | err = -EINVAL; | ||
1060 | goto out; | ||
1061 | } | ||
1062 | |||
1051 | if (!drv->ops->add_key) { | 1063 | if (!drv->ops->add_key) { |
1052 | err = -EOPNOTSUPP; | 1064 | err = -EOPNOTSUPP; |
1053 | goto out; | 1065 | goto out; |