]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FT: Add helper function for FILS key storing
authorMichael Braun <michael-dev@fami-braun.de>
Thu, 18 May 2017 13:21:50 +0000 (15:21 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 5 Apr 2018 10:47:43 +0000 (13:47 +0300)
FILS calls wpa_ft_store_pmk_r0() from wpa_auth.c. This is moved into a
new function wpa_ft_store_pmk_fils() in preparation of additional
information being needed.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
src/ap/wpa_auth.c
src/ap/wpa_auth_ft.c
src/ap/wpa_auth_i.h

index 76d4b5f80a982ff2235d73cbb93145fd1e564158..f9fe6e67e402dff5061afd3a33518f2c14185ba0 100644 (file)
@@ -2134,8 +2134,7 @@ int fils_auth_pmk_to_ptk(struct wpa_state_machine *sm, const u8 *pmk,
                wpa_hexdump_key(MSG_DEBUG, "FILS+FT: PMK-R0", pmk_r0, PMK_LEN);
                wpa_hexdump(MSG_DEBUG, "FILS+FT: PMKR0Name",
                            pmk_r0_name, WPA_PMK_NAME_LEN);
-               wpa_ft_store_pmk_r0(wpa_auth, sm->addr, pmk_r0, pmk_r0_name,
-                                   sm->pairwise);
+               wpa_ft_store_pmk_fils(sm, pmk_r0, pmk_r0_name);
                os_memset(fils_ft, 0, sizeof(fils_ft));
        }
 #endif /* CONFIG_IEEE80211R_AP */
index 8086ee2e07abd66525f04c9402201660fd2215f5..e145d4e66d705a13a8464ccef0f5a8c0cd85d7c8 100644 (file)
@@ -892,9 +892,9 @@ void wpa_ft_pmk_cache_deinit(struct wpa_ft_pmk_cache *cache)
 }
 
 
-int wpa_ft_store_pmk_r0(struct wpa_authenticator *wpa_auth,
-                       const u8 *spa, const u8 *pmk_r0,
-                       const u8 *pmk_r0_name, int pairwise)
+static int wpa_ft_store_pmk_r0(struct wpa_authenticator *wpa_auth,
+                              const u8 *spa, const u8 *pmk_r0,
+                              const u8 *pmk_r0_name, int pairwise)
 {
        struct wpa_ft_pmk_cache *cache = wpa_auth->ft_pmk_cache;
        struct wpa_ft_pmk_r0_sa *r0;
@@ -1517,6 +1517,14 @@ static int wpa_ft_pull_pmk_r1(struct wpa_state_machine *sm,
 }
 
 
+int wpa_ft_store_pmk_fils(struct wpa_state_machine *sm,
+                         const u8 *pmk_r0, const u8 *pmk_r0_name)
+{
+       return wpa_ft_store_pmk_r0(sm->wpa_auth, sm->addr, pmk_r0, pmk_r0_name,
+                                  sm->pairwise);
+}
+
+
 int wpa_auth_derive_ptk_ft(struct wpa_state_machine *sm, const u8 *pmk,
                           struct wpa_ptk *ptk)
 {
index 609405a26465182f04e5448009379582a125c3ab..9f797e92a26105b22ce8dbb791cbada8598c7994 100644 (file)
@@ -286,9 +286,8 @@ int wpa_auth_derive_ptk_ft(struct wpa_state_machine *sm, const u8 *pmk,
 struct wpa_ft_pmk_cache * wpa_ft_pmk_cache_init(void);
 void wpa_ft_pmk_cache_deinit(struct wpa_ft_pmk_cache *cache);
 void wpa_ft_install_ptk(struct wpa_state_machine *sm);
-int wpa_ft_store_pmk_r0(struct wpa_authenticator *wpa_auth,
-                       const u8 *spa, const u8 *pmk_r0,
-                       const u8 *pmk_r0_name, int pairwise);
+int wpa_ft_store_pmk_fils(struct wpa_state_machine *sm, const u8 *pmk_r0,
+                         const u8 *pmk_r0_name);
 #endif /* CONFIG_IEEE80211R_AP */
 
 #endif /* WPA_AUTH_I_H */