aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Wetzel <alexander@wetzel-home.de>2020-03-15 19:04:24 (GMT)
committerJouni Malinen <j@w1.fi>2020-03-15 21:39:57 (GMT)
commitac222415326a4c749e6ea51aaed974489cf874a6 (patch)
tree62ed5ba54624a812c788b722d4f57c11fd468343
parenta1afa2df8a521bce88f1e0b13dc6650be0e69494 (diff)
downloadhostap-ac222415326a4c749e6ea51aaed974489cf874a6.zip
hostap-ac222415326a4c749e6ea51aaed974489cf874a6.tar.gz
hostap-ac222415326a4c749e6ea51aaed974489cf874a6.tar.bz2
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>
-rw-r--r--src/drivers/driver.h2
-rw-r--r--src/drivers/driver_common.c1
-rw-r--r--src/drivers/driver_nl80211.c18
-rw-r--r--src/drivers/driver_nl80211_capa.c4
4 files changed, 23 insertions, 2 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index b037395..78a3387 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -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) \
diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c
index f4d06e4..2e03b66 100644
--- a/src/drivers/driver_common.c
+++ b/src/drivers/driver_common.c
@@ -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
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 4c686d0..ba8d079 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -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))
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 5a51b42..b4fed9e 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -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;
}