]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Do not discard network introduction frames in test mode
authorJouni Malinen <quic_jouni@quicinc.com>
Wed, 24 Aug 2022 15:31:54 +0000 (18:31 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 24 Aug 2022 15:31:54 +0000 (18:31 +0300)
dpp_discard_public_action=1 was not supposed to prevent network
introduction, i.e., it was only for frames that could go through the
DPP-over-TCP path. Fix this not to prevent network introduction when
using DPP-over-TCP to configure a DPP AKM profile.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/dpp_supplicant.c

index 994d183a90fc0cfff2fff8fa664b2314501fa0b1..d90a2924b7c467ab3c7c088c250c632c316b1f1a 100644 (file)
@@ -3884,13 +3884,6 @@ void wpas_dpp_rx_action(struct wpa_supplicant *wpa_s, const u8 *src,
                return;
        if (WPA_GET_BE24(buf) != OUI_WFA || buf[3] != DPP_OUI_TYPE)
                return;
-#ifdef CONFIG_TESTING_OPTIONS
-       if (wpa_s->dpp_discard_public_action) {
-               wpa_printf(MSG_DEBUG,
-                          "TESTING: Discard received DPP Public Action frame");
-               return;
-       }
-#endif /* CONFIG_TESTING_OPTIONS */
        hdr = buf;
        buf += 4;
        len -= 4;
@@ -3902,6 +3895,15 @@ void wpas_dpp_rx_action(struct wpa_supplicant *wpa_s, const u8 *src,
                   "DPP: Received DPP Public Action frame crypto suite %u type %d from "
                   MACSTR " freq=%u",
                   crypto_suite, type, MAC2STR(src), freq);
+#ifdef CONFIG_TESTING_OPTIONS
+       if (wpa_s->dpp_discard_public_action &&
+           type != DPP_PA_PEER_DISCOVERY_RESP &&
+           type != DPP_PA_PRIV_PEER_INTRO_NOTIFY) {
+               wpa_printf(MSG_DEBUG,
+                          "TESTING: Discard received DPP Public Action frame");
+               return;
+       }
+#endif /* CONFIG_TESTING_OPTIONS */
        if (crypto_suite != 1) {
                wpa_printf(MSG_DEBUG, "DPP: Unsupported crypto suite %u",
                           crypto_suite);