]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Store pmk_r1_name derived with wpa_ft_local_derive_pmk_r1() properly
authorAdil Saeed Musthafa <quic_adilm@quicinc.com>
Thu, 4 May 2023 16:34:51 +0000 (09:34 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 25 May 2023 14:11:59 +0000 (17:11 +0300)
The parameter req_pmk_r1_name was not used at all in the function
wpa_ft_local_derive_pmk_r1(). In addition, the PMK-R1-NAME should be
updated in this function along with the PMK-R1. This means the parameter
should change from "req_pmk_r1_name" to "out_pmk_r1_name" to match the
design used for other paths that derive the PMK-R1.

sm->pmk_r1_name needs to be properly updated when pmk_r1_name is derived
from the local pmk_r0.

Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
src/ap/wpa_auth_ft.c

index 35585cd9507c591397dc9a2222e3423eb576c738..2402ad922672b1bf3d50b4927eea736b35b88baf 100644 (file)
@@ -3085,7 +3085,7 @@ static int wpa_ft_local_derive_pmk_r1(struct wpa_authenticator *wpa_auth,
                                      struct wpa_state_machine *sm,
                                      const u8 *r0kh_id, size_t r0kh_id_len,
                                      const u8 *req_pmk_r0_name,
-                                     const u8 *req_pmk_r1_name,
+                                     u8 *out_pmk_r1_name,
                                      u8 *out_pmk_r1, int *out_pairwise,
                                      struct vlan_description *vlan,
                                      const u8 **identity, size_t *identity_len,
@@ -3096,7 +3096,6 @@ static int wpa_ft_local_derive_pmk_r1(struct wpa_authenticator *wpa_auth,
 {
        struct wpa_auth_config *conf = &wpa_auth->conf;
        const struct wpa_ft_pmk_r0_sa *r0;
-       u8 pmk_r1_name[WPA_PMK_NAME_LEN];
        int expires_in = 0;
        int session_timeout = 0;
        struct os_reltime now;
@@ -3115,7 +3114,7 @@ static int wpa_ft_local_derive_pmk_r1(struct wpa_authenticator *wpa_auth,
 
        if (wpa_derive_pmk_r1(r0->pmk_r0, r0->pmk_r0_len, r0->pmk_r0_name,
                              conf->r1_key_holder,
-                             sm->addr, out_pmk_r1, pmk_r1_name) < 0)
+                             sm->addr, out_pmk_r1, out_pmk_r1_name) < 0)
                return -1;
 
        os_get_reltime(&now);
@@ -3126,7 +3125,7 @@ static int wpa_ft_local_derive_pmk_r1(struct wpa_authenticator *wpa_auth,
                session_timeout = r0->session_timeout - now.sec;
 
        wpa_ft_store_pmk_r1(wpa_auth, sm->addr, out_pmk_r1, r0->pmk_r0_len,
-                           pmk_r1_name,
+                           out_pmk_r1_name,
                            sm->pairwise, r0->vlan, expires_in, session_timeout,
                            r0->identity, r0->identity_len,
                            r0->radius_cui, r0->radius_cui_len);