]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Testing option to ignore H2E requirement mismatch
authorJouni Malinen <jouni@codeaurora.org>
Fri, 6 Dec 2019 15:13:59 +0000 (17:13 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 6 Dec 2019 15:13:59 +0000 (17:13 +0200)
"SET ignore_sae_h2e_only 1" can now be used to configurate
wpa_supplicant to a test mode where it ignores AP's H2E-required
advertisement and try to connect with hunt-and-pecking loop instead.
This is used only for testing AP behavior with unexpected STA behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/ctrl_iface.c
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant_i.h

index f238bc73f5d5c8c6f04b52a7d76920b4dca51fc7..f0ea9d12bef39a7914b4f05b6aa0c6d3c2c6f9c0 100644 (file)
@@ -663,6 +663,8 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
                wpa_s->ignore_assoc_disallow = !!atoi(value);
                wpa_drv_ignore_assoc_disallow(wpa_s,
                                              wpa_s->ignore_assoc_disallow);
+       } else if (os_strcasecmp(cmd, "ignore_sae_h2e_only") == 0) {
+               wpa_s->ignore_sae_h2e_only = !!atoi(value);
        } else if (os_strcasecmp(cmd, "reject_btm_req_reason") == 0) {
                wpa_s->reject_btm_req_reason = atoi(value);
        } else if (os_strcasecmp(cmd, "get_pref_freq_list_override") == 0) {
@@ -8045,6 +8047,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
        wpa_s->ignore_auth_resp = 0;
        wpa_s->ignore_assoc_disallow = 0;
        wpa_s->testing_resend_assoc = 0;
+       wpa_s->ignore_sae_h2e_only = 0;
        wpa_s->reject_btm_req_reason = 0;
        wpa_sm_set_test_assoc_ie(wpa_s->wpa, NULL);
        os_free(wpa_s->get_pref_freq_list_override);
index 21ce943d661f55c7abcf1430101aa17a1dfed337..43c10c17892f2a4b4f1294c32988d9f923def7ed 100644 (file)
@@ -857,6 +857,13 @@ static int rate_match(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
                                        if (debug_print)
                                                wpa_dbg(wpa_s, MSG_DEBUG,
                                                        "   SAE H2E disabled");
+#ifdef CONFIG_TESTING_OPTIONS
+                                       if (wpa_s->ignore_sae_h2e_only) {
+                                               wpa_dbg(wpa_s, MSG_DEBUG,
+                                                       "TESTING: Ignore SAE H2E requirement mismatch");
+                                               continue;
+                                       }
+#endif /* CONFIG_TESTING_OPTIONS */
                                        return 0;
                                }
                                continue;
index 8c5defc3bc7fe6859c0201c1d62d3fbb50aae5bc..c34bd28525995fb932e90f534612a3cca7a80977 100644 (file)
@@ -1117,6 +1117,7 @@ struct wpa_supplicant {
        unsigned int ignore_auth_resp:1;
        unsigned int ignore_assoc_disallow:1;
        unsigned int testing_resend_assoc:1;
+       unsigned int ignore_sae_h2e_only:1;
        struct wpabuf *sae_commit_override;
        enum wpa_alg last_tk_alg;
        u8 last_tk_addr[ETH_ALEN];