Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f69933fa authored by Pankaj Singh's avatar Pankaj Singh
Browse files

wlan: Do not create preauth node while sending SAE assoc reject

Driver validates the authentication context and allows
connection with SAE AKM in either of the below cases,
1. Successful SAE authentication
2. Open authentication with a valid PMKID

Driver rejects association if none of these are met. Do not
create preauth node while sending assoc reject in these cases
as there is no need to maintain a preauth context. Stations
initiate a fresh SAE authentication in both of these cases and
a new node will be created.

Change-Id: Ic446add47358d01bf4b316aa9ac5bf86c33bf812
CRs-Fixed: 2734690
parent a99506df
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -4000,7 +4000,7 @@ void limProcessSmeDelBssRsp(
  void
__limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsgBuf)
{
    tSirSmeAssocCnf    assocCnf;
    tSirSmeAssocCnf    assocCnf = {0};
    tpDphHashNode      pStaDs = NULL;
    tpPESession        psessionEntry= NULL;
    tANI_U8            sessionId; 
@@ -4094,6 +4094,8 @@ __limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsg
    else
    {
        tSirMacStatusCodes mac_status_code = eSIR_MAC_UNSPEC_FAILURE_STATUS;
        uint8_t add_pre_auth_context = true;

        // SME_ASSOC_CNF status is non-success, so STA is not allowed to be associated
        /*Since the HAL sta entry is created for denied STA we need to remove this HAL entry.So to do that set updateContext to 1*/
        if(!pStaDs->mlmStaContext.updateContext)
@@ -4105,9 +4107,15 @@ __limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsg
        if (assocCnf.mac_status_code)
            mac_status_code = assocCnf.mac_status_code;

        if (assocCnf.mac_status_code == eSIR_MAC_INVALID_PMKID ||
            assocCnf.mac_status_code ==
            eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS)
            add_pre_auth_context = false;

        limRejectAssociation(pMac, pStaDs->staAddr,
                             pStaDs->mlmStaContext.subType,
                             true, pStaDs->mlmStaContext.authType,
                             add_pre_auth_context,
                             pStaDs->mlmStaContext.authType,
                             pStaDs->assocId, true,
                             mac_status_code, psessionEntry);
    }
+3 −34
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2017, 2020 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -1546,19 +1546,11 @@ limAssocIndSerDes(tpAniSirGlobal pMac, tpLimMlmAssocInd pAssocInd, tANI_U8 *pBuf
tSirRetStatus
limAssocCnfSerDes(tpAniSirGlobal pMac, tpSirSmeAssocCnf pAssocCnf, tANI_U8 *pBuf)
{
#ifdef PE_DEBUG_LOG1
    tANI_U8  *pTemp = pBuf;
#endif

    if (!pAssocCnf || !pBuf)
        return eSIR_FAILURE;

    pAssocCnf->messageType = limGetU16(pBuf);
    pBuf += sizeof(tANI_U16);

    pAssocCnf->length = limGetU16(pBuf);
    pBuf += sizeof(tANI_U16);

    vos_mem_copy(pAssocCnf, pBuf, sizeof(*pAssocCnf));
    if (pAssocCnf->messageType == eWNI_SME_ASSOC_CNF)
    {
        PELOG1(limLog(pMac, LOG1, FL("SME_ASSOC_CNF length %d bytes is:"), pAssocCnf->length);)
@@ -1567,30 +1559,7 @@ limAssocCnfSerDes(tpAniSirGlobal pMac, tpSirSmeAssocCnf pAssocCnf, tANI_U8 *pBuf
    {
        PELOG1(limLog(pMac, LOG1, FL("SME_REASSOC_CNF length %d bytes is:"), pAssocCnf->length);)
    }
    PELOG1(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG1, pTemp, pAssocCnf->length);)

    // status code
    pAssocCnf->statusCode = (tSirResultCodes) limGetU32(pBuf);
    pBuf += sizeof(tSirResultCodes);

    // bssId
    vos_mem_copy( pAssocCnf->bssId, pBuf, sizeof(tSirMacAddr));
    pBuf += sizeof(tSirMacAddr);

    // peerMacAddr
    vos_mem_copy( pAssocCnf->peerMacAddr, pBuf, sizeof(tSirMacAddr));
    pBuf += sizeof(tSirMacAddr);


    pAssocCnf->aid = limGetU16(pBuf);
    pBuf += sizeof(tANI_U16);
    // alternateBssId
    vos_mem_copy( pAssocCnf->alternateBssId, pBuf, sizeof(tSirMacAddr));
    pBuf += sizeof(tSirMacAddr);

    // alternateChannelId
    pAssocCnf->alternateChannelId = *pBuf;
    pBuf++;
    PELOG1(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG1, pBuf, pAssocCnf->length);)

    return eSIR_SUCCESS;
} /*** end limAssocCnfSerDes() ***/