[PATCH] nl80211: Pass AKM to GTK rekey offload
Bedrock Mailer
tr4nqui1i7y at gmail.com
Sat Sep 5 16:57:13 PDT 2026
From: Brent <benty.box at proton.me>
NL80211_REKEY_DATA_AKM is part of the GTK rekey data API and cfg80211
forwards it to drivers. wpa_supplicant currently provides the KEK, KCK,
and replay counter when configuring GTK rekey offload, but does not
provide the selected AKM.
This leaves drivers or firmware that require the AKM for rekey offload
without enough information to configure the offload correctly. This is
observable with Intel iwlwifi WoWLAN on WPA3-SAE.
Pass the selected AKM from wpa_supplicant through set_rekey_info() and
include NL80211_REKEY_DATA_AKM in the nl80211 rekey data.
This was validated with an Intel AX200 using WPA3-SAE and PMF. With the
AP GTK rekey interval reduced to 60 seconds, passing the SAE suite
selector (00-0f-ac:08) kept the system in deep suspend for 600 seconds
through multiple GTK rotations while preserving Magic Packet wake.
Signed-off-by: Brent <benty.box at proton.me>
---
src/drivers/driver.h | 3 ++-
src/drivers/driver_nl80211.c | 4 +++-
wpa_supplicant/driver_i.h | 5 +++--
wpa_supplicant/wpas_glue.c | 4 +++-
4 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index eb4c710..b93d4e6 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -4979,6 +4979,7 @@ struct wpa_driver_ops {
* @kck: Current KCK
* @kck_len: KCK length in octets
* @replay_ctr: Current EAPOL-Key Replay Counter
+ * @akm: Selected RSN AKM suite selector (OUI and suite type)
*
* This optional function can be used to provide information for the
* driver/firmware to process EAPOL-Key frames in Group Key Handshake
@@ -4986,7 +4987,7 @@ struct wpa_driver_ops {
*/
void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
const u8 *kck, size_t kck_len,
- const u8 *replay_ctr);
+ const u8 *replay_ctr, u32 akm);
/**
* sta_assoc - Station association indication
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index adf6494..a4181e8 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -11360,7 +11360,8 @@ static int wpa_driver_nl80211_get_survey(void *priv, unsigned int freq)
static void nl80211_set_rekey_info(void *priv, const u8 *kek, size_t kek_len,
const u8 *kck, size_t kck_len,
- const u8 *replay_ctr)
+ const u8 *replay_ctr,
+ u32 akm)
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
@@ -11376,6 +11377,7 @@ static void nl80211_set_rekey_info(void *priv, const u8 *kek, size_t kek_len,
!(replay_nested = nla_nest_start(msg, NL80211_ATTR_REKEY_DATA)) ||
nla_put(msg, NL80211_REKEY_DATA_KEK, kek_len, kek) ||
(kck_len && nla_put(msg, NL80211_REKEY_DATA_KCK, kck_len, kck)) ||
+ nla_put_u32(msg, NL80211_REKEY_DATA_AKM, akm) ||
nla_put(msg, NL80211_REKEY_DATA_REPLAY_CTR, NL80211_REPLAY_CTR_LEN,
replay_ctr)) {
nl80211_nlmsg_clear(msg);
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 7d8b806..67812e8 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -635,12 +635,13 @@ static inline int wpa_drv_driver_cmd(struct wpa_supplicant *wpa_s,
static inline void wpa_drv_set_rekey_info(struct wpa_supplicant *wpa_s,
const u8 *kek, size_t kek_len,
const u8 *kck, size_t kck_len,
- const u8 *replay_ctr)
+ const u8 *replay_ctr,
+ u32 akm)
{
if (!wpa_s->driver->set_rekey_info)
return;
wpa_s->driver->set_rekey_info(wpa_s->drv_priv, kek, kek_len,
- kck, kck_len, replay_ctr);
+ kck, kck_len, replay_ctr, akm);
}
static inline int wpa_drv_radio_disable(struct wpa_supplicant *wpa_s,
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index 8024fff..c6e94eb 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -1282,8 +1282,10 @@ static void wpa_supplicant_set_rekey_offload(void *ctx,
const u8 *replay_ctr)
{
struct wpa_supplicant *wpa_s = ctx;
+ u32 akm = wpa_akm_to_suite(wpa_s->key_mgmt);
- wpa_drv_set_rekey_info(wpa_s, kek, kek_len, kck, kck_len, replay_ctr);
+ wpa_drv_set_rekey_info(wpa_s, kek, kek_len, kck, kck_len, replay_ctr,
+ akm);
}
base-commit: 54c0928689f7cde587bcd9e2eb6ac6ba21bc8a78
--
2.55.0
More information about the Hostap
mailing list