AP: Get rid of wpa_auth_pmksa_add3()

Simply pass another parameter to wpa_auth_pmksa_add2() instead.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Andrei Otcheretianski 2023-11-21 01:51:43 +02:00 committed by Jouni Malinen
parent e996704201
commit 6fc2d1357d
5 changed files with 7 additions and 26 deletions

View file

@ -1094,7 +1094,7 @@ int hostapd_ctrl_iface_pmksa_add(struct hostapd_data *hapd, char *cmd)
return -1; return -1;
return wpa_auth_pmksa_add2(hapd->wpa_auth, spa, pmk, pmk_len, return wpa_auth_pmksa_add2(hapd->wpa_auth, spa, pmk, pmk_len,
pmkid, expiration, akmp); pmkid, expiration, akmp, NULL);
} }

View file

@ -2133,7 +2133,7 @@ static void hostapd_dpp_rx_peer_disc_req(struct hostapd_data *hapd,
else else
expiration = 0; expiration = 0;
if (wpa_auth_pmksa_add3(hapd->wpa_auth, src, intro.pmk, intro.pmk_len, if (wpa_auth_pmksa_add2(hapd->wpa_auth, src, intro.pmk, intro.pmk_len,
intro.pmkid, expiration, intro.pmkid, expiration,
WPA_KEY_MGMT_DPP, pkhash) < 0) { WPA_KEY_MGMT_DPP, pkhash) < 0) {
wpa_printf(MSG_ERROR, "DPP: Failed to add PMKSA cache entry"); wpa_printf(MSG_ERROR, "DPP: Failed to add PMKSA cache entry");
@ -2907,7 +2907,7 @@ hostapd_dpp_rx_priv_peer_intro_update(struct hostapd_data *hapd, const u8 *src,
else else
expiration = 0; expiration = 0;
if (wpa_auth_pmksa_add3(hapd->wpa_auth, src, intro.pmk, intro.pmk_len, if (wpa_auth_pmksa_add2(hapd->wpa_auth, src, intro.pmk, intro.pmk_len,
intro.pmkid, expiration, intro.pmkid, expiration,
WPA_KEY_MGMT_DPP, pkhash) < 0) { WPA_KEY_MGMT_DPP, pkhash) < 0) {
wpa_printf(MSG_ERROR, "DPP: Failed to add PMKSA cache entry"); wpa_printf(MSG_ERROR, "DPP: Failed to add PMKSA cache entry");

View file

@ -2154,7 +2154,8 @@ prepare_auth_resp_fils(struct hostapd_data *hapd,
pmk, pmk_len, pmk, pmk_len,
sta->fils_erp_pmkid, sta->fils_erp_pmkid,
session_timeout, session_timeout,
wpa_auth_sta_key_mgmt(sta->wpa_sm)) < 0) { wpa_auth_sta_key_mgmt(sta->wpa_sm),
NULL) < 0) {
wpa_printf(MSG_ERROR, wpa_printf(MSG_ERROR,
"FILS: Failed to add PMKSA cache entry based on ERP"); "FILS: Failed to add PMKSA cache entry based on ERP");
} }
@ -3660,7 +3661,7 @@ static u16 owe_process_assoc_req(struct hostapd_data *hapd,
wpa_hexdump_key(MSG_DEBUG, "OWE: PMK", sta->owe_pmk, sta->owe_pmk_len); wpa_hexdump_key(MSG_DEBUG, "OWE: PMK", sta->owe_pmk, sta->owe_pmk_len);
wpa_hexdump(MSG_DEBUG, "OWE: PMKID", pmkid, PMKID_LEN); wpa_hexdump(MSG_DEBUG, "OWE: PMKID", pmkid, PMKID_LEN);
wpa_auth_pmksa_add2(hapd->wpa_auth, sta->addr, sta->owe_pmk, wpa_auth_pmksa_add2(hapd->wpa_auth, sta->addr, sta->owe_pmk,
sta->owe_pmk_len, pmkid, 0, WPA_KEY_MGMT_OWE); sta->owe_pmk_len, pmkid, 0, WPA_KEY_MGMT_OWE, NULL);
return WLAN_STATUS_SUCCESS; return WLAN_STATUS_SUCCESS;
} }

View file

@ -5734,29 +5734,12 @@ void wpa_auth_add_sae_pmkid(struct wpa_state_machine *sm, const u8 *pmkid)
int wpa_auth_pmksa_add2(struct wpa_authenticator *wpa_auth, const u8 *addr, int wpa_auth_pmksa_add2(struct wpa_authenticator *wpa_auth, const u8 *addr,
const u8 *pmk, size_t pmk_len, const u8 *pmkid,
int session_timeout, int akmp)
{
if (!wpa_auth || wpa_auth->conf.disable_pmksa_caching)
return -1;
wpa_hexdump_key(MSG_DEBUG, "RSN: Cache PMK (2)", pmk, PMK_LEN);
if (pmksa_cache_auth_add(wpa_auth->pmksa, pmk, pmk_len, pmkid,
NULL, 0, wpa_auth->addr, addr, session_timeout,
NULL, akmp))
return 0;
return -1;
}
int wpa_auth_pmksa_add3(struct wpa_authenticator *wpa_auth, const u8 *addr,
const u8 *pmk, size_t pmk_len, const u8 *pmkid, const u8 *pmk, size_t pmk_len, const u8 *pmkid,
int session_timeout, int akmp, const u8 *dpp_pkhash) int session_timeout, int akmp, const u8 *dpp_pkhash)
{ {
struct rsn_pmksa_cache_entry *entry; struct rsn_pmksa_cache_entry *entry;
if (wpa_auth->conf.disable_pmksa_caching) if (!wpa_auth || wpa_auth->conf.disable_pmksa_caching)
return -1; return -1;
wpa_hexdump_key(MSG_DEBUG, "RSN: Cache PMK (3)", pmk, PMK_LEN); wpa_hexdump_key(MSG_DEBUG, "RSN: Cache PMK (3)", pmk, PMK_LEN);

View file

@ -481,9 +481,6 @@ int wpa_auth_pmksa_add_sae(struct wpa_authenticator *wpa_auth, const u8 *addr,
int akmp); int akmp);
void wpa_auth_add_sae_pmkid(struct wpa_state_machine *sm, const u8 *pmkid); void wpa_auth_add_sae_pmkid(struct wpa_state_machine *sm, const u8 *pmkid);
int wpa_auth_pmksa_add2(struct wpa_authenticator *wpa_auth, const u8 *addr, int wpa_auth_pmksa_add2(struct wpa_authenticator *wpa_auth, const u8 *addr,
const u8 *pmk, size_t pmk_len, const u8 *pmkid,
int session_timeout, int akmp);
int wpa_auth_pmksa_add3(struct wpa_authenticator *wpa_auth, const u8 *addr,
const u8 *pmk, size_t pmk_len, const u8 *pmkid, const u8 *pmk, size_t pmk_len, const u8 *pmkid,
int session_timeout, int akmp, const u8 *dpp_pkhash); int session_timeout, int akmp, const u8 *dpp_pkhash);
void wpa_auth_pmksa_remove(struct wpa_authenticator *wpa_auth, void wpa_auth_pmksa_remove(struct wpa_authenticator *wpa_auth,