nl80211: Extended Key ID support
Add key configuration parameters needed to support Extended Key ID with pairwise keys. Add a driver capability flag to indicate support forusing this. Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
This commit is contained in:
parent
a1afa2df8a
commit
ac22241532
4 changed files with 23 additions and 2 deletions
|
@ -1841,6 +1841,8 @@ struct wpa_driver_capa {
|
|||
#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
|
||||
/** Driver supports Beacon protection */
|
||||
#define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
|
||||
/** Driver supports Extended Key ID */
|
||||
#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
|
||||
u64 flags;
|
||||
|
||||
#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
|
||||
|
|
|
@ -315,6 +315,7 @@ const char * driver_flag_to_string(u64 flag)
|
|||
DF2S(UPDATE_FT_IES);
|
||||
DF2S(SAFE_PTK0_REKEYS);
|
||||
DF2S(BEACON_PROTECTION);
|
||||
DF2S(EXTENDED_KEY_ID);
|
||||
}
|
||||
return "UNKNOWN";
|
||||
#undef DF2S
|
||||
|
|
|
@ -3105,7 +3105,12 @@ static int wpa_driver_nl80211_set_key(struct i802_bss *bss,
|
|||
if (!key_msg)
|
||||
return ret;
|
||||
|
||||
if (alg == WPA_ALG_NONE && (key_flag & KEY_FLAG_RX_TX)) {
|
||||
if ((key_flag & KEY_FLAG_PAIRWISE_MASK) ==
|
||||
KEY_FLAG_PAIRWISE_RX_TX_MODIFY) {
|
||||
msg = nl80211_ifindex_msg(drv, ifindex, 0, NL80211_CMD_SET_KEY);
|
||||
if (!msg)
|
||||
goto fail2;
|
||||
} else if (alg == WPA_ALG_NONE && (key_flag & KEY_FLAG_RX_TX)) {
|
||||
wpa_printf(MSG_DEBUG, "%s: invalid key_flag to delete key",
|
||||
__func__);
|
||||
ret = -EINVAL;
|
||||
|
@ -3143,7 +3148,16 @@ static int wpa_driver_nl80211_set_key(struct i802_bss *bss,
|
|||
if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr))
|
||||
goto fail;
|
||||
|
||||
if ((key_flag & KEY_FLAG_GROUP_MASK) == KEY_FLAG_GROUP_RX) {
|
||||
if ((key_flag & KEY_FLAG_PAIRWISE_MASK) ==
|
||||
KEY_FLAG_PAIRWISE_RX ||
|
||||
(key_flag & KEY_FLAG_PAIRWISE_MASK) ==
|
||||
KEY_FLAG_PAIRWISE_RX_TX_MODIFY) {
|
||||
if (nla_put_u8(key_msg, NL80211_KEY_MODE,
|
||||
key_flag == KEY_FLAG_PAIRWISE_RX ?
|
||||
NL80211_KEY_NO_TX : NL80211_KEY_SET_TX))
|
||||
goto fail;
|
||||
} else if ((key_flag & KEY_FLAG_GROUP_MASK) ==
|
||||
KEY_FLAG_GROUP_RX) {
|
||||
wpa_printf(MSG_DEBUG, " RSN IBSS RX GTK");
|
||||
if (nla_put_u32(key_msg, NL80211_KEY_TYPE,
|
||||
NL80211_KEYTYPE_GROUP))
|
||||
|
|
|
@ -453,6 +453,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
|
|||
if (ext_feature_isset(ext_features, len,
|
||||
NL80211_EXT_FEATURE_BEACON_PROTECTION))
|
||||
capa->flags |= WPA_DRIVER_FLAGS_BEACON_PROTECTION;
|
||||
|
||||
if (ext_feature_isset(ext_features, len,
|
||||
NL80211_EXT_FEATURE_EXT_KEY_ID))
|
||||
capa->flags |= WPA_DRIVER_FLAGS_EXTENDED_KEY_ID;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue