qcacld-3.0: Cleanup WLAN_CONV_CRYPTO_IE_SUPPORT flag
WLAN_CONV_CRYPTO_IE_SUPPORT is a temporary flag which is used for converged crypto component transition. The transition has already been done, so cleanup legacy code related to the flag. Change-Id: Ide9fa97a9eb0b5c197c762205f386651efc51e33 CRs-fixed: 2592096
This commit is contained in:
parent
a545a92201
commit
d03d10bcd1
1
Kbuild
1
Kbuild
@ -2579,7 +2579,6 @@ cppflags-$(CONFIG_WLAN_FEATURE_SARV1_TO_SARV2) += -DWLAN_FEATURE_SARV1_TO_SARV2
|
||||
#CRYPTO Coverged Component
|
||||
cppflags-$(CONFIG_CRYPTO_COMPONENT) += -DWLAN_CONV_CRYPTO_SUPPORTED \
|
||||
-DCRYPTO_SET_KEY_CONVERGED \
|
||||
-DWLAN_CONV_CRYPTO_IE_SUPPORT \
|
||||
-DWLAN_CRYPTO_WEP_OS_DERIVATIVE \
|
||||
-DWLAN_CRYPTO_TKIP_OS_DERIVATIVE \
|
||||
-DWLAN_CRYPTO_CCMP_OS_DERIVATIVE \
|
||||
|
@ -21727,7 +21727,6 @@ static int wlan_hdd_cfg80211_add_station(struct wiphy *wiphy,
|
||||
return errno;
|
||||
}
|
||||
|
||||
#ifdef WLAN_CONV_CRYPTO_IE_SUPPORT
|
||||
static QDF_STATUS wlan_hdd_set_pmksa_cache(struct hdd_adapter *adapter,
|
||||
tPmkidCacheInfo *pmk_cache)
|
||||
{
|
||||
@ -21791,34 +21790,6 @@ QDF_STATUS wlan_hdd_flush_pmksa_cache(struct hdd_adapter *adapter)
|
||||
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
static QDF_STATUS wlan_hdd_set_pmksa_cache(struct hdd_adapter *adapter,
|
||||
tPmkidCacheInfo *pmk_cache)
|
||||
{
|
||||
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
|
||||
return sme_roam_set_pmkid_cache(
|
||||
hdd_ctx->mac_handle, adapter->vdev_id, pmk_cache, 1, false);
|
||||
}
|
||||
|
||||
static QDF_STATUS wlan_hdd_del_pmksa_cache(struct hdd_adapter *adapter,
|
||||
tPmkidCacheInfo *pmk_cache)
|
||||
{
|
||||
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
|
||||
return sme_roam_del_pmkid_from_cache(
|
||||
hdd_ctx->mac_handle, adapter->vdev_id, pmk_cache,
|
||||
false);
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_hdd_flush_pmksa_cache(struct hdd_adapter *adapter)
|
||||
{
|
||||
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
|
||||
return sme_roam_del_pmkid_from_cache(
|
||||
hdd_ctx->mac_handle, adapter->vdev_id, NULL, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \
|
||||
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
|
||||
|
@ -301,260 +301,6 @@ uint8_t lim_check_mcs_set(struct mac_context *mac, uint8_t *supportedMCSSet)
|
||||
#define SECURITY_SUITE_TYPE_GCMP 0x8
|
||||
#define SECURITY_SUITE_TYPE_GCMP_256 0x9
|
||||
|
||||
#ifndef WLAN_CONV_CRYPTO_IE_SUPPORT
|
||||
/**
|
||||
* is_non_rsn_cipher()- API to check whether cipher suit is rsn or not
|
||||
* @cipher_suite: cipher suit
|
||||
*
|
||||
* Return: True in case non ht cipher else false
|
||||
*/
|
||||
static inline bool is_non_rsn_cipher(uint8_t cipher_suite)
|
||||
{
|
||||
uint8_t cipher_mask;
|
||||
|
||||
cipher_mask = cipher_suite & SECURITY_SUITE_TYPE_MASK;
|
||||
if ((cipher_mask == SECURITY_SUITE_TYPE_CCMP) ||
|
||||
(cipher_mask == SECURITY_SUITE_TYPE_GCMP) ||
|
||||
(cipher_mask == SECURITY_SUITE_TYPE_GCMP_256))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* lim_check_rx_rsn_ie_match()- validate received rsn ie with supported cipher
|
||||
* suites.
|
||||
* @mac_ctx: pointer to global mac structure
|
||||
* @rx_rsn_ie: received rsn IE pointer
|
||||
* @session_entry: pe session entry
|
||||
* @sta_is_ht: peer station HT capability
|
||||
* @pmf_connection: set to true if this is pmf connection
|
||||
*
|
||||
* This function is called during Association/Reassociation
|
||||
* frame handling to determine whether received RSN in
|
||||
* Assoc/Reassoc request frames include supported cipher suites or not.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS if ALL supported cipher suites are present in the
|
||||
* received rsn IE else failure status.
|
||||
*/
|
||||
|
||||
uint8_t lim_check_rx_rsn_ie_match(struct mac_context *mac_ctx,
|
||||
tDot11fIERSN * const rx_rsn_ie,
|
||||
struct pe_session *session_entry, uint8_t sta_is_ht,
|
||||
bool *pmf_connection)
|
||||
{
|
||||
tDot11fIERSN *rsn_ie;
|
||||
bool match = false;
|
||||
uint8_t i, j, only_non_ht_cipher = 1;
|
||||
#ifdef WLAN_FEATURE_11W
|
||||
bool we_are_pmf_capable;
|
||||
bool we_require_pmf;
|
||||
bool they_are_pmf_capable;
|
||||
bool they_require_pmf;
|
||||
#endif
|
||||
|
||||
/* RSN IE should be received from PE */
|
||||
rsn_ie = &session_entry->gStartBssRSNIe;
|
||||
|
||||
if (!rx_rsn_ie) {
|
||||
pe_debug("Rx RSN IE is NULL");
|
||||
return eSIR_MAC_UNSPEC_FAILURE_STATUS;
|
||||
}
|
||||
|
||||
/* We should have only one AKM in assoc/reassoc request */
|
||||
if (rx_rsn_ie->akm_suite_cnt != 1) {
|
||||
pe_debug("Invalid RX akm_suite_cnt %d",
|
||||
rx_rsn_ie->akm_suite_cnt);
|
||||
return eSIR_MAC_INVALID_AKMP_STATUS;
|
||||
}
|
||||
/* Check if we support the received AKM */
|
||||
for (i = 0; i < rsn_ie->akm_suite_cnt; i++)
|
||||
if (!qdf_mem_cmp(&rx_rsn_ie->akm_suite[0],
|
||||
&rsn_ie->akm_suite[i],
|
||||
sizeof(rsn_ie->akm_suite[i]))) {
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
if (!match) {
|
||||
pe_debug("Invalid RX akm_suite");
|
||||
return eSIR_MAC_INVALID_AKMP_STATUS;
|
||||
}
|
||||
|
||||
/* Check groupwise cipher suite */
|
||||
for (i = 0; i < sizeof(rx_rsn_ie->gp_cipher_suite); i++)
|
||||
if (rsn_ie->gp_cipher_suite[i] !=
|
||||
rx_rsn_ie->gp_cipher_suite[i]) {
|
||||
pe_debug("Invalid groupwise cipher suite");
|
||||
return eSIR_MAC_INVALID_GROUP_CIPHER_STATUS;
|
||||
}
|
||||
|
||||
/*
|
||||
* For each Pairwise cipher suite check whether we support
|
||||
* received pairwise
|
||||
*/
|
||||
match = false;
|
||||
for (i = 0; i < rx_rsn_ie->pwise_cipher_suite_count; i++) {
|
||||
for (j = 0; j < rsn_ie->pwise_cipher_suite_count; j++) {
|
||||
if (!qdf_mem_cmp(&rx_rsn_ie->pwise_cipher_suites[i],
|
||||
&rsn_ie->pwise_cipher_suites[j],
|
||||
sizeof(rsn_ie->pwise_cipher_suites[j]))) {
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sta_is_ht)
|
||||
#ifdef ANI_LITTLE_BYTE_ENDIAN
|
||||
only_non_ht_cipher = is_non_rsn_cipher(
|
||||
rx_rsn_ie->pwise_cipher_suites[i][3]);
|
||||
#else
|
||||
only_non_ht_cipher = is_non_rsn_cipher(
|
||||
rx_rsn_ie->pwise_cipher_suites[i][0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((!match) || ((sta_is_ht) && only_non_ht_cipher)) {
|
||||
pe_debug("Invalid pairwise cipher suite");
|
||||
return eSIR_MAC_INVALID_PAIRWISE_CIPHER_STATUS;
|
||||
}
|
||||
/*
|
||||
* Check RSN capabilities
|
||||
* Bit 0 of First Byte - PreAuthentication Capability
|
||||
*/
|
||||
if (((rx_rsn_ie->RSN_Cap[0] >> 0) & 0x1) == true) {
|
||||
/* this is supported by AP only */
|
||||
pe_debug("Invalid RSN information element capabilities");
|
||||
return eSIR_MAC_INVALID_RSN_IE_CAPABILITIES_STATUS;
|
||||
}
|
||||
|
||||
*pmf_connection = false;
|
||||
|
||||
#ifdef WLAN_FEATURE_11W
|
||||
we_are_pmf_capable = session_entry->pLimStartBssReq->pmfCapable;
|
||||
we_require_pmf = session_entry->pLimStartBssReq->pmfRequired;
|
||||
they_are_pmf_capable = (rx_rsn_ie->RSN_Cap[0] >> 7) & 0x1;
|
||||
they_require_pmf = (rx_rsn_ie->RSN_Cap[0] >> 6) & 0x1;
|
||||
|
||||
if ((they_require_pmf && they_are_pmf_capable && !we_are_pmf_capable) ||
|
||||
(we_require_pmf && !they_are_pmf_capable)) {
|
||||
pe_debug("Association fail, robust management frames policy"
|
||||
" violation they_require_pmf =%d"
|
||||
" theyArePMFCapable %d weArePMFCapable %d"
|
||||
" weRequirePMF %d theyArePMFCapable %d",
|
||||
they_require_pmf, they_are_pmf_capable,
|
||||
we_are_pmf_capable, we_require_pmf,
|
||||
they_are_pmf_capable);
|
||||
return eSIR_MAC_ROBUST_MGMT_FRAMES_POLICY_VIOLATION;
|
||||
}
|
||||
|
||||
if (they_are_pmf_capable && we_are_pmf_capable)
|
||||
*pmf_connection = true;
|
||||
|
||||
pe_debug("weAreCapable %d, weRequire %d, theyAreCapable %d,"
|
||||
" theyRequire %d, PMFconnection %d",
|
||||
we_are_pmf_capable, we_require_pmf, they_are_pmf_capable,
|
||||
they_require_pmf, *pmf_connection);
|
||||
#endif
|
||||
|
||||
return eSIR_MAC_SUCCESS_STATUS;
|
||||
}
|
||||
|
||||
/**
|
||||
* lim_check_rx_wpa_ie_match() - to check supported cipher suites
|
||||
*
|
||||
* @mac: pointer to global mac structure
|
||||
* @rx_wpaie: Received WPA IE in (Re)Assco req
|
||||
* @session_entry: pointer to PE session
|
||||
* @sta_is_ht: peer station is HT
|
||||
*
|
||||
* This function is called during Association/Reassociation
|
||||
* frame handling to determine whether received RSN in
|
||||
* Assoc/Reassoc request frames include supported cipher suites or not.
|
||||
*
|
||||
* Return: Success if ALL supported cipher suites are present in the
|
||||
* received wpa IE else failure status.
|
||||
*/
|
||||
|
||||
uint8_t
|
||||
lim_check_rx_wpa_ie_match(struct mac_context *mac, tDot11fIEWPA *rx_wpaie,
|
||||
struct pe_session *session_entry, uint8_t sta_is_ht)
|
||||
{
|
||||
tDot11fIEWPA *wpa_ie;
|
||||
bool match = false;
|
||||
uint8_t i, j, only_non_ht_cipher = 1;
|
||||
|
||||
/* WPA IE should be received from PE */
|
||||
wpa_ie = &session_entry->gStartBssWPAIe;
|
||||
|
||||
/* We should have only one AKM in assoc/reassoc request */
|
||||
if (rx_wpaie->auth_suite_count != 1) {
|
||||
pe_debug("Invalid RX auth_suite_count %d",
|
||||
rx_wpaie->auth_suite_count);
|
||||
return eSIR_MAC_INVALID_AKMP_STATUS;
|
||||
}
|
||||
/* Check if we support the received AKM */
|
||||
for (i = 0; i < wpa_ie->auth_suite_count; i++)
|
||||
if (!qdf_mem_cmp(&rx_wpaie->auth_suites[0],
|
||||
&wpa_ie->auth_suites[i],
|
||||
sizeof(wpa_ie->auth_suites[i]))) {
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
if (!match) {
|
||||
pe_debug("Invalid RX auth_suites");
|
||||
return eSIR_MAC_INVALID_AKMP_STATUS;
|
||||
}
|
||||
|
||||
/* Check groupwise cipher suite */
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (wpa_ie->multicast_cipher[i] !=
|
||||
rx_wpaie->multicast_cipher[i]) {
|
||||
pe_debug("Invalid groupwise cipher suite");
|
||||
return eSIR_MAC_INVALID_GROUP_CIPHER_STATUS;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* For each Pairwise cipher suite check whether we support
|
||||
* received pairwise
|
||||
*/
|
||||
match = false;
|
||||
for (i = 0; i < rx_wpaie->unicast_cipher_count; i++) {
|
||||
for (j = 0; j < wpa_ie->unicast_cipher_count; j++) {
|
||||
if (!qdf_mem_cmp(rx_wpaie->unicast_ciphers[i],
|
||||
wpa_ie->unicast_ciphers[j], 4)) {
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((sta_is_ht)
|
||||
#ifdef ANI_LITTLE_BYTE_ENDIAN
|
||||
&&
|
||||
((rx_wpaie->
|
||||
unicast_ciphers[i][3] & SECURITY_SUITE_TYPE_MASK) ==
|
||||
SECURITY_SUITE_TYPE_CCMP))
|
||||
#else
|
||||
&&
|
||||
((rx_wpaie->
|
||||
unicast_ciphers[i][0] & SECURITY_SUITE_TYPE_MASK) ==
|
||||
SECURITY_SUITE_TYPE_CCMP))
|
||||
#endif
|
||||
{
|
||||
only_non_ht_cipher = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ((!match) || ((sta_is_ht) && only_non_ht_cipher)) {
|
||||
pe_debug("Invalid pairwise cipher suite");
|
||||
return eSIR_MAC_CIPHER_SUITE_REJECTED_STATUS;
|
||||
}
|
||||
|
||||
return eSIR_MAC_SUCCESS_STATUS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* lim_cleanup_rx_path()
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@ -43,12 +43,6 @@ uint8_t lim_compare_capabilities(struct mac_context *,
|
||||
tSirAssocReq *,
|
||||
tSirMacCapabilityInfo *, struct pe_session *);
|
||||
uint8_t lim_check_rx_basic_rates(struct mac_context *, tSirMacRateSet, struct pe_session *);
|
||||
uint8_t lim_check_rx_rsn_ie_match(struct mac_context *mac_ctx,
|
||||
tDot11fIERSN * const rx_rsn_ie,
|
||||
struct pe_session *session_entry, uint8_t sta_is_ht,
|
||||
bool *pmf_connection);
|
||||
uint8_t lim_check_rx_wpa_ie_match(struct mac_context *, tDot11fIEWPA *, struct pe_session *,
|
||||
uint8_t);
|
||||
uint8_t lim_check_mcs_set(struct mac_context *mac, uint8_t *supportedMCSSet);
|
||||
QDF_STATUS lim_cleanup_rx_path(struct mac_context *, tpDphHashNode,
|
||||
struct pe_session *);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@ -829,7 +829,6 @@ static void lim_print_ht_cap(struct mac_context *mac_ctx, struct pe_session *ses
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WLAN_CONV_CRYPTO_IE_SUPPORT
|
||||
static
|
||||
enum mac_status_code lim_check_rsn_ie(struct pe_session *session,
|
||||
struct mac_context *mac_ctx,
|
||||
@ -895,27 +894,6 @@ static enum mac_status_code lim_check_wpa_ie(struct pe_session *session,
|
||||
|
||||
return eSIR_MAC_INVALID_IE_STATUS;
|
||||
}
|
||||
#else
|
||||
static enum mac_status_code lim_check_rsn_ie(struct pe_session *session,
|
||||
struct mac_context *mac_ctx,
|
||||
tpSirAssocReq assoc_req,
|
||||
tDot11fIERSN *rsn,
|
||||
bool *pmf_connection)
|
||||
{
|
||||
return lim_check_rx_rsn_ie_match(mac_ctx, rsn, session,
|
||||
assoc_req->HTCaps.present,
|
||||
pmf_connection);
|
||||
}
|
||||
|
||||
static enum mac_status_code lim_check_wpa_ie(struct pe_session *session,
|
||||
struct mac_context *mac_ctx,
|
||||
tpSirAssocReq assoc_req,
|
||||
tDot11fIEWPA *wpa)
|
||||
{
|
||||
return lim_check_rx_wpa_ie_match(mac_ctx, wpa, session,
|
||||
assoc_req->HTCaps.present);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* lim_check_sae_pmf_cap() - check pmf capability for SAE STA
|
||||
|
@ -1165,7 +1165,6 @@ static QDF_STATUS lim_send_ft_reassoc_req(struct pe_session *session,
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_11W
|
||||
#ifdef WLAN_CONV_CRYPTO_IE_SUPPORT
|
||||
/**
|
||||
* lim_set_rmf_enabled() - set rmf enabled
|
||||
* @mac: mac context
|
||||
@ -1206,30 +1205,6 @@ static void lim_set_rmf_enabled(struct mac_context *mac,
|
||||
rsn_caps);
|
||||
}
|
||||
#else
|
||||
/**
|
||||
* lim_set_rmf_enabled() - set rmf enabled
|
||||
* @mac: mac context
|
||||
* @session: pe session
|
||||
* @csr_join_req: csr join req
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static void lim_set_rmf_enabled(struct mac_context *mac,
|
||||
struct pe_session *session,
|
||||
struct join_req *csr_join_req)
|
||||
{
|
||||
if ((eSIR_ED_AES_128_CMAC == csr_join_req->MgmtEncryptionType) ||
|
||||
(eSIR_ED_AES_GMAC_128 == csr_join_req->MgmtEncryptionType) ||
|
||||
(eSIR_ED_AES_GMAC_256 == csr_join_req->MgmtEncryptionType))
|
||||
session->limRmfEnabled = 1;
|
||||
else
|
||||
session->limRmfEnabled = 0;
|
||||
|
||||
pe_debug("mgmt encryption type %d limRmfEnabled %d",
|
||||
csr_join_req->MgmtEncryptionType, session->limRmfEnabled);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
/**
|
||||
* lim_set_rmf_enabled() - set rmf enabled
|
||||
* @mac: mac context
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@ -549,10 +549,6 @@ QDF_STATUS sme_roam_get_connect_profile(mac_handle_t mac_handle,
|
||||
uint8_t sessionId,
|
||||
tCsrRoamConnectedProfile *pProfile);
|
||||
void sme_roam_free_connect_profile(tCsrRoamConnectedProfile *profile);
|
||||
QDF_STATUS sme_roam_set_pmkid_cache(mac_handle_t mac_handle, uint8_t sessionId,
|
||||
tPmkidCacheInfo *pPMKIDCache,
|
||||
uint32_t numItems,
|
||||
bool update_entire_cache);
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
/**
|
||||
|
@ -3056,49 +3056,6 @@ void sme_roam_free_connect_profile(tCsrRoamConnectedProfile *profile)
|
||||
csr_roam_free_connect_profile(profile);
|
||||
}
|
||||
|
||||
/*
|
||||
* sme_roam_set_pmkid_cache() -
|
||||
* A wrapper function to request CSR to return the PMKID candidate list
|
||||
* This is a synchronous call.
|
||||
|
||||
* pPMKIDCache - caller allocated buffer point to an array of
|
||||
* tPmkidCacheInfo
|
||||
* numItems - a variable that has the number of tPmkidCacheInfo
|
||||
* allocated when retruning, this is either the number needed
|
||||
* or number of items put into pPMKIDCache
|
||||
* update_entire_cache - this bool value specifies if the entire pmkid
|
||||
* cache should be overwritten or should it be
|
||||
* updated entry by entry.
|
||||
* Return QDF_STATUS - when fail, it usually means the buffer allocated is not
|
||||
* big enough and pNumItems has the number of
|
||||
* tPmkidCacheInfo.
|
||||
* \Note: pNumItems is a number of tPmkidCacheInfo,
|
||||
* not sizeof(tPmkidCacheInfo) * something
|
||||
*/
|
||||
QDF_STATUS sme_roam_set_pmkid_cache(mac_handle_t mac_handle, uint8_t sessionId,
|
||||
tPmkidCacheInfo *pPMKIDCache,
|
||||
uint32_t numItems, bool update_entire_cache)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_SME,
|
||||
TRACE_CODE_SME_RX_HDD_ROAM_SET_PMKIDCACHE, sessionId,
|
||||
numItems));
|
||||
status = sme_acquire_global_lock(&mac->sme);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
if (CSR_IS_SESSION_VALID(mac, sessionId))
|
||||
status = csr_roam_set_pmkid_cache(mac, sessionId,
|
||||
pPMKIDCache,
|
||||
numItems, update_entire_cache);
|
||||
else
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
sme_release_global_lock(&mac->sme);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS sme_roam_del_pmkid_from_cache(mac_handle_t mac_handle,
|
||||
uint8_t sessionId,
|
||||
tPmkidCacheInfo *pmksa,
|
||||
|
@ -14962,164 +14962,6 @@ QDF_STATUS csr_roam_set_psk_pmk(struct mac_context *mac, uint32_t sessionId,
|
||||
}
|
||||
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
|
||||
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
|
||||
static void
|
||||
csr_roam_diag_set_pmkid(struct csr_roam_session *pSession)
|
||||
{
|
||||
WLAN_HOST_DIAG_EVENT_DEF(secEvent,
|
||||
host_event_wlan_security_payload_type);
|
||||
qdf_mem_zero(&secEvent,
|
||||
sizeof(host_event_wlan_security_payload_type));
|
||||
secEvent.eventId = WLAN_SECURITY_EVENT_PMKID_UPDATE;
|
||||
secEvent.encryptionModeMulticast =
|
||||
(uint8_t) diag_enc_type_from_csr_type(
|
||||
pSession->connectedProfile.mcEncryptionType);
|
||||
secEvent.encryptionModeUnicast =
|
||||
(uint8_t) diag_enc_type_from_csr_type(
|
||||
pSession->connectedProfile.EncryptionType);
|
||||
qdf_mem_copy(secEvent.bssid,
|
||||
pSession->connectedProfile.bssid.bytes,
|
||||
QDF_MAC_ADDR_SIZE);
|
||||
secEvent.authMode = (uint8_t) diag_auth_type_from_csr_type(
|
||||
pSession->connectedProfile.AuthType);
|
||||
WLAN_HOST_DIAG_EVENT_REPORT(&secEvent, EVENT_WLAN_SECURITY);
|
||||
}
|
||||
#endif /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
/**
|
||||
* csr_update_session_psk_pmk - API to update PMK in csr session
|
||||
* @pSession: pointer to session
|
||||
* @pmksa: pointer to PMKSA struct
|
||||
*
|
||||
* Return : None
|
||||
*/
|
||||
static void
|
||||
csr_update_session_psk_pmk(struct csr_roam_session *session,
|
||||
tPmkidCacheInfo *pmksa)
|
||||
{
|
||||
/* For SAE authentication, pmk will be sent over the
|
||||
* set PMKSA vendor command. The set PMKSA command is sent
|
||||
* after SAE authentication is complete, before association
|
||||
* completion itself. So csr_roam_session will not be having
|
||||
* any parameters at this point. This pmk received is not
|
||||
* updated to csr session and when RSO update command is sent,
|
||||
* empty pmk will be sent, resulting in SAE roming failure. So
|
||||
* copy the pmk into csr session so that correct pmk will be
|
||||
* sent in RSO command.
|
||||
*/
|
||||
qdf_mem_copy(session->psk_pmk, pmksa->pmk, pmksa->pmk_len);
|
||||
session->pmk_len = pmksa->pmk_len;
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
csr_update_session_psk_pmk(struct csr_roam_session *session,
|
||||
tPmkidCacheInfo *pmksa)
|
||||
{}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* csr_update_pmk_cache - API to update PMK cache
|
||||
* @pSession: pointer to session
|
||||
* @pmksa: pointer to PMKSA struct
|
||||
*
|
||||
* Return : None
|
||||
*/
|
||||
static void csr_update_pmk_cache(struct csr_roam_session *session,
|
||||
tPmkidCacheInfo *pmksa)
|
||||
{
|
||||
uint16_t cache_idx = session->curr_cache_idx;
|
||||
|
||||
/* Add entry to the cache */
|
||||
if (!pmksa->ssid_len) {
|
||||
qdf_copy_macaddr(
|
||||
&session->PmkidCacheInfo[cache_idx].BSSID,
|
||||
&pmksa->BSSID);
|
||||
session->PmkidCacheInfo[cache_idx].ssid_len = 0;
|
||||
} else {
|
||||
qdf_mem_copy(session->PmkidCacheInfo[cache_idx].ssid,
|
||||
pmksa->ssid, pmksa->ssid_len);
|
||||
session->PmkidCacheInfo[cache_idx].ssid_len =
|
||||
pmksa->ssid_len;
|
||||
qdf_mem_copy(session->PmkidCacheInfo[cache_idx].cache_id,
|
||||
pmksa->cache_id, CACHE_ID_LEN);
|
||||
|
||||
}
|
||||
qdf_mem_copy(
|
||||
session->PmkidCacheInfo[cache_idx].PMKID,
|
||||
pmksa->PMKID, PMKID_LEN);
|
||||
|
||||
if (pmksa->pmk_len) {
|
||||
qdf_mem_copy(session->PmkidCacheInfo[cache_idx].pmk,
|
||||
pmksa->pmk, pmksa->pmk_len);
|
||||
|
||||
csr_update_session_psk_pmk(session, pmksa);
|
||||
}
|
||||
|
||||
session->PmkidCacheInfo[cache_idx].pmk_len = pmksa->pmk_len;
|
||||
|
||||
/* Increment the CSR local cache index */
|
||||
if (cache_idx < (CSR_MAX_PMKID_ALLOWED - 1))
|
||||
session->curr_cache_idx++;
|
||||
else {
|
||||
sme_debug("max value reached, setting current index as 0");
|
||||
session->curr_cache_idx = 0;
|
||||
}
|
||||
|
||||
session->NumPmkidCache++;
|
||||
if (session->NumPmkidCache > CSR_MAX_PMKID_ALLOWED) {
|
||||
sme_debug("setting num pmkid cache to %d",
|
||||
CSR_MAX_PMKID_ALLOWED);
|
||||
session->NumPmkidCache = CSR_MAX_PMKID_ALLOWED;
|
||||
}
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
csr_roam_set_pmkid_cache(struct mac_context *mac, uint32_t sessionId,
|
||||
tPmkidCacheInfo *pPMKIDCache, uint32_t numItems,
|
||||
bool update_entire_cache)
|
||||
{
|
||||
struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
|
||||
uint32_t i = 0;
|
||||
tPmkidCacheInfo *pmksa;
|
||||
|
||||
if (!pSession) {
|
||||
sme_err("session %d not found", sessionId);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
sme_debug("numItems = %d", numItems);
|
||||
|
||||
if (numItems > CSR_MAX_PMKID_ALLOWED)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
|
||||
csr_roam_diag_set_pmkid(pSession);
|
||||
#endif /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
|
||||
|
||||
if (update_entire_cache) {
|
||||
if (numItems && pPMKIDCache) {
|
||||
pSession->NumPmkidCache = (uint16_t) numItems;
|
||||
qdf_mem_copy(pSession->PmkidCacheInfo, pPMKIDCache,
|
||||
sizeof(tPmkidCacheInfo) * numItems);
|
||||
pSession->curr_cache_idx = (uint16_t)numItems;
|
||||
}
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
for (i = 0; i < numItems; i++) {
|
||||
pmksa = &pPMKIDCache[i];
|
||||
|
||||
/* Delete the entry if present */
|
||||
csr_roam_del_pmkid_from_cache(mac, sessionId,
|
||||
pmksa, false);
|
||||
/* Update new entry */
|
||||
csr_update_pmk_cache(pSession, pmksa);
|
||||
|
||||
}
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
static void csr_mem_zero_psk_pmk(struct csr_roam_session *session)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@ -729,23 +729,6 @@ QDF_STATUS csr_roam_reassoc(struct mac_context *mac, uint32_t sessionId,
|
||||
tCsrRoamModifyProfileFields modProfileFields,
|
||||
uint32_t *pRoamId);
|
||||
|
||||
/*
|
||||
* csr_roam_set_pmkid_cache() -
|
||||
* return the PMKID candidate list
|
||||
*
|
||||
* pPMKIDCache - caller allocated buffer point to an array of tPmkidCacheInfo
|
||||
* numItems - a variable that has the number of tPmkidCacheInfo allocated
|
||||
* when retruning, this is either the number needed or number of items put
|
||||
* into pPMKIDCache
|
||||
* Return QDF_STATUS - when fail, it usually means the buffer allocated is not
|
||||
* big enough and pNumItems has the number of tPmkidCacheInfo.
|
||||
* \Note: pNumItems is a number of tPmkidCacheInfo, not
|
||||
* sizeof(tPmkidCacheInfo) * something
|
||||
*/
|
||||
QDF_STATUS csr_roam_set_pmkid_cache(struct mac_context *mac, uint32_t sessionId,
|
||||
tPmkidCacheInfo *pPMKIDCache,
|
||||
uint32_t numItems, bool update_entire_cache);
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
/*
|
||||
* csr_get_pmk_info(): store PMK in pmk_cache
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user