]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Reconfig Announcement relaying from AP to Controller
authorJouni Malinen <jouni@codeaurora.org>
Mon, 11 May 2020 13:02:51 +0000 (16:02 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 11 May 2020 14:26:11 +0000 (17:26 +0300)
Recognize the Reconfig Announcement message type and handle it similarly
to the Presence Announcement in the Relay, i.e., send it to the first
Controller if the local Configurator does not have matching C-sign-key.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/dpp_hostapd.c
src/common/dpp_tcp.c

index f7d286747c6f1fc046d2a519582770f2218068c7..548e8856e03131509fdbee78bae3e694379c2af4 100644 (file)
@@ -1258,6 +1258,10 @@ hostapd_dpp_rx_reconfig_announcement(struct hostapd_data *hapd, const u8 *src,
        conf = dpp_configurator_find_kid(hapd->iface->interfaces->dpp,
                                         csign_hash);
        if (!conf) {
+               if (dpp_relay_rx_action(hapd->iface->interfaces->dpp,
+                                       src, hdr, buf, len, freq, NULL,
+                                       NULL) == 0)
+                       return;
                wpa_printf(MSG_DEBUG,
                           "DPP: No matching Configurator information found");
                return;
index 5a824943d4a027e3239830f21de7058a59765e02..bfac377bb7cb6514c0809347d0499a3f141801ed 100644 (file)
@@ -448,7 +448,8 @@ int dpp_relay_rx_action(struct dpp_global *dpp, const u8 *src, const u8 *hdr,
         */
        if (type != DPP_PA_PEER_DISCOVERY_REQ &&
            type != DPP_PA_PEER_DISCOVERY_RESP &&
-           type != DPP_PA_PRESENCE_ANNOUNCEMENT) {
+           type != DPP_PA_PRESENCE_ANNOUNCEMENT &&
+           type != DPP_PA_RECONFIG_ANNOUNCEMENT) {
                dl_list_for_each(ctrl, &dpp->controllers,
                                 struct dpp_relay_controller, list) {
                        dl_list_for_each(conn, &ctrl->conn,
@@ -460,15 +461,15 @@ int dpp_relay_rx_action(struct dpp_global *dpp, const u8 *src, const u8 *hdr,
                }
        }
 
-       if (!r_bootstrap)
-               return -1;
-
-       if (type == DPP_PA_PRESENCE_ANNOUNCEMENT) {
+       if (type == DPP_PA_PRESENCE_ANNOUNCEMENT ||
+           type == DPP_PA_RECONFIG_ANNOUNCEMENT) {
                /* TODO: Could send this to all configured Controllers. For now,
                 * only the first Controller is supported. */
                ctrl = dl_list_first(&dpp->controllers,
                                     struct dpp_relay_controller, list);
        } else {
+               if (!r_bootstrap)
+                       return -1;
                ctrl = dpp_relay_controller_get(dpp, r_bootstrap);
        }
        if (!ctrl)