]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add support for not transmitting EAPOL-Key group msg 2/2
authorVeerendranath Jakkam <quic_vjakkam@quicinc.com>
Mon, 28 Feb 2022 11:27:37 +0000 (16:57 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 5 Apr 2022 14:06:32 +0000 (17:06 +0300)
To support the STA testbed role, the STA has to disable transmitting
EAPOL-Key group msg 2/2 of Group Key Handshake. Add test parameter to
disable sending EAPOL-Key group msg 2/2 of Group Key Handshake.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
src/rsn_supp/wpa.c
src/rsn_supp/wpa.h
src/rsn_supp/wpa_i.h
wpa_supplicant/ctrl_iface.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 0a2f8778750487b6568c3a9f91f093010b96246c..dd18236ee53bcdf0fee3b10107c33c3ee14f5c79 100644 (file)
@@ -2023,6 +2023,13 @@ static int wpa_supplicant_send_2_of_2(struct wpa_sm *sm,
        u8 *rbuf, *key_mic;
        size_t kde_len = 0;
 
+#ifdef CONFIG_TESTING_OPTIONS
+       if (sm->disable_eapol_g2_tx) {
+               wpa_printf(MSG_INFO, "TEST: Disable sending EAPOL-Key 2/2");
+               return 0;
+       }
+#endif /* CONFIG_TESTING_OPTIONS */
+
 #ifdef CONFIG_OCV
        if (wpa_sm_ocv_enabled(sm))
                kde_len = OCV_OCI_KDE_LEN;
@@ -3380,6 +3387,9 @@ int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
        case WPA_PARAM_OCI_FREQ_FILS_ASSOC:
                sm->oci_freq_override_fils_assoc = value;
                break;
+       case WPA_PARAM_DISABLE_EAPOL_G2_TX:
+               sm->disable_eapol_g2_tx = value;
+               break;
 #endif /* CONFIG_TESTING_OPTIONS */
 #ifdef CONFIG_DPP2
        case WPA_PARAM_DPP_PFS:
index 41daaae2cf72aa6630ee4e5c6f232527d2f46098..b2335ce3037491cff2e452fbf7920990468b17f1 100644 (file)
@@ -118,6 +118,7 @@ enum wpa_sm_conf_params {
        WPA_PARAM_OCI_FREQ_EAPOL_G2,
        WPA_PARAM_OCI_FREQ_FT_ASSOC,
        WPA_PARAM_OCI_FREQ_FILS_ASSOC,
+       WPA_PARAM_DISABLE_EAPOL_G2_TX,
 };
 
 struct rsn_supp_config {
index 6cdce321da3b09d970dc502a78d4087e26bfd6a0..579616fbbeaf9ccfa5c3f5551bb1cd821b33021e 100644 (file)
@@ -185,6 +185,7 @@ struct wpa_sm {
        unsigned int oci_freq_override_eapol_g2;
        unsigned int oci_freq_override_ft_assoc;
        unsigned int oci_freq_override_fils_assoc;
+       unsigned int disable_eapol_g2_tx;
 #endif /* CONFIG_TESTING_OPTIONS */
 
 #ifdef CONFIG_FILS
index 4498a6678ca9e750997b95e6e68dacd2d634912e..4779c119ea845abd6bc39573d3363af78ca545ce 100644 (file)
@@ -837,6 +837,11 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
                wpa_s->disable_scs_support = !!atoi(value);
        } else if (os_strcasecmp(cmd, "disable_mscs_support") == 0) {
                wpa_s->disable_mscs_support = !!atoi(value);
+       } else if (os_strcasecmp(cmd, "disable_eapol_g2_tx") == 0) {
+               wpa_s->disable_eapol_g2_tx = !!atoi(value);
+               /* Populate value to wpa_sm if already associated. */
+               wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_DISABLE_EAPOL_G2_TX,
+                                wpa_s->disable_eapol_g2_tx);
 #ifdef CONFIG_DPP
        } else if (os_strcasecmp(cmd, "dpp_config_obj_override") == 0) {
                os_free(wpa_s->dpp_config_obj_override);
@@ -8540,6 +8545,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
        wpa_s->oci_freq_override_ft_assoc = 0;
        wpa_s->oci_freq_override_fils_assoc = 0;
        wpa_s->oci_freq_override_wnm_sleep = 0;
+       wpa_s->disable_eapol_g2_tx = 0;
 #ifdef CONFIG_DPP
        os_free(wpa_s->dpp_config_obj_override);
        wpa_s->dpp_config_obj_override = NULL;
index 4a27126557f71ab4ab4993016f7f59a1a6523fb4..3d3d5465ad7bc40d4b667bbeb074c00d530e2994 100644 (file)
@@ -1701,6 +1701,8 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
                         wpa_s->oci_freq_override_ft_assoc);
        wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_OCI_FREQ_FILS_ASSOC,
                         wpa_s->oci_freq_override_fils_assoc);
+       wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_DISABLE_EAPOL_G2_TX,
+                        wpa_s->disable_eapol_g2_tx);
 #endif /* CONFIG_TESTING_OPTIONS */
 
        /* Extended Key ID is only supported in infrastructure BSS so far */
index cc7ae6690273707f0d0fedbeb57cf32159ac40c9..e759dbd8b71bc5fc1cf1c50d3059cba97ce3e955 100644 (file)
@@ -1343,6 +1343,7 @@ struct wpa_supplicant {
        unsigned int oci_freq_override_ft_assoc;
        unsigned int oci_freq_override_fils_assoc;
        unsigned int oci_freq_override_wnm_sleep;
+       unsigned int disable_eapol_g2_tx;
 #endif /* CONFIG_TESTING_OPTIONS */
 
        struct wmm_ac_assoc_data *wmm_ac_assoc_info;