> @@ -603,30 +605,38 @@ static int nl80211_set_key(struct sk_buf > int err; > struct net_device *dev; > u8 key_idx; > + int (*func)(struct wiphy *wiphy, struct net_device *netdev, > + u8 key_index); > > if (!info->attrs[NL80211_ATTR_KEY_IDX]) > return -EINVAL; > > key_idx = nla_get_u8(info->attrs[NL80211_ATTR_KEY_IDX]); > > - if (key_idx > 3) > + if (key_idx > 5) > return -EINVAL; > > /* currently only support setting default key */ > - if (!info->attrs[NL80211_ATTR_KEY_DEFAULT]) > + if (!info->attrs[NL80211_ATTR_KEY_DEFAULT] && > + !info->attrs[NL80211_ATTR_KEY_DEFAULT_MGMT]) > return -EINVAL; I think this should probably check the key index depending on the type, i.e. only permit 4 and 5 for mgmt and 0-3 for data keys. johannes
Attachment:
signature.asc
Description: This is a digitally signed message part