From f17314a2d3651f772113f753959573ab924b9fda Mon Sep 17 00:00:00 2001 From: Marek Kwaczynski Date: Thu, 22 May 2025 07:55:38 +0200 Subject: [PATCH] qca-wifi-7: hostapd: fix missing PSK assignment for EMPSK When using psk2-radius in combination with enhanced MPSK, the passphrase was not properly propagated to user scripts via the ucode interface, because the PSK field was not set in the connected station context. This patch fixes that by copying the passphrase into the psk field. Signed-off-by: Marek Kwaczynski --- feeds/qca-wifi-7/hostapd/src/src/ap/ucode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/feeds/qca-wifi-7/hostapd/src/src/ap/ucode.c b/feeds/qca-wifi-7/hostapd/src/src/ap/ucode.c index f296107d8..a34e89627 100644 --- a/feeds/qca-wifi-7/hostapd/src/src/ap/ucode.c +++ b/feeds/qca-wifi-7/hostapd/src/src/ap/ucode.c @@ -785,6 +785,7 @@ int hostapd_ucode_sta_auth(struct hostapd_data *hapd, struct sta_info *sta) void hostapd_ucode_sta_connected(struct hostapd_data *hapd, struct sta_info *sta) { + struct hostapd_sta_wpa_psk_short *psk = sta->psk; char addr[sizeof(MACSTR)]; uc_value_t *val, *cur; int ret = 0; @@ -801,6 +802,8 @@ void hostapd_ucode_sta_connected(struct hostapd_data *hapd, struct sta_info *sta val = ucv_object_new(vm); if (sta->psk_idx) ucv_object_add(val, "psk_idx", ucv_int64_new(sta->psk_idx - 1)); + if (sta->psk) + ucv_object_add(val, "psk", ucv_string_new(sta->psk->passphrase)); uc_value_push(ucv_get(val)); val = wpa_ucode_call(3);