}
static int nl80211_crypto_settings(struct genl_info *info,
- struct cfg80211_crypto_settings *settings)
+ struct cfg80211_crypto_settings *settings,
+ int cipher_limit)
{
settings->control_port = info->attrs[NL80211_ATTR_CONTROL_PORT];
if (len % sizeof(u32))
return -EINVAL;
- if (settings->n_ciphers_pairwise > NL80211_MAX_NR_CIPHER_SUITES)
+ if (settings->n_ciphers_pairwise > cipher_limit)
return -EINVAL;
memcpy(settings->ciphers_pairwise, data, len);
}
}
- err = nl80211_crypto_settings(info, &crypto);
+ err = nl80211_crypto_settings(info, &crypto, 1);
if (!err)
err = cfg80211_mlme_assoc(rdev, dev, chan, bssid, ssid,
ssid_len, ie, ie_len, use_mfp,
connect.privacy = info->attrs[NL80211_ATTR_PRIVACY];
- err = nl80211_crypto_settings(info, &connect.crypto);
+ err = nl80211_crypto_settings(info, &connect.crypto,
+ NL80211_MAX_NR_CIPHER_SUITES);
if (err)
return err;
rtnl_lock();