]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FT: Testing override for RSNXE Used subfield in FTE
authorJouni Malinen <jouni@codeaurora.org>
Tue, 14 Apr 2020 10:48:43 +0000 (13:48 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 14 Apr 2020 13:37:35 +0000 (16:37 +0300)
Allow wpa_supplicant to be requested to override the RSNXE Used subfield
in FT reassociation case for testing purposes with "SET ft_rsnxe_used
<0/1/2>" where 0 = no override, 1 = override to 1, and 2 = override to
0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/rsn_supp/wpa.c
src/rsn_supp/wpa.h
src/rsn_supp/wpa_ft.c
src/rsn_supp/wpa_i.h
wpa_supplicant/ctrl_iface.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 1c896642212835f2869571abbdd08d272ba53583..60084c6abd1250748d80bb70bd629988e4f61fc5 100644 (file)
@@ -3252,6 +3252,11 @@ int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
        case WPA_PARAM_USE_EXT_KEY_ID:
                sm->use_ext_key_id = value;
                break;
+#ifdef CONFIG_TESTING_OPTIONS
+       case WPA_PARAM_FT_RSNXE_USED:
+               sm->ft_rsnxe_used = value;
+               break;
+#endif /* CONFIG_TESTING_OPTIONS */
        default:
                break;
        }
index 796f39203702e13961d09a8b43011d5f33409d09..0986c6c615e7bc19278cb528fe17f440408bc23a 100644 (file)
@@ -106,6 +106,7 @@ enum wpa_sm_conf_params {
        WPA_PARAM_DENY_PTK0_REKEY,
        WPA_PARAM_EXT_KEY_ID,
        WPA_PARAM_USE_EXT_KEY_ID,
+       WPA_PARAM_FT_RSNXE_USED,
 };
 
 struct rsn_supp_config {
index 203a61c786a76f9796dfd87d40cff6768157c862..3e51cf2a1d5f83213892ab059878b57da9ece755 100644 (file)
@@ -305,6 +305,13 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
        ftie_len = pos++;
        rsnxe_used = wpa_key_mgmt_sae(sm->key_mgmt) && anonce &&
                (sm->sae_pwe == 1 || sm->sae_pwe == 2);
+#ifdef CONFIG_TESTING_OPTIONS
+       if (anonce && sm->ft_rsnxe_used) {
+               rsnxe_used = sm->ft_rsnxe_used == 1;
+               wpa_printf(MSG_DEBUG, "TESTING: FT: Force RSNXE Used %d",
+                          rsnxe_used);
+       }
+#endif /* CONFIG_TESTING_OPTIONS */
        if (wpa_key_mgmt_sha384(sm->key_mgmt)) {
                struct rsn_ftie_sha384 *ftie;
 
index 1ad75dcfa934fbc222038a15163055e67d1a7829..497d128852e98784ce3ae6f18013c878a06ea254 100644 (file)
@@ -153,6 +153,7 @@ struct wpa_sm {
 
 #ifdef CONFIG_TESTING_OPTIONS
        struct wpabuf *test_assoc_ie;
+       int ft_rsnxe_used;
 #endif /* CONFIG_TESTING_OPTIONS */
 
 #ifdef CONFIG_FILS
index 7301d50fc66adf7d773b34b42de4c660bd633f30..ae7cc8f6a6dfca84193cdc7e8f548088f3b80923 100644 (file)
@@ -747,6 +747,8 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
                                break;
                        pos++;
                }
+       } else if (os_strcasecmp(cmd, "ft_rsnxe_used") == 0) {
+               wpa_s->ft_rsnxe_used = atoi(value);
        } else if (os_strcasecmp(cmd, "rsne_override_eapol") == 0) {
                wpabuf_free(wpa_s->rsne_override_eapol);
                if (os_strcmp(value, "NULL") == 0)
@@ -8184,6 +8186,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
        wpa_s->disable_sa_query = 0;
        wpa_s->testing_resend_assoc = 0;
        wpa_s->ignore_sae_h2e_only = 0;
+       wpa_s->ft_rsnxe_used = 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 2cacb202d5ceba03eb496d2f6744c35ddcddc7e6..e29ed83e135d2c84ef5ea045b0eefe7013e2fc64 100644 (file)
@@ -1639,6 +1639,10 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
        if (ssid->sae_password_id && sae_pwe != 3)
                sae_pwe = 1;
        wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_SAE_PWE, sae_pwe);
+#ifdef CONFIG_TESTING_OPTIONS
+       wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_FT_RSNXE_USED,
+                        wpa_s->ft_rsnxe_used);
+#endif /* CONFIG_TESTING_OPTIONS */
 
        /* Extended Key ID is only supported in infrastructure BSS so far */
        if (ssid->mode == WPAS_MODE_INFRA && wpa_s->conf->extended_key_id &&
index e0de59fa29714439cbcf9ad5e27a42fa3e904700..997e5f642a6a6b3059214e906281ab152bd3d7e6 100644 (file)
@@ -1135,6 +1135,7 @@ struct wpa_supplicant {
        unsigned int disable_sa_query:1;
        unsigned int testing_resend_assoc:1;
        unsigned int ignore_sae_h2e_only:1;
+       int ft_rsnxe_used;
        struct wpabuf *sae_commit_override;
        enum wpa_alg last_tk_alg;
        u8 last_tk_addr[ETH_ALEN];