|
@@ -218,7 +218,7 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
|
|
|
struct key_params *params, int key_idx,
|
|
|
bool pairwise, const u8 *mac_addr)
|
|
|
{
|
|
|
- if (key_idx > 5)
|
|
|
+ if (key_idx < 0 || key_idx > 5)
|
|
|
return -EINVAL;
|
|
|
|
|
|
if (!pairwise && mac_addr && !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
|
|
@@ -249,7 +249,13 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
|
|
|
/* Disallow BIP (group-only) cipher as pairwise cipher */
|
|
|
if (pairwise)
|
|
|
return -EINVAL;
|
|
|
+ if (key_idx < 4)
|
|
|
+ return -EINVAL;
|
|
|
break;
|
|
|
+ case WLAN_CIPHER_SUITE_WEP40:
|
|
|
+ case WLAN_CIPHER_SUITE_WEP104:
|
|
|
+ if (key_idx > 3)
|
|
|
+ return -EINVAL;
|
|
|
default:
|
|
|
break;
|
|
|
}
|