]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FT: Maintain PMK-R1 for a connected STA
authorJouni Malinen <jouni@codeaurora.org>
Thu, 18 Apr 2019 15:17:07 +0000 (18:17 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 18 Apr 2019 22:12:30 +0000 (01:12 +0300)
This is needed to allow PTK rekeying to be performed through 4-way
handshake in an association started through FT protocol.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/wpa_auth.c
src/ap/wpa_auth_ft.c
src/ap/wpa_auth_i.h

index 158207125eaa7565797cb3c94c1994f65ef1e0f7..ff6bf7cdbc70cbb69d1b36d45a2543843f979fe2 100644 (file)
@@ -1748,6 +1748,8 @@ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event)
                sm->pmk_len = 0;
                os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
                sm->xxkey_len = 0;
+               os_memset(sm->pmk_r1, 0, sizeof(sm->pmk_r1));
+               sm->pmk_r1_len = 0;
 #endif /* CONFIG_IEEE80211R_AP */
                break;
        case WPA_REAUTH:
index 5fb41c450a3942d79ce716fae2e49d643c1899b8..ac16199a6006f742f87e3c2ec2ecfed314f7407a 100644 (file)
@@ -2983,6 +2983,8 @@ pmk_r1_derived:
        wpa_hexdump_key(MSG_DEBUG, "FT: Selected PMK-R1", pmk_r1, pmk_r1_len);
        sm->pmk_r1_name_valid = 1;
        os_memcpy(sm->pmk_r1_name, pmk_r1_name, WPA_PMK_NAME_LEN);
+       os_memcpy(sm->pmk_r1, pmk_r1, pmk_r1_len);
+       sm->pmk_r1_len = pmk_r1_len;
 
        if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) {
                wpa_printf(MSG_DEBUG, "FT: Failed to get random data for "
index 15512368e9ecfaca8b887b2733e110b221d58ec5..4babd0cbb044c51be3404cd04a4eaeb1d5a5b47f 100644 (file)
@@ -119,6 +119,8 @@ struct wpa_state_machine {
        u8 xxkey[PMK_LEN_MAX]; /* PSK or the second 256 bits of MSK, or the
                                * first 384 bits of MSK */
        size_t xxkey_len;
+       u8 pmk_r1[PMK_LEN_MAX];
+       unsigned int pmk_r1_len;
        u8 pmk_r1_name[WPA_PMK_NAME_LEN]; /* PMKR1Name derived from FT Auth
                                           * Request */
        u8 r0kh_id[FT_R0KH_ID_MAX_LEN]; /* R0KH-ID from FT Auth Request */