Add support for Extended Key ID to nl80211, allowing hostapd and wpa_supplicant to use it. Signed-off-by: Alexander Wetzel <alexander@xxxxxxxxxxxxxx> --- src/drivers/driver_nl80211.c | 22 +++++++++++++++++++--- src/drivers/driver_nl80211_capa.c | 4 ++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index aa7e24677..36f7d14c9 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3051,7 +3051,11 @@ static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss, if (!key_msg) return -ENOBUFS; - if (alg == WPA_ALG_NONE) { + if (key_flag == 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) { msg = nl80211_ifindex_msg(drv, ifindex, 0, NL80211_CMD_DEL_KEY); if (!msg) goto fail2; @@ -3070,7 +3074,7 @@ static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss, wpa_hexdump_key(MSG_DEBUG, "nl80211: KEY_DATA", key, key_len); } - if (seq && seq_len) { + if (seq && seq_len && key_flag != KEY_FLAG_PAIRWISE_RX_TX_MODIFY) { if (nla_put(key_msg, NL80211_KEY_SEQ, seq_len, seq)) goto fail; wpa_hexdump(MSG_DEBUG, "nl80211: KEY_SEQ", seq, seq_len); @@ -3081,7 +3085,19 @@ static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss, if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) goto fail; - if (key_flag == KEY_FLAG_GROUP_RX) { + if (key_flag == KEY_FLAG_PAIRWISE_RX || + key_flag == KEY_FLAG_PAIRWISE_RX_TX_MODIFY) { + wpa_printf(MSG_DEBUG, + " PAIRWISE_RX%s keyid=%d addr=" MACSTR, + key_flag != KEY_FLAG_PAIRWISE_RX ? + "_TX_MODIFY" : "", + key_idx, MAC2STR(addr)); + 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_RX) { wpa_printf(MSG_DEBUG, " RSN IBSS RX GTK"); if (nla_put_u32(key_msg, NL80211_KEY_TYPE, NL80211_KEYTYPE_GROUP)) diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 96f691b60..dd3497089 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -421,6 +421,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0)) capa->flags |= WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS; + if (ext_feature_isset(ext_features, len, + NL80211_EXT_FEATURE_EXT_KEY_ID)) + capa->flags |= WPA_DRIVER_FLAGS_EXTENDED_KEY_ID; + #ifdef CONFIG_MBO if (ext_feature_isset(ext_features, len, NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME) && -- 2.24.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap