]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Indicate authentication success on ConfReqRX if needed (hostapd)
authorJouni Malinen <j@w1.fi>
Sat, 20 Mar 2021 14:09:19 +0000 (16:09 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 20 Mar 2021 14:09:19 +0000 (16:09 +0200)
It is possible to receive the Configuration Request frame before having
seen TX status for the Authentication Confirm. In that sequence, the
DPP-AUTH-SUCCESS event would not be indicated before processing the
configuration step and that could confuse upper layers that follow the
details of the DPP exchange. As a workaround, indicate DPP-AUTH-SUCCESS
when receiving the Configuration Request since the Enrollee/Responser
has clearly receive the Authentication Confirm even if the TX status for
it has not been received.

This was already done in wpa_supplicant in commit 422e73d623b4 ("DPP:
Indicate authentication success on ConfReqRX if needed") and matching
changes are now added to hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/dpp_hostapd.c

index fcdbb4c98fa46a15bbf7fc407f8bc80463430546..6e44bdadfe56cbd71ed813e41d81692ae11f1619 100644 (file)
@@ -1982,6 +1982,19 @@ hostapd_dpp_gas_req_handler(struct hostapd_data *hapd, const u8 *sa,
                wpa_printf(MSG_DEBUG, "DPP: No matching exchange in progress");
                return NULL;
        }
+
+       if (hapd->dpp_auth_ok_on_ack && auth->configurator) {
+               wpa_printf(MSG_DEBUG,
+                          "DPP: Have not received ACK for Auth Confirm yet - assume it was received based on this GAS request");
+               /* hostapd_dpp_auth_success() would normally have been called
+                * from TX status handler, but since there was no such handler
+                * call yet, simply send out the event message and proceed with
+                * exchange. */
+               wpa_msg(hapd->msg_ctx, MSG_INFO,
+                       DPP_EVENT_AUTH_SUCCESS "init=1");
+               hapd->dpp_auth_ok_on_ack = 0;
+       }
+
        wpa_hexdump(MSG_DEBUG,
                    "DPP: Received Configuration Request (GAS Query Request)",
                    query, query_len);