From 288566031819e76ae49b73bd670594fe6faa4778 Mon Sep 17 00:00:00 2001 From: Adil Saeed Musthafa Date: Thu, 4 May 2023 09:34:51 -0700 Subject: [PATCH] Store pmk_r1_name derived with wpa_ft_local_derive_pmk_r1() properly 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 --- src/ap/wpa_auth_ft.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c index 35585cd95..2402ad922 100644 --- a/src/ap/wpa_auth_ft.c +++ b/src/ap/wpa_auth_ft.c @@ -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);