* to IEEE80211_KEYIX_NONE when deleting a unicast key.
*/
struct ieee80211req_del_key {
+ /* NB: This is different to ieee80211_keyix_t, but this is OK as
+ * values are unique over the low order bits. */
u_int8_t idk_keyix; /* key index */
u_int8_t idk_macaddr[IEEE80211_ADDR_LEN];
};
if (ni == NULL)
return -ENOENT;
wk = &ni->ni_ucastkey;
+ } else if (((uint8_t)IEEE80211_KEYIX_NONE <= kix) &&
+ (kix < IEEE80211_KEYIX_NONE)) {
+ /* These values must never be used as they are ambiguous as
+ * some of the API uses 8-bit integers for keyix. */
+ return -EINVAL;
} else {
if (kix >= IEEE80211_WEP_NKID)
return -EINVAL;
if (ni == NULL)
return -ENOENT;
wk = &ni->ni_ucastkey;
+ } else if (((uint8_t)IEEE80211_KEYIX_NONE <= kix) &&
+ (kix < IEEE80211_KEYIX_NONE)) {
+ /* These values must never be used as they are ambiguous as
+ * some of the API uses 8-bit integers for keyix. */
+ return -EINVAL;
} else {
if (kix >= IEEE80211_WEP_NKID)
return -EINVAL;
ieee80211_keyix_t kix;
kix = dk->idk_keyix;
- if (dk->idk_keyix == (u_int8_t) IEEE80211_KEYIX_NONE)
+ if (dk->idk_keyix == (u_int8_t)IEEE80211_KEYIX_NONE)
kix = IEEE80211_KEYIX_NONE;
if (kix == IEEE80211_KEYIX_NONE) {