From 0cbfc58454f9642feab70d2c82fde63b8a5c3d35 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Sat, 12 Jun 2021 23:48:18 +0530 Subject: [PATCH] qcacmn: Allow PMKID only entries also to pmksa cache In SAP case, external authentication(offloaded SAE authentication to userspace) status event carries only PMKID to allow/disallow peers to do PMKID+open auth based connection once the peers are already SAE authenticated. A check is added on the PMK length with the below change, change: Ic41c2044e70f8d375130ef9e0af9fe4b83027c26. It rejects the PMKID update to the pmk cache if the PMK length is 0. It's not allowing to cache PMKID derived as part of SAE authentication. There is no need to cache the PMK in SAE case as it won't be used internally by driver or won't even be sent to firmware. So, don't add any check and allow PMKID only entries also to facilitate PMK caching mechanism in SAE SAP. Change-Id: Ibd72975e91d93af9665c392b4e7a708a5f9c336a CRs-Fixed: 2967752 --- umac/cmn_services/crypto/src/wlan_crypto_global_api.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c index 729efa7190bf..7b2f05a02e4a 100644 --- a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c +++ b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c @@ -485,13 +485,9 @@ QDF_STATUS wlan_crypto_set_del_pmksa(struct wlan_objmgr_vdev *vdev, crypto_params = &crypto_priv->crypto_params; if (set) { - if (!pmksa->pmk_len || pmksa->pmk_len > MAX_PMK_LEN) { - crypto_err("Invalid PMK length"); - return QDF_STATUS_E_FAILURE; - } - pmkid_cache = wlan_crypto_get_pmksa(vdev, &pmksa->bssid); - if (pmkid_cache && (!qdf_mem_cmp(pmkid_cache->pmk, pmksa->pmk, + if (pmkid_cache && ((pmksa->pmk_len == pmkid_cache->pmk_len) && + !qdf_mem_cmp(pmkid_cache->pmk, pmksa->pmk, pmksa->pmk_len))) { crypto_debug("PMKSA entry found with same PMK"); pmkid_cache = NULL;