qcacld-3.0: Put install key after associate complete for FT roam

If FT roam with LFR2.0 enabled, pre-auth/reassociate happen in host,
PTK will be installed early after pre-auth negotiation, so need put it
after association complete, but currently we only save PTK key material
and don't install it.

Because crypto was converged and original eWNI_SME_FT_UPDATE_KEY has
been removed, move delayed installing key after association complete
notified at hdd layer, rather than in function wma_add_sta_req_sta_mode
at wma layer. And remove useless code related with original FT key
installing.

Change-Id: I3bc52b65d17342edab755f7904d743c3433f99ce
CRs-Fixed: 2768307
This commit is contained in:
Will Huang 2020-09-02 16:31:30 +08:00 committed by snandini
parent 4218ed940a
commit 3930c36458
10 changed files with 88 additions and 43 deletions

View File

@ -4310,6 +4310,43 @@ static void hdd_roam_channel_switch_handler(struct hdd_adapter *adapter,
policy_mgr_check_concurrent_intf_and_restart_sap(hdd_ctx->psoc);
}
#ifdef WLAN_FEATURE_HOST_ROAM
/**
* wlan_hdd_ft_set_key_delay() - hdd set key delayed for FT mode
* @mac_handle: mac handler
* @adapter: pointer to adapter context
*
* Return: void
*/
static void
wlan_hdd_ft_set_key_delay(mac_handle_t mac_handle, struct hdd_adapter *adapter)
{
int errno = 0;
uint32_t session_id = adapter->vdev_id;
struct wlan_objmgr_vdev *vdev;
vdev = hdd_objmgr_get_vdev(adapter);
if (!vdev)
return;
if (sme_ft_key_ready_for_install(mac_handle, session_id)) {
errno = wlan_cfg80211_crypto_add_key(
vdev,
WLAN_CRYPTO_KEY_TYPE_UNICAST,
0);
}
hdd_objmgr_put_vdev(vdev);
if (errno)
hdd_err("ft set key failed");
}
#else
static void
wlan_hdd_ft_set_key_delay(mac_handle_t mac_handle, struct hdd_adapter *adapter)
{
}
#endif
/**
* hdd_sme_roam_callback() - hdd sme roam callback
* @context: pointer to adapter context
@ -4447,6 +4484,8 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
/* Clear saved connection information in HDD */
hdd_conn_remove_connect_info(
WLAN_HDD_GET_STATION_CTX_PTR(adapter));
} else {
wlan_hdd_ft_set_key_delay(hdd_ctx->mac_handle, adapter);
}
qdf_ret_status =
hdd_association_completion_handler(adapter, roam_info,

View File

@ -17412,7 +17412,7 @@ static int wlan_hdd_add_key_sta(struct hdd_adapter *adapter,
/* The supplicant may attempt to set the PTK once
* pre-authentication is done. Save the key in the
* UMAC and include it in the ADD BSS request
* UMAC and install it after association
*/
status = sme_check_ft_status(mac_handle, adapter->vdev_id);
if (status == QDF_STATUS_SUCCESS) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-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
@ -88,15 +88,6 @@ typedef struct sSirFTUpdateKeyInfo {
tSirKeyMaterial keyMaterial;
} tSirFTUpdateKeyInfo, *tpSirFTUpdateKeyInfo;
/*--------------------------------------------------------------------------
FT Pre Auth Rsp Key SME<->PE
------------------------------------------------------------------------*/
typedef struct sSirFTPreAuthKeyInfo {
uint8_t extSetStaKeyParamValid; /* Ext Bss Config Msg if set */
/* SetStaKeyParams for ext bss msg */
tLimMlmSetKeysReq extSetStaKeyParam;
} tSirFTPreAuthKeyInfo, *tpSirFTPreAuthKeyInfo;
/*-------------------------------------------------------------------------
Global FT Information
------------------------------------------------------------------------*/
@ -105,7 +96,6 @@ typedef struct sFTPEContext {
QDF_STATUS ftPreAuthStatus;
uint16_t saved_auth_rsp_length;
uint8_t saved_auth_rsp[MAX_FTIE_SIZE];
tSirFTPreAuthKeyInfo PreAuthKeyInfo;
/* Items created for the new FT, session */
void *pAddBssReq; /* Save add bss req */
void *pAddStaReq; /*Save add sta req */

View File

@ -3752,8 +3752,6 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
if (QDF_P2P_CLIENT_MODE == pe_session->opmode)
pAddBssParams->staContext.p2pCapableSta = 1;
pAddBssParams->extSetStaKeyParamValid = 0;
#ifdef WLAN_FEATURE_11W
if (pe_session->limRmfEnabled) {
pAddBssParams->rmfEnabled = 1;
@ -4065,7 +4063,6 @@ QDF_STATUS lim_sta_send_add_bss_pre_assoc(struct mac_context *mac,
pAddBssParams->staContext.smesessionId = pe_session->smeSessionId;
pAddBssParams->staContext.sessionId = pe_session->peSessionId;
pAddBssParams->extSetStaKeyParamValid = 0;
#ifdef WLAN_FEATURE_11W
if (pe_session->limRmfEnabled) {

View File

@ -94,6 +94,25 @@ void sme_get_rici_es(mac_handle_t mac_handle, uint32_t sessionId,
*/
QDF_STATUS sme_check_ft_status(mac_handle_t mac_handle, uint32_t session_id);
#ifdef WLAN_FEATURE_HOST_ROAM
/**
* sme_ft_key_ready_for_install() - API to check ft key ready for install
* @mac_handle: MAC handle
* @session_id: vdev identifier
*
* It is only applicable for LFR2.0 enabled
*
* Return: true when ft key is ready otherwise false
*/
bool sme_ft_key_ready_for_install(mac_handle_t mac_handle, uint32_t session_id);
#else
static inline bool
sme_ft_key_ready_for_install(mac_handle_t mac_handle, uint32_t session_id)
{
return false;
}
#endif
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
/**
* sme_reset_key() -Reset key information

View File

@ -243,8 +243,6 @@ QDF_STATUS sme_check_ft_status(mac_handle_t mac_handle, uint32_t session_id)
switch (session->ftSmeContext.FTState) {
case eFT_SET_KEY_WAIT:
if (sme_get_ft_pre_auth_state(mac_handle, session_id) == true) {
sme_set_ft_pre_auth_state(mac_handle, session_id,
false);
session->ftSmeContext.FTState = eFT_START_READY;
sme_debug("state changed to %d status %d",
session->ftSmeContext.FTState, status);
@ -261,6 +259,34 @@ QDF_STATUS sme_check_ft_status(mac_handle_t mac_handle, uint32_t session_id)
return status;
}
#ifdef WLAN_FEATURE_HOST_ROAM
bool sme_ft_key_ready_for_install(mac_handle_t mac_handle, uint32_t session_id)
{
QDF_STATUS status;
bool ret = false;
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct csr_roam_session *session = CSR_GET_SESSION(mac, session_id);
if (!session) {
sme_err("csr session is NULL");
return false;
}
status = sme_acquire_global_lock(&mac->sme);
if (!(QDF_IS_STATUS_SUCCESS(status)))
return false;
if (sme_get_ft_pre_auth_state(mac_handle, session_id) &&
session->ftSmeContext.FTState == eFT_START_READY) {
ret = true;
sme_set_ft_pre_auth_state(mac_handle, session_id, false);
}
sme_release_global_lock(&mac->sme);
return ret;
}
#endif
/*
* HDD Interface to SME. SME now sends the Auth 2 and RIC IEs up to the
* supplicant. The supplicant will then proceed to send down the

View File

@ -667,7 +667,6 @@ struct wma_invalid_peer_params {
* @is_channel_switch: is channel switch
* @pause_bitmap: pause bitmap
* @nwType: network type (802.11a/b/g/n/ac)
* @staKeyParams: sta key parameters
* @ps_enabled: is powersave enable/disable
* @peer_count: peer count
* @roam_synch_in_progress: flag is in progress or not
@ -715,7 +714,6 @@ struct wma_txrx_node {
uint8_t nss;
uint16_t pause_bitmap;
uint32_t nwType;
tSetStaKeyParams *staKeyParams;
uint32_t peer_count;
void *plink_status_req;
void *psnr_req;

View File

@ -333,8 +333,6 @@ typedef struct sLimMlmSetKeysReq {
* @staContext: sta context
* @updateBss: update the existing BSS entry, if this flag is set
* @maxTxPower: max power to be used after applying the power constraint
* @extSetStaKeyParamValid: Ext Bss Config Msg if set
* @extSetStaKeyParam: SetStaKeyParams for ext bss msg
* @bSpectrumMgtEnabled: Spectrum Management Capability, 1:Enabled, 0:Disabled.
* @vhtCapable: VHT capablity
* @ch_width: VHT tx channel width
@ -357,9 +355,6 @@ struct bss_params {
*/
uint8_t updateBss;
int8_t maxTxPower;
uint8_t extSetStaKeyParamValid;
tSetStaKeyParams extSetStaKeyParam;
uint8_t vhtCapable;
enum phy_ch_width ch_width;
uint8_t nonRoamReassoc;

View File

@ -3445,20 +3445,6 @@ static QDF_STATUS wma_update_iface_params(tp_wma_handle wma,
if (!iface->addBssStaContext)
return QDF_STATUS_E_RESOURCES;
*iface->addBssStaContext = add_bss->staContext;
if (iface->staKeyParams) {
qdf_mem_free(iface->staKeyParams);
iface->staKeyParams = NULL;
}
if (add_bss->extSetStaKeyParamValid) {
iface->staKeyParams =
qdf_mem_malloc(sizeof(tSetStaKeyParams));
if (!iface->staKeyParams) {
qdf_mem_free(iface->addBssStaContext);
iface->addBssStaContext = NULL;
return QDF_STATUS_E_RESOURCES;
}
*iface->staKeyParams = add_bss->extSetStaKeyParam;
}
/* Save parameters later needed by WMA_ADD_STA_REQ */
iface->rmfEnabled = add_bss->rmfEnabled;
if (add_bss->rmfEnabled)

View File

@ -2565,11 +2565,6 @@ void wma_vdev_deinit(struct wma_txrx_node *vdev)
vdev->addBssStaContext = NULL;
}
if (vdev->staKeyParams) {
qdf_mem_free(vdev->staKeyParams);
vdev->staKeyParams = NULL;
}
if (vdev->psnr_req) {
qdf_mem_free(vdev->psnr_req);
vdev->psnr_req = NULL;