]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Support mutual auth with QR in scan-during-auth-exchange case
authorJouni Malinen <jouni@codeaurora.org>
Wed, 12 Aug 2020 09:04:25 +0000 (12:04 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 12 Aug 2020 09:04:25 +0000 (12:04 +0300)
Extend DPP authentication session search for the DPP_QR_CODE command to
cover the ongoing exchanges in Controller/Responder.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/dpp.h
src/common/dpp_tcp.c
wpa_supplicant/dpp_supplicant.c

index feee8e1e843c9bd14258f95e338919b5eb4aef16..a8526b14d5984612f5025cdd7cc99c263a6ada01 100644 (file)
@@ -668,6 +668,8 @@ int dpp_controller_start(struct dpp_global *dpp,
 void dpp_controller_stop(struct dpp_global *dpp);
 struct dpp_authentication * dpp_controller_get_auth(struct dpp_global *dpp,
                                                    unsigned int id);
+void dpp_controller_new_qr_code(struct dpp_global *dpp,
+                               struct dpp_bootstrap_info *bi);
 int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
                 const struct hostapd_ip_addr *addr, int port,
                 const char *name);
index 90dd38fc0eee8674a6ca91b220d87fbf612abba9..83aff1ca9f3a48f0adf2541bdd3b9436b7a8c576 100644 (file)
@@ -1719,6 +1719,28 @@ struct dpp_authentication * dpp_controller_get_auth(struct dpp_global *dpp,
 }
 
 
+void dpp_controller_new_qr_code(struct dpp_global *dpp,
+                               struct dpp_bootstrap_info *bi)
+{
+       struct dpp_controller *ctrl = dpp->controller;
+       struct dpp_connection *conn;
+
+       if (!ctrl)
+               return;
+
+       dl_list_for_each(conn, &ctrl->conn, struct dpp_connection, list) {
+               struct dpp_authentication *auth = conn->auth;
+
+               if (!auth->response_pending ||
+                   dpp_notify_new_qr_code(auth, bi) != 1)
+                       continue;
+               wpa_printf(MSG_DEBUG,
+                          "DPP: Sending out pending authentication response");
+               dpp_tcp_send_msg(conn, conn->auth->resp_msg);
+       }
+}
+
+
 void dpp_tcp_init_flush(struct dpp_global *dpp)
 {
        struct dpp_connection *conn, *tmp;
index 3119445ac028ac927dbc833d4f0b907e48ae251d..7d226ac76bdd9549a8c88bfce14cfab5742d0bf5 100644 (file)
@@ -90,6 +90,10 @@ int wpas_dpp_qr_code(struct wpa_supplicant *wpa_s, const char *cmd)
                                       500, wpas_dpp_tx_status, 0);
        }
 
+#ifdef CONFIG_DPP2
+       dpp_controller_new_qr_code(wpa_s->dpp, bi);
+#endif /* CONFIG_DPP2 */
+
        return bi->id;
 }