summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbings <bings@codeaurora.org>2019-04-15 18:14:45 +0800
committerbings <bings@codeaurora.org>2019-04-16 13:46:53 +0800
commit9cdd40e95b928d143c3f2609417c7b6136fb3f55 (patch)
tree126f39690bf6b3afbe1e33e2adaf28c5f396fa1f
parent798a60e83f3a4cea737ae64a3508aaa97b08968d (diff)
qcacld-2.0: Update PMK cache and fix SAE PMK Cache Auth failure
SAE auth frame is sent even if PMK is cached, which causes SAE PMK cache feature failure. PMK cache match fails when looking up PMK cache through BSSID. Fix PMK saved information as below. Save PMK ssid if ssid is valid. Save PMK bssid. Save PMK cache id. PMK cache information is not passed to pe session correctly. Update PMK cache information from tpSirSmeJoinReq to pesession. When auth type is SAE and PMK is cached, it is exepcted to receive open auth frame 2, so keep on sending association request instead of breaking out. Change-Id: I1158366834bd0a7fb884b7ae1bf9390df810da4d CRs-Fixed: 2431765
-rw-r--r--CORE/MAC/inc/sirApi.h2
-rw-r--r--CORE/MAC/src/pe/lim/limProcessAuthFrame.c3
-rw-r--r--CORE/MAC/src/pe/lim/limSerDesUtils.c9
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c45
4 files changed, 36 insertions, 23 deletions
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 339b6899cdaa..eaed71548ef6 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -1133,6 +1133,7 @@ typedef struct sSirSmeJoinReq
tANI_U8 cc_switch_mode;
#endif
tVOS_CON_MODE staPersona; //Persona
+ bool sae_pmk_cached;
bool osen_association;
bool wps_registration;
ePhyChanBondState cbMode; // Pass CB mode value in Join.
@@ -1211,7 +1212,6 @@ typedef struct sSirSmeJoinReq
#ifdef WLAN_FEATURE_FILS_SK
struct cds_fils_connection_info fils_con_info;
#endif
- bool sae_pmk_cached;
tSirBssDescription bssDescription;
/*
* WARNING: Pls make bssDescription as last variable in struct
diff --git a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c
index 04f6fc195030..02fc4cb6c675 100644
--- a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c
@@ -1248,9 +1248,8 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse
FL("received Auth frame2 for unexpected auth algo number %d"
MAC_ADDRESS_STR), pRxAuthFrameBody->authAlgoNumber,
MAC_ADDR_ARRAY(pHdr->sa));)
+ break;
}
-
- break;
}
if (pRxAuthFrameBody->authStatusCode ==
diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c
index 2afb5e9c4fb4..255f01aef764 100644
--- a/CORE/MAC/src/pe/lim/limSerDesUtils.c
+++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017, 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -947,6 +947,13 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf)
limLog(pMac, LOGE, FL("remaining len %d is too short"), len);
return eSIR_FAILURE;
}
+ pJoinReq->sae_pmk_cached = *pBuf++;
+ len--;
+ if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
+ {
+ limLog(pMac, LOGE, FL("remaining len %d is too short"), len);
+ return eSIR_FAILURE;
+ }
pJoinReq->osen_association = *pBuf++;
len--;
if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 3f9c721fca22..015184660be1 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -13840,20 +13840,19 @@ static void csr_update_pmk_cache(tCsrRoamSession *pSession,
uint16_t cache_idx = pSession->curr_cache_idx;
/* Add entry to the cache */
- if (!pmksa->ssid_len) {
- vos_copy_macaddr(
- (v_MACADDR_t *)pSession->PmkidCacheInfo[cache_idx].BSSID,
- (v_MACADDR_t *)pmksa->BSSID);
- pSession->PmkidCacheInfo[cache_idx].ssid_len = 0;
- } else {
+ pSession->PmkidCacheInfo[cache_idx].ssid_len = 0;
+ if (pmksa->ssid_len) {
vos_mem_copy(pSession->PmkidCacheInfo[cache_idx].ssid,
pmksa->ssid, pmksa->ssid_len);
pSession->PmkidCacheInfo[cache_idx].ssid_len =
pmksa->ssid_len;
- vos_mem_copy(pSession->PmkidCacheInfo[cache_idx].cache_id,
- pmksa->cache_id, CACHE_ID_LEN);
-
}
+ vos_copy_macaddr(
+ (v_MACADDR_t *)pSession->PmkidCacheInfo[cache_idx].BSSID,
+ (v_MACADDR_t *)pmksa->BSSID);
+ vos_mem_copy(pSession->PmkidCacheInfo[cache_idx].cache_id,
+ pmksa->cache_id, CACHE_ID_LEN);
+
vos_mem_copy(
pSession->PmkidCacheInfo[cache_idx].PMKID,
pmksa->PMKID, CSR_RSN_PMKID_SIZE);
@@ -14435,27 +14434,34 @@ static void csr_update_fils_connection_info(tCsrRoamProfile *profile,
*
* Return: None
*/
-static void csr_update_sae_config(tSirSmeJoinReq *csr_join_req,
- tpAniSirGlobal mac, tCsrRoamSession *session)
+static bool csr_update_sae_config(tSirMacAddr bssid,
+ tpAniSirGlobal mac,
+ tCsrRoamSession *session)
{
tPmkidCacheInfo pmkid_cache;
uint32_t index;
+ bool sae_pmk_cached;
vos_mem_copy(pmkid_cache.BSSID,
- csr_join_req->bssDescription.bssId, VOS_MAC_ADDR_SIZE);
+ bssid, VOS_MAC_ADDR_SIZE);
- csr_join_req->sae_pmk_cached =
+ sae_pmk_cached =
csr_lookup_pmkid_using_bssid(mac, session, &pmkid_cache, &index);
VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG,
"pmk_cached %d for BSSID=" MAC_ADDRESS_STR,
- csr_join_req->sae_pmk_cached,
- MAC_ADDR_ARRAY(csr_join_req->bssDescription.bssId));
+ sae_pmk_cached,
+ MAC_ADDR_ARRAY(bssid));
+
+ return sae_pmk_cached;
}
#else
-static void csr_update_sae_config(tSirSmeJoinReq *csr_join_req,
- tpAniSirGlobal mac, tCsrRoamSession *session)
-{ }
+static bool csr_update_sae_config(tSirMacAddr bssid,
+ tpAniSirGlobal mac,
+ tCsrRoamSession *session)
+{
+ return false;
+}
#endif
@@ -14699,6 +14705,8 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe
//Persona
*pBuf = (tANI_U8)pProfile->csrPersona;
pBuf++;
+ *pBuf = csr_update_sae_config(pBssDescription->bssId, pMac, pSession);
+ pBuf++;
*pBuf = (tANI_U8)pProfile->bOSENAssociation;
pBuf++;
*pBuf = (tANI_U8)pProfile->bWPSAssociation;
@@ -15274,7 +15282,6 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe
csrPrepareJoinReassocReqBuffer(pMac, pBssDescription, pBuf,
(tANI_U8)pProfile->uapsd_mask,
messageType, pProfile);
- csr_update_sae_config(pMsg, pMac, pSession);
pBuf += used_length;
/*