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)
This commit is contained in:
Deepthi Gowri 2016-09-01 12:31:18 +05:30 • committed by qcabuildsw
commit 9f2fc786f7
2 changed files with 22 additions and 21 deletions

View file

@ -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

View file

@ -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;