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

Commit 43a0d7d0 authored by Pankaj Singh's avatar Pankaj Singh
Browse files

wlan: Validate the PMKID of SAE assoc request

Connection with SAE AKM is allowed with
1. SAE authentication
2. Open authentication with valid PMKID
If the association request is with an SAE AKM and
open authentication, validate the PMKID and send
association response accordingly.

Change-Id: I0fb966af97b6df63bac2e1af2e1fe6ef6b289888
CRs-Fixed: 2734681
parent e1cd34c5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1264,6 +1264,7 @@ typedef struct sSirSmeAssocInd
    tANI_U32             assocReqLength;
    tANI_U8*             assocReqPtr;
    uint32_t             rate_flags;
    bool                 is_sae_authenticated;
    tSirSmeChanInfo      chan_info;
    tSirMacHTChannelWidth ch_width;
    tDot11fIEHTCaps HTCaps;
@@ -1283,6 +1284,7 @@ typedef struct sSirSmeAssocCnf
    tANI_U16             aid;
    tSirMacAddr          alternateBssId;
    tANI_U8              alternateChannelId;
    tSirMacStatusCodes   mac_status_code;
} tSirSmeAssocCnf, *tpSirSmeAssocCnf;

/// Definition for Reassociation indication from peer
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2014, 2016-2017 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2014, 2016-2017, 2020 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -225,6 +225,7 @@ typedef struct sSirAssocReq
    tDot11fIEOperatingMode    operMode;
#endif
    tDot11fIEhs20vendor_ie hs20vendor_ie;
    bool                      is_sae_authenticated;
} tSirAssocReq, *tpSirAssocReq;


+3 −2
Original line number Diff line number Diff line
@@ -968,7 +968,8 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,

        /// Delete 'pre-auth' context of STA
        authType = pStaPreAuthContext->authType;

        if (pStaPreAuthContext->authType == eSIR_AUTH_TYPE_SAE)
                pAssocReq->is_sae_authenticated = true;
        /// Store the previous auth frame's seq no
        prevAuthSeqno = pStaPreAuthContext->seqNo;

@@ -1805,7 +1806,7 @@ void limSendMlmAssocInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession p

        pMlmAssocInd->rate_flags =
            limGetMaxRateFlags(pStaDs, psessionEntry);

        pMlmAssocInd->is_sae_authenticated = pAssocReq->is_sae_authenticated;
        limPostSmeMessage(pMac, LIM_MLM_ASSOC_IND, (tANI_U32 *) pMlmAssocInd);
        vos_mem_free(pMlmAssocInd);
    }
+2 −1
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.
 *
@@ -1240,6 +1240,7 @@ limFillAssocIndParams(tpAniSirGlobal pMac, tpLimMlmAssocInd pAssocInd,
        pSirSmeAssocInd->HTCaps = pAssocInd->HTCaps;
    if (pAssocInd->VHTCaps.present)
        pSirSmeAssocInd->VHTCaps = pAssocInd->VHTCaps;
    pSirSmeAssocInd->is_sae_authenticated = pAssocInd->is_sae_authenticated;
} /*** end limAssocIndSerDes() ***/


+10 −4
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -4093,17 +4093,23 @@ __limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsg
    } // (assocCnf.statusCode == eSIR_SME_SUCCESS)
    else
    {
        tSirMacStatusCodes mac_status_code = eSIR_MAC_UNSPEC_FAILURE_STATUS;
        // 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)
           pStaDs->mlmStaContext.updateContext = 1;
        limLog(pMac, LOG1, FL("Receive Assoc Cnf with status Code : %d(assoc id=%d) "),
                           assocCnf.statusCode, pStaDs->assocId);

        limLog(pMac, LOG1,
                FL("Receive Assoc Cnf with status Code : %d(assoc id=%d) Reason code: %d"),
                assocCnf.statusCode, pStaDs->assocId, assocCnf.mac_status_code);
        if (assocCnf.mac_status_code)
            mac_status_code = assocCnf.mac_status_code;

        limRejectAssociation(pMac, pStaDs->staAddr,
                             pStaDs->mlmStaContext.subType,
                             true, pStaDs->mlmStaContext.authType,
                             pStaDs->assocId, true,
                             eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry);
                             mac_status_code, psessionEntry);
    }

end:
Loading