From 9f2fc786f7f48c19096d8cf4710a00dde113d479 Mon Sep 17 00:00:00 2001 From: Deepthi Gowri Date: Thu, 1 Sep 2016 12:31:18 +0530 Subject: qcacld-3.0: Do not make a PMF connection, if supplicant sets it as optional qcacld-2.0 to qcacld-3.0 propagation In earlier android builds PMF was not enabled by default in the supplicant unlike the latest builds. So even if PMF is set as optional, driver was mandating it. So if we try to roam to an AP which is not PMF capabale driver would simply drop the connection. To address this, allow non PMF connection if PMF is set as optional by the supplicant and the AP is not capable. CRs-Fixed: 1018482 Change-Id: Ideecb861dcc362f94a73b47d1a4766d621a38214 (cherry picked from commit ec4d9feff5461a575b2988b38428b89cf6337584) (cherry picked from commit 54b657e08ac628616b8cf6cbddfb9204ecf28ce5) --- core/sme/src/csr/csr_api_roam.c | 5 +++++ core/sme/src/csr/csr_util.c | 38 +++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 763946a76cf0..d4f0d1bf113c 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -14028,6 +14028,11 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, else csr_join_req->MgmtEncryptionType = eSIR_ED_NONE; #endif + if (pProfile->MFPEnabled && + !(pProfile->MFPRequired) && + ((pIes->RSN.present) && + (!(pIes->RSN.RSN_Cap[0] >> 7) & 0x1))) + csr_join_req->MgmtEncryptionType = eSIR_ED_NONE; #ifdef FEATURE_WLAN_ESE ese_config = pMac->roam.configParam.isEseIniFeatureEnabled; #endif diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 904d2953f993..bbcecf077bec 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -2829,25 +2829,21 @@ csr_is_pmf_capabilities_in_rsn_match(tHalHandle hHal, /* Extracting MFPCapable bit from RSN Ie */ apProfileMFPCapable = (pRSNIe->RSN_Cap[0] >> 7) & 0x1; apProfileMFPRequired = (pRSNIe->RSN_Cap[0] >> 6) & 0x1; + + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("pFilterMFPEnabled=%d pFilterMFPRequired=%d" + "pFilterMFPCapable=%d apProfileMFPCapable=%d" + "apProfileMFPRequired=%d"), + *pFilterMFPEnabled, *pFilterMFPRequired, + *pFilterMFPCapable, apProfileMFPCapable, + apProfileMFPRequired); + if (*pFilterMFPEnabled && *pFilterMFPCapable && *pFilterMFPRequired && (apProfileMFPCapable == 0)) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, "AP is not capable to make PMF connection"); return false; - } else if (*pFilterMFPEnabled && *pFilterMFPCapable && - !(*pFilterMFPRequired) && - (apProfileMFPCapable == 0)) { - /* - * This is tricky, because supplicant asked us to - * make mandatory PMF connection eventhough PMF - * connection is optional here. - * so if AP is not capable of PMF then drop it. - * Don't try to connect with it. - */ - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, - "we need PMF connection & AP isn't capable to make PMF connection"); - return false; - } else if (!(*pFilterMFPCapable) && + } else if (!(*pFilterMFPCapable) && apProfileMFPCapable && apProfileMFPRequired) { /* @@ -2858,11 +2854,6 @@ csr_is_pmf_capabilities_in_rsn_match(tHalHandle hHal, QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, "AP needs PMF connection and we are not capable of pmf connection"); return false; - } else if (!(*pFilterMFPEnabled) && *pFilterMFPCapable && - (apProfileMFPCapable == 1)) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, - "we don't need PMF connection even though both parties are capable"); - return false; } } return true; @@ -3041,7 +3032,11 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId, } #ifdef WLAN_FEATURE_11W - if (pProfile->MFPEnabled) { + /* Advertise BIP in group cipher key management only if PMF is + * enabled and AP is capable. + */ + if (pProfile->MFPEnabled && + (RSNCapabilities.MFPCapable && pProfile->MFPCapable)) { pGroupMgmtCipherSuite = (uint8_t *) pPMK + sizeof(uint16_t) + (pPMK->cPMKIDs * CSR_RSN_PMKID_SIZE); @@ -3065,7 +3060,8 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId, CSR_RSN_PMKID_SIZE)); } #ifdef WLAN_FEATURE_11W - if (pProfile->MFPEnabled) { + if (pProfile->MFPEnabled && + (RSNCapabilities.MFPCapable && pProfile->MFPCapable)) { if (0 == pPMK->cPMKIDs) pRSNIe->IeHeader.Length += sizeof(uint16_t); pRSNIe->IeHeader.Length += CSR_WPA_OUI_SIZE; -- cgit v1.2.3