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

Commit 6920f5a2 authored by Abhinav Kumar's avatar Abhinav Kumar Committed by Gerrit - the friendly Code Review server
Browse files

wlan: Changes to support PMK caching for SAE

propagation from qcacld-3.0 to prima.

Add changes to support PMK caching for SAE authentication.

Change-Id: Id8f48a184fe40d1327b65235156d3798cfda585f
CRs-Fixed: 2531276
parent 8c122595
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1147,6 +1147,7 @@ typedef struct sSirSmeJoinReq
    tSirSupChnl         supportedChannels;
    bool force_24ghz_in_ht20;
    bool force_rsne_override;
    bool sae_pmk_cached;
    tSirBssDescription  bssDescription;
    /*
     * WARNING: Pls make bssDescription as last variable in struct
+1 −0
Original line number Diff line number Diff line
@@ -372,6 +372,7 @@ typedef struct sPESession // Added to Support BT-AMP
    tDot11fIEVHTOperation vht_operation;
    bool force_24ghz_in_ht20;
    int8_t def_max_tx_pwr;
    bool sae_pmk_cached;
}tPESession, *tpPESession;

#define LIM_MAX_ACTIVE_SESSIONS 4
+21 −11
Original line number Diff line number Diff line
@@ -1196,18 +1196,28 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse
            if (pRxAuthFrameBody->authAlgoNumber !=
                pMac->lim.gpLimMlmAuthReq->authType)
            {
                /*
                 * Auth algo is open in rx auth frame when auth type is SAE and
                 * PMK is cached as driver sent auth algo as open in tx frame
                 * as well.
                 */
                if ((pMac->lim.gpLimMlmAuthReq->authType ==
                     eSIR_AUTH_TYPE_SAE) && psessionEntry->sae_pmk_cached) {
                     limLog(pMac, LOGW,
                            FL("rx Auth frame2 auth algo %d in SAE PMK case"),
                            pRxAuthFrameBody->authAlgoNumber);
                } else {
                    /**
                     * Received Authentication frame with an auth
                     * algorithm other than one requested.
                     * Wait until Authentication Failure Timeout.
                     */

                    // Log error
                    PELOGW(limLog(pMac, LOGW,
                       FL("received Auth frame2 for unexpected auth algo number %d "
                           FL("received Auth frame2 for unexpected auth algo num %d "
                           MAC_ADDRESS_STR), pRxAuthFrameBody->authAlgoNumber,
                           MAC_ADDR_ARRAY(pHdr->sa));)

                }
                break;
            }

+10 −3
Original line number Diff line number Diff line
@@ -864,9 +864,15 @@ void limDoSendAuthMgmtFrame(tpAniSirGlobal pMac, tpPESession psessionEntry)
{
        tSirMacAuthFrameBody    authFrameBody;

        //Prepare & send Authentication frame
        /* Mark auth algo as open when auth type is SAE and PMK is cached */
        if ((pMac->lim.gpLimMlmAuthReq->authType == eSIR_AUTH_TYPE_SAE) &&
             psessionEntry->sae_pmk_cached) {
             authFrameBody.authAlgoNumber = eSIR_OPEN_SYSTEM;
         } else {
             authFrameBody.authAlgoNumber =
                             (tANI_U8) pMac->lim.gpLimMlmAuthReq->authType;
         }
        //Prepare & send Authentication frame
        authFrameBody.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_1;
        authFrameBody.authStatusCode = 0;
        pMac->authAckStatus = LIM_AUTH_ACK_NOT_RCD;
@@ -2728,7 +2734,8 @@ limProcessMlmAuthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
                                 pMac->lim.gpLimMlmAuthReq->peerMacAddr);

        psessionEntry->limPrevMlmState = psessionEntry->limMlmState;
        if (pMac->lim.gpLimMlmAuthReq->authType == eSIR_AUTH_TYPE_SAE) {
        if ((pMac->lim.gpLimMlmAuthReq->authType == eSIR_AUTH_TYPE_SAE) &&
             !psessionEntry->sae_pmk_cached) {
            if (lim_process_mlm_auth_req_sae(pMac, psessionEntry) !=
                VOS_STATUS_SUCCESS) {
                mlmAuthCnf.resultCode = eSIR_SME_INVALID_PARAMETERS;
+27 −0
Original line number Diff line number Diff line
@@ -1685,6 +1685,31 @@ static void __limProcessClearDfsChannelList(tpAniSirGlobal pMac,
                  sizeof(tSirDFSChannelList), 0);
}

#ifdef WLAN_FEATURE_SAE
/**
 * lim_update_sae_config()- This API update SAE session info to csr config
 * from join request.
 * @session: PE session
 * @sme_join_req: pointer to join request
 *
 * Return: None
 */
static void lim_update_sae_config(tpPESession session,
                                  tpSirSmeJoinReq sme_join_req)
{
    session->sae_pmk_cached = sme_join_req->sae_pmk_cached;

    VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_DEBUG,
              FL("pmk_cached %d for BSSID=" MAC_ADDRESS_STR),
              session->sae_pmk_cached,
              MAC_ADDR_ARRAY(sme_join_req->bssDescription.bssId));
}
#else
static inline void lim_update_sae_config(tpPESession session,
                                         tpSirSmeJoinReq sme_join_req)
{}
#endif

/**
 * __limProcessSmeJoinReq()
 *
@@ -2003,6 +2028,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
#endif
        psessionEntry->txLdpcIniFeatureEnabled = pSmeJoinReq->txLdpcIniFeatureEnabled;

        lim_update_sae_config(psessionEntry, pSmeJoinReq);

        if (psessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE)
        {
            psessionEntry->limSystemRole = eLIM_STA_ROLE;
Loading