[PATCH 2/4] gas_query: add comeback-recovery opt-in for DPP certBag
Gustavo Bertoli
gubertoli at gmail.com
Tue Jun 23 08:57:15 PDT 2026
The GAS client in gas_query.c is shared by ANQP/Interworking, Hotspot 2.0
and DPP. The next patch adds comeback recovery to it, but that recovery is
only wanted for DPP Enterprise certBag provisioning, where the Configurator
may take seconds to return a CA-signed certificate; a failed GAS exchange
there is terminal. Other DPP configurations are small and immediate, and
ANQP/HS2.0 have their own retry behaviour.
Add a per-query comeback_recover flag (default off) and a small
gas_query_set_comeback_recover() that turns it on for one in-flight query.
DPP enables recovery only on the Configuration Request that carries a CSR
(auth->csr set). This patch only stores the flag and changes no behaviour,
so the recovery added next is limited to the DPP certBag exchange.
Signed-off-by: Gustavo Bertoli <gubertoli at gmail.com>
---
wpa_supplicant/dpp_supplicant.c | 6 ++++++
wpa_supplicant/gas_query.c | 18 ++++++++++++++++++
wpa_supplicant/gas_query.h | 2 ++
3 files changed, 26 insertions(+)
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
index 6a3bf6a3e..47be2ad53 100644
--- a/wpa_supplicant/dpp_supplicant.c
+++ b/wpa_supplicant/dpp_supplicant.c
@@ -2090,6 +2090,12 @@ static void wpas_dpp_start_gas_client(struct wpa_supplicant *wpa_s)
wpa_printf(MSG_DEBUG,
"DPP: GAS query started with dialog token %u", res);
wpa_s->dpp_gas_dialog_token = res;
+ if (auth->csr &&
+ gas_query_set_comeback_recover(wpa_s->gas,
+ auth->peer_mac_addr,
+ res) < 0)
+ wpa_printf(MSG_DEBUG,
+ "DPP: Could not enable GAS comeback recovery");
}
}
diff --git a/wpa_supplicant/gas_query.c b/wpa_supplicant/gas_query.c
index 73cc34e0a..e6f18e856 100644
--- a/wpa_supplicant/gas_query.c
+++ b/wpa_supplicant/gas_query.c
@@ -45,6 +45,7 @@ struct gas_query_pending {
unsigned int wait_comeback:1;
unsigned int offchannel_tx_started:1;
unsigned int retry:1;
+ unsigned int comeback_recover:1;
unsigned int wildcard_bssid:1;
unsigned int maintain_addr:1;
unsigned int sent:1;
@@ -921,6 +922,23 @@ int gas_query_req(struct gas_query *gas, const u8 *dst, int freq,
}
+int gas_query_set_comeback_recover(struct gas_query *gas, const u8 *dst,
+ u8 dialog_token)
+{
+ struct gas_query_pending *query;
+
+ dl_list_for_each(query, &gas->pending, struct gas_query_pending, list) {
+ if (query->dialog_token == dialog_token &&
+ ether_addr_equal(query->addr, dst)) {
+ query->comeback_recover = 1;
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+
int gas_query_stop(struct gas_query *gas, u8 dialog_token)
{
struct gas_query_pending *query;
diff --git a/wpa_supplicant/gas_query.h b/wpa_supplicant/gas_query.h
index 6ccecd4dd..d23503d50 100644
--- a/wpa_supplicant/gas_query.h
+++ b/wpa_supplicant/gas_query.h
@@ -40,6 +40,8 @@ int gas_query_req(struct gas_query *gas, const u8 *dst, int freq,
const struct wpabuf *adv_proto,
const struct wpabuf *resp, u16 status_code),
void *ctx);
+int gas_query_set_comeback_recover(struct gas_query *gas, const u8 *dst,
+ u8 dialog_token);
int gas_query_stop(struct gas_query *gas, u8 dialog_token);
#else /* CONFIG_GAS */
--
2.39.5
More information about the Hostap
mailing list