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

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

wlan: Update PMK cache and fix SAE PMK Cache Auth failure

SAE auth frame is sent even if PMK is cached, which causes SAE PMK
cache feature failure.

PMK cache match fails when looking up PMK cache through BSSID.
Fix PMK saved information as below.
Save PMK ssid if ssid is valid.
Save PMK bssid.
Save PMK cache id.

PMK cache information is not passed to pe session correctly.
Update PMK cache information from tpSirSmeJoinReq to pesession.

When auth type is SAE and PMK is cached, it is exepcted to receive
open auth frame 2, so keep on sending association request instead
of breaking out.

Change-Id: I1158366834bd0a7fb884b7ae1bf9390df810da4d
CRs-Fixed: 2531282
parent 6920f5a2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1079,6 +1079,7 @@ typedef struct sSirSmeJoinReq
    tSirBssType         bsstype;                // add new type for BT -AMP STA and AP Modules
    tANI_U8             dot11mode;              // to support BT-AMP     
    tVOS_CON_MODE       staPersona;             //Persona
    bool                sae_pmk_cached;
    tANI_BOOLEAN        bOSENAssociation;       //HS2.0
    tANI_BOOLEAN        bWPSAssociation;       //WPS
    ePhyChanBondState   cbMode;                 // Pass CB mode value in Join.
@@ -1147,7 +1148,6 @@ 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 −1
Original line number Diff line number Diff line
@@ -1217,9 +1217,9 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse
                           FL("received Auth frame2 for unexpected auth algo num %d "
                           MAC_ADDRESS_STR), pRxAuthFrameBody->authAlgoNumber,
                           MAC_ADDR_ARRAY(pHdr->sa));)
                }
                    break;
                }
            }

            if (pRxAuthFrameBody->authStatusCode ==
                eSIR_MAC_SUCCESS_STATUS)
+7 −0
Original line number Diff line number Diff line
@@ -992,6 +992,13 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf)
        limLog(pMac, LOGE, FL("remaining len %d is too short"), len);
        return eSIR_FAILURE;
    }
    pJoinReq->sae_pmk_cached = *pBuf++;
    len--;
    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
    {
        limLog(pMac, LOGE, FL("remaining len %d is too short"), len);
        return eSIR_FAILURE;
    }

    pJoinReq->bOSENAssociation = *pBuf++;
    len--;
+25 −22
Original line number Diff line number Diff line
@@ -12881,20 +12881,20 @@ static void csr_update_pmk_cache(tCsrRoamSession *pSession,
    uint16_t cache_idx = pSession->CurCacheIndex;
    /* Add entry to the cache */
    if (!pmksa->ssid_len) {
        vos_copy_macaddr(
                (v_MACADDR_t *)pSession->PmkidCacheInfo[cache_idx].BSSID,
                (v_MACADDR_t *)pmksa->BSSID);
    pSession->PmkidCacheInfo[cache_idx].ssid_len = 0;
    } else {
    if (!pmksa->ssid_len) {
        vos_mem_copy(pSession->PmkidCacheInfo[cache_idx].ssid,
                pmksa->ssid, pmksa->ssid_len);
        pSession->PmkidCacheInfo[cache_idx].ssid_len =
            pmksa->ssid_len;
    }
    vos_copy_macaddr(
            (v_MACADDR_t *)pSession->PmkidCacheInfo[cache_idx].BSSID,
            (v_MACADDR_t *)pmksa->BSSID);
    vos_mem_copy(pSession->PmkidCacheInfo[cache_idx].cache_id,
            pmksa->cache_id, CACHE_ID_LEN);
    }
    vos_mem_copy(
            pSession->PmkidCacheInfo[cache_idx].PMKID,
            pmksa->PMKID, CSR_RSN_PMKID_SIZE);
@@ -13437,27 +13437,30 @@ static eHalStatus csrRoamStartWds( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsr
 *
 * Return: None
 */
static void csr_update_sae_config(tSirSmeJoinReq *csr_join_req,
                                  tpAniSirGlobal mac, tCsrRoamSession *session)
static bool csr_update_sae_config(tSirMacAddr bssid, tpAniSirGlobal mac,
                                  tCsrRoamSession *session)
{
    tPmkidCacheInfo pmkid_cache;
    uint32_t index;
    bool sae_pmk_cached;
    vos_mem_copy(pmkid_cache.BSSID, csr_join_req->bssDescription.bssId,
                 VOS_MAC_ADDR_SIZE);
    vos_mem_copy(pmkid_cache.BSSID, bssid, VOS_MAC_ADDR_SIZE);
    csr_join_req->sae_pmk_cached =
    sae_pmk_cached =
              csr_lookup_pmkid_using_bssid(mac, session, &pmkid_cache, &index);
    VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG,
              "pmk_cached %d for BSSID=" MAC_ADDRESS_STR,
              csr_join_req->sae_pmk_cached,
              MAC_ADDR_ARRAY(csr_join_req->bssDescription.bssId));
              "pmk_cached %d for BSSID=" MAC_ADDRESS_STR, sae_pmk_cached,
              MAC_ADDR_ARRAY(bssid));
    return sae_pmk_cached;
}
#else
static void csr_update_sae_config(tSirSmeJoinReq *csr_join_req,
                                  tpAniSirGlobal mac, tCsrRoamSession *session)
{ }
static bool csr_update_sae_config(tSirMacAddr bssid, tpAniSirGlobal mac,
                                  tCsrRoamSession *session)
{
    return false;
}
#endif
////////////////////Mail box
@@ -13659,6 +13662,8 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe
        //Persona
        *pBuf = (tANI_U8)pProfile->csrPersona;
        pBuf++;
        *pBuf = csr_update_sae_config(pBssDescription->bssId, pMac, pSession);
        pBuf++;
        *pBuf = (tANI_U8)pProfile->bOSENAssociation;
        pBuf++;
        *pBuf = (tANI_U8)pProfile->bWPSAssociation;
@@ -14198,8 +14203,6 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe
        csrPrepareJoinReassocReqBuffer( pMac, pBssDescription, pBuf,
                (tANI_U8)pProfile->uapsd_mask);
        csr_update_sae_config(pMsg, pMac, pSession);
        status = palSendMBMessage(pMac->hHdd, pMsg );
        /* Memory allocated to pMsg will get free'd in palSendMBMessage */
        pMsg = NULL;