mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
qcacmn: Validate SSID first while fetching peer pmksa
Validate the SSID & cache ID if SSID length is present in the pmksa entry, as in FILS case only SSID and cache id are filled and BSSID is not filled. So validate the BSSID only if the SSID is not present. Change-Id: Ia0a31f953869f00495fad597bb564ec706425312 CRs-Fixed: 3051530
This commit is contained in:
parent
92c8c2bb84
commit
f2b85f4201
1 changed files with 25 additions and 13 deletions
|
|
@ -370,7 +370,8 @@ QDF_STATUS wlan_crypto_set_pmksa(struct wlan_crypto_params *crypto_params,
|
|||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
crypto_params->pmksa[first_available_slot] = pmksa;
|
||||
crypto_debug("PMKSA: Added the PMKSA entry at index=%d", i);
|
||||
crypto_debug("PMKSA: Added the PMKSA entry at index=%d",
|
||||
first_available_slot);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
@ -379,7 +380,7 @@ static
|
|||
QDF_STATUS wlan_crypto_del_pmksa(struct wlan_crypto_params *crypto_params,
|
||||
struct wlan_crypto_pmksa *pmksa)
|
||||
{
|
||||
uint8_t i, j;
|
||||
uint8_t i, j, valid_entries_in_table = 0;
|
||||
bool match_found = false;
|
||||
u8 del_pmk[MAX_PMK_LEN] = {0};
|
||||
|
||||
|
|
@ -387,7 +388,12 @@ QDF_STATUS wlan_crypto_del_pmksa(struct wlan_crypto_params *crypto_params,
|
|||
for (i = 0; i < WLAN_CRYPTO_MAX_PMKID; i++) {
|
||||
if (!crypto_params->pmksa[i])
|
||||
continue;
|
||||
if (qdf_is_macaddr_equal(&pmksa->bssid,
|
||||
|
||||
valid_entries_in_table++;
|
||||
|
||||
if (!pmksa->ssid_len &&
|
||||
!qdf_is_macaddr_zero(&pmksa->bssid) &&
|
||||
qdf_is_macaddr_equal(&pmksa->bssid,
|
||||
&crypto_params->pmksa[i]->bssid)) {
|
||||
match_found = true;
|
||||
} else if (pmksa->ssid_len &&
|
||||
|
|
@ -435,7 +441,8 @@ QDF_STATUS wlan_crypto_del_pmksa(struct wlan_crypto_params *crypto_params,
|
|||
}
|
||||
|
||||
if (i == WLAN_CRYPTO_MAX_PMKID && !match_found)
|
||||
crypto_debug("No such pmksa entry exists");
|
||||
crypto_debug("No such pmksa entry exists: valid entries:%d",
|
||||
valid_entries_in_table);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
@ -453,6 +460,8 @@ QDF_STATUS wlan_crypto_pmksa_flush(struct wlan_crypto_params *crypto_params)
|
|||
crypto_params->pmksa[i] = NULL;
|
||||
}
|
||||
|
||||
crypto_debug("Flushed the pmksa table");
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -607,16 +616,19 @@ wlan_crypto_get_peer_pmksa(struct wlan_objmgr_vdev *vdev,
|
|||
for (i = 0; i < WLAN_CRYPTO_MAX_PMKID; i++) {
|
||||
if (!crypto_params->pmksa[i])
|
||||
continue;
|
||||
if (qdf_is_macaddr_equal(&pmksa->bssid,
|
||||
&crypto_params->pmksa[i]->bssid)) {
|
||||
|
||||
if (pmksa->ssid_len &&
|
||||
!qdf_mem_cmp(pmksa->ssid,
|
||||
crypto_params->pmksa[i]->ssid,
|
||||
pmksa->ssid_len) &&
|
||||
!qdf_mem_cmp(pmksa->cache_id,
|
||||
crypto_params->pmksa[i]->cache_id,
|
||||
WLAN_CACHE_ID_LEN)) {
|
||||
return crypto_params->pmksa[i];
|
||||
} else if (pmksa->ssid_len &&
|
||||
!qdf_mem_cmp(pmksa->ssid,
|
||||
crypto_params->pmksa[i]->ssid,
|
||||
pmksa->ssid_len) &&
|
||||
!qdf_mem_cmp(pmksa->cache_id,
|
||||
crypto_params->pmksa[i]->cache_id,
|
||||
WLAN_CACHE_ID_LEN)){
|
||||
} else if (!pmksa->ssid_len &&
|
||||
!qdf_is_macaddr_zero(&pmksa->bssid) &&
|
||||
qdf_is_macaddr_equal(&pmksa->bssid,
|
||||
&crypto_params->pmksa[i]->bssid)) {
|
||||
return crypto_params->pmksa[i];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue