From 35da7c20acec5d0c447d2f3eb219f4fb2a2683d9 Mon Sep 17 00:00:00 2001 From: Alexander Wetzel Date: Sat, 4 Jan 2020 23:10:00 +0100 Subject: [PATCH] nl80211: Add driver capability flag for CAN_REPLACE_PTK0 The CAN_REPLACE_PTK0 flag provided by nl80211 can be used to detect if the card/driver is explicitly indicating capability to rekey STA PTK keys using only keyid 0 correctly. Check if the card/driver supports it and make the status available as a driver flag. Signed-off-by: Alexander Wetzel --- src/drivers/driver.h | 2 ++ src/drivers/driver_nl80211_capa.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 64fc0fd90..48dd3fe52 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1838,6 +1838,8 @@ struct wpa_driver_capa { #define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL /** Driver supports UPDATE_FT_IES command */ #define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL +/** Driver can correctly rekey PTKs without Extended Key ID */ +#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL u64 flags; #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \ diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index a0f6e52ea..61c8c2556 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -445,6 +445,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info, if (ext_feature_isset(ext_features, len, NL80211_EXT_FEATURE_VLAN_OFFLOAD)) capa->flags |= WPA_DRIVER_FLAGS_VLAN_OFFLOAD; + + if (ext_feature_isset(ext_features, len, + NL80211_EXT_FEATURE_CAN_REPLACE_PTK0)) + capa->flags |= WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS; }