aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-11-27 18:33:43 (GMT)
committerJouni Malinen <j@w1.fi>2017-11-27 18:33:43 (GMT)
commit634a130a525580e07afc8553531d38d6c78bbb03 (patch)
treeccf36b18c0efd9192881bc9035960d556b6abfce
parent8b4adc38aae495022a4e65313c8218dca728937b (diff)
downloadhostap-634a130a525580e07afc8553531d38d6c78bbb03.zip
hostap-634a130a525580e07afc8553531d38d6c78bbb03.tar.gz
hostap-634a130a525580e07afc8553531d38d6c78bbb03.tar.bz2
DPP: Clear authentication instance on configuration completion in AP
wpa_supplicant was already doing this and hostapd needs to clear hapd->dpp_auth when completing the exchange in Configurator (GAS server) role. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--src/ap/dpp_hostapd.c14
-rw-r--r--src/ap/dpp_hostapd.h1
-rw-r--r--src/ap/gas_serv.c4
3 files changed, 17 insertions, 2 deletions
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
index e1d798e..81c3989 100644
--- a/src/ap/dpp_hostapd.c
+++ b/src/ap/dpp_hostapd.c
@@ -1456,6 +1456,20 @@ hostapd_dpp_gas_req_handler(struct hostapd_data *hapd, const u8 *sa,
}
+void hostapd_dpp_gas_status_handler(struct hostapd_data *hapd, int ok)
+{
+ if (!hapd->dpp_auth)
+ return;
+
+ if (ok)
+ wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT);
+ else
+ wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED);
+ dpp_auth_deinit(hapd->dpp_auth);
+ hapd->dpp_auth = NULL;
+}
+
+
static unsigned int hostapd_dpp_next_configurator_id(struct hostapd_data *hapd)
{
struct dpp_configurator *conf;
diff --git a/src/ap/dpp_hostapd.h b/src/ap/dpp_hostapd.h
index ecbdcf6..c2c6200 100644
--- a/src/ap/dpp_hostapd.h
+++ b/src/ap/dpp_hostapd.h
@@ -26,6 +26,7 @@ void hostapd_dpp_tx_status(struct hostapd_data *hapd, const u8 *dst,
struct wpabuf *
hostapd_dpp_gas_req_handler(struct hostapd_data *hapd, const u8 *sa,
const u8 *query, size_t query_len);
+void hostapd_dpp_gas_status_handler(struct hostapd_data *hapd, int ok);
int hostapd_dpp_configurator_add(struct hostapd_data *hapd, const char *cmd);
int hostapd_dpp_configurator_remove(struct hostapd_data *hapd, const char *id);
int hostapd_dpp_configurator_sign(struct hostapd_data *hapd, const char *cmd);
diff --git a/src/ap/gas_serv.c b/src/ap/gas_serv.c
index fadb740..6f27b96 100644
--- a/src/ap/gas_serv.c
+++ b/src/ap/gas_serv.c
@@ -1460,7 +1460,7 @@ static void gas_serv_req_dpp_processing(struct hostapd_data *hapd,
gas_serv_write_dpp_adv_proto(tx_buf);
wpabuf_put_le16(tx_buf, wpabuf_len(buf));
wpabuf_put_buf(tx_buf, buf);
- wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT);
+ hostapd_dpp_gas_status_handler(hapd, 1);
}
wpabuf_free(buf);
}
@@ -1702,7 +1702,7 @@ static void gas_serv_rx_gas_comeback_req(struct hostapd_data *hapd,
"SD response sent");
#ifdef CONFIG_DPP
if (dialog->dpp)
- wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT);
+ hostapd_dpp_gas_status_handler(hapd, 1);
#endif /* CONFIG_DPP */
gas_serv_dialog_clear(dialog);
gas_serv_free_dialogs(hapd, sa);