From 2d1f77c9a00e88746c11ef70580aa91f183e7461 Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Wed, 22 Nov 2017 16:20:28 +0530 Subject: [PATCH] qcacld-3.0: Fix to update KRK/BTK for ESE connection Currently driver updates KRK/BTK only during RSO start. Supplicant can update these KRK/BTK during timeout. But driver currently does not update KRK/BTK dynamically. This can lead to MIC failure in firmware and cause roaming failure. Update KRK/BTK as and when they are received using RSO update to fix this issue. Change-Id: Ib3ee656e63920d0162dea56eef7f052c585bb5a4 CRs-Fixed: 2149232 --- core/sme/inc/csr_api.h | 2 -- core/sme/inc/csr_support.h | 9 ++++++++- core/sme/src/csr/csr_api_roam.c | 14 ++++++++++++++ core/sme/src/csr/csr_util.c | 6 ++---- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 0ad8a20dcfc7..d12b89f25ce4 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -88,12 +88,10 @@ typedef enum { /* WAPI */ eCSR_ENCRYPT_TYPE_WPI, #endif /* FEATURE_WLAN_WAPI */ -#ifdef FEATURE_WLAN_ESE eCSR_ENCRYPT_TYPE_KRK, #ifdef WLAN_FEATURE_ROAM_OFFLOAD eCSR_ENCRYPT_TYPE_BTK, #endif -#endif /* FEATURE_WLAN_ESE */ #ifdef WLAN_FEATURE_11W /* 11w BIP */ eCSR_ENCRYPT_TYPE_AES_CMAC, diff --git a/core/sme/inc/csr_support.h b/core/sme/inc/csr_support.h index 7fd901b2a9c5..bb7925932f63 100644 --- a/core/sme/inc/csr_support.h +++ b/core/sme/inc/csr_support.h @@ -369,8 +369,15 @@ QDF_STATUS csr_validate_mcc_beacon_interval(tpAniSirGlobal pMac, uint8_t channel bool csr_is_profile11r(tCsrRoamProfile *pProfile); bool csr_is_auth_type11r(eCsrAuthType AuthType, uint8_t mdiePresent); #ifdef FEATURE_WLAN_ESE -bool csr_is_auth_type_ese(eCsrAuthType AuthType); bool csr_is_profile_ese(tCsrRoamProfile *pProfile); #endif +/** + * csr_is_auth_type_ese() - Checks whether Auth type is ESE or not + * @AuthType: Authentication type + * + * Return: true, if auth type is ese, false otherwise + */ +bool csr_is_auth_type_ese(eCsrAuthType AuthType); + #endif diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index d5d99b79354e..2f6a1ab68f4b 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -10522,6 +10522,13 @@ csr_update_key_cmd(tpAniSirGlobal mac_ctx, struct csr_roam_session *session, } qdf_mem_copy(session->eseCckmInfo.btk, set_key->Key, SIR_BTK_KEY_LEN); + /* + * KRK and BTK are updated by upper layer back to back. Send + * updated KRK and BTK together to FW here. + */ + csr_roam_offload_scan(mac_ctx, session->sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_ROAM_PSK_PMK_CHANGED); break; #endif #endif /* FEATURE_WLAN_ESE */ @@ -14031,6 +14038,13 @@ QDF_STATUS csr_roam_set_psk_pmk(tpAniSirGlobal pMac, uint32_t sessionId, } qdf_mem_copy(pSession->psk_pmk, pPSK_PMK, sizeof(pSession->psk_pmk)); pSession->pmk_len = pmk_len; + + if (csr_is_auth_type_ese(pMac->roam.roamSession[sessionId]. + connectedProfile.AuthType)) { + sme_debug("PMK update is not required for ESE"); + return QDF_STATUS_SUCCESS; + } + csr_roam_offload_scan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ROAM_PSK_PMK_CHANGED); diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 60c0f8db547c..d086c801b07c 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -2872,10 +2872,6 @@ bool csr_is_profile11r(tCsrRoamProfile *pProfile) pProfile->MDID.mdiePresent); } - -#ifdef FEATURE_WLAN_ESE - -/* Function to return true if the authtype is ESE */ bool csr_is_auth_type_ese(eCsrAuthType AuthType) { switch (AuthType) { @@ -2888,6 +2884,8 @@ bool csr_is_auth_type_ese(eCsrAuthType AuthType) return false; } +#ifdef FEATURE_WLAN_ESE + /* Function to return true if the profile is ESE */ bool csr_is_profile_ese(tCsrRoamProfile *pProfile) {