]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make MFPR value from an associated STA available as hostapdMFPR
authorJouni Malinen <j@w1.fi>
Sun, 18 Dec 2022 18:34:24 +0000 (20:34 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 18 Dec 2022 19:07:56 +0000 (21:07 +0200)
This can be helpful for testing purposes.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/wpa_auth.c
src/ap/wpa_auth_i.h
src/ap/wpa_auth_ie.c

index d9acf101d46e2a1f0d923a69f0c8f89a31912efc..5fde990ea29da979d2dea2825d550bcb3011eb1b 100644 (file)
@@ -4830,11 +4830,13 @@ int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen)
                          "wpa=%d\n"
                          "AKMSuiteSelector=" RSN_SUITE "\n"
                          "hostapdWPAPTKState=%d\n"
-                         "hostapdWPAPTKGroupState=%d\n",
+                         "hostapdWPAPTKGroupState=%d\n"
+                         "hostapdMFPR=%d\n",
                          sm->wpa,
                          RSN_SUITE_ARG(wpa_akm_to_suite(sm->wpa_key_mgmt)),
                          sm->wpa_ptk_state,
-                         sm->wpa_ptk_group_state);
+                         sm->wpa_ptk_group_state,
+                         sm->mfpr);
        if (os_snprintf_error(buflen - len, ret))
                return len;
        len += ret;
index 99a95abfdec556be2f8879d0177ab4fb4e9d7e57..7ed3f2b6b25ce539815935bccbf6d2673da5e699 100644 (file)
@@ -86,6 +86,7 @@ struct wpa_state_machine {
        unsigned int pending_deinit:1;
        unsigned int started:1;
        unsigned int mgmt_frame_prot:1;
+       unsigned int mfpr:1;
        unsigned int rx_eapol_key_secure:1;
        unsigned int update_snonce:1;
        unsigned int alt_snonce_valid:1;
index 89d4a3ca0347c7492ab9778277986ed4689a1376..43ccec9bed2aab04d51ff46c6bca293b6591a9d0 100644 (file)
@@ -884,6 +884,7 @@ wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth,
                sm->mgmt_frame_prot = 0;
        else
                sm->mgmt_frame_prot = 1;
+       sm->mfpr = !!(data.capabilities & WPA_CAPABILITY_MFPR);
 
        if (sm->mgmt_frame_prot && (ciphers & WPA_CIPHER_TKIP)) {
                    wpa_printf(MSG_DEBUG,