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

Commit 4d44f639 authored by Abhinav Kumar's avatar Abhinav Kumar
Browse files

wlan: Add support for SAE AKM suites

propagation from qcacld-3.0 to prima

Add support for SAE AKM suites in CSR and also add support for
SAE in HDD. Also, add CONFIG_WLAN_FEATURE_SAE flag to enable/disable
SAE in Kbuild. When this is enabled, WLAN_FEATURE_SAE is used as a
feature flag for SAE.

Change-Id: I6254991afa0fd048d4f0b6f435ff630f1db04077
CRs-Fixed: 2530368
parent 6518a299
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -143,6 +143,10 @@ typedef struct {
}__attribute__((packed)) qcom_ie_age ;
#endif

#ifndef WLAN_AKM_SUITE_SAE
#define WLAN_AKM_SUITE_SAE 0x000FAC08
#endif

enum qca_nl80211_vendor_subcmds {
    QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
    QCA_NL80211_VENDOR_SUBCMD_TEST = 1,
+39 −3
Original line number Diff line number Diff line
@@ -152,6 +152,11 @@ v_U8_t ccpRSNOui07[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x06 }; // RSN-PSK-
v_U8_t ccpRSNOui08[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x05 };
#endif

#ifdef WLAN_FEATURE_SAE
v_U8_t ccp_rsn_oui_80[HDD_RSN_OUI_SIZE] = {0x00, 0x0F, 0xAC, 0x08};
v_U8_t ccp_rsn_oui_90[HDD_RSN_OUI_SIZE] = {0x00, 0x0F, 0xAC, 0x09};
#endif

#if defined(WLAN_FEATURE_VOWIFI_11R)
// Offset where the EID-Len-IE, start.
#define FT_ASSOC_RSP_IES_OFFSET 6 /* Capability(2) + AID(2) + Status Code(2)*/
@@ -4374,9 +4379,32 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3
    }
    return( halStatus );
}

#ifdef WLAN_FEATURE_SAE
/**
 * hdd_translate_sae_rsn_to_csr_auth() - Translate SAE RSN to CSR auth type
 * @auth_suite: auth suite
 * @auth_type: pointer to eCsrAuthType
 *
 * Return: None
 */
static void hdd_translate_sae_rsn_to_csr_auth(int8_t auth_suite[4],
                                              eCsrAuthType *auth_type)
{
        if (!memcmp(auth_suite, ccp_rsn_oui_80, 4))
                *auth_type = eCSR_AUTH_TYPE_SAE;
}
#else
static inline
void hdd_translate_sae_rsn_to_csr_auth(int8_t auth_suite[4],
                                       eCsrAuthType *auth_type)
{
}
#endif

eCsrAuthType hdd_TranslateRSNToCsrAuthType( u_int8_t auth_suite[4])
{
    eCsrAuthType auth_type;
    eCsrAuthType auth_type = eCSR_AUTH_TYPE_UNKNOWN;
    // is the auth type supported?
    if ( memcmp(auth_suite , ccpRSNOui01, 4) == 0)
    {
@@ -4415,8 +4443,12 @@ eCsrAuthType hdd_TranslateRSNToCsrAuthType( u_int8_t auth_suite[4])
    } else
#endif
    {
        auth_type = eCSR_AUTH_TYPE_UNKNOWN;
    /* If auth suite is of SAE, auth_type will be
     * overwritten in hdd_translate_sae_rsn_to_csr_auth
     */
     hdd_translate_sae_rsn_to_csr_auth(auth_suite, &auth_type);
     }

    return auth_type;
}

@@ -4913,6 +4945,10 @@ int hdd_set_csr_auth_type ( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType)

          pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_SHARED_KEY;
          break;
       case eCSR_AUTH_TYPE_SAE:
          pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_SAE;
          break;

        default:

#ifdef FEATURE_WLAN_ESE
+8 −1
Original line number Diff line number Diff line
@@ -16297,7 +16297,10 @@ static int wlan_hdd_cfg80211_set_auth_type(hdd_adapter_t *pAdapter,
            pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_CCKM_WPA;//eCSR_AUTH_TYPE_CCKM_RSN needs to be handled as well if required.
            break;
#endif
        case NL80211_AUTHTYPE_SAE:
             hddLog(LOG1, "set authentication type to SAE");
             pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_SAE;
             break;
        default:
            hddLog(VOS_TRACE_LEVEL_ERROR,
@@ -16369,6 +16372,10 @@ static int wlan_hdd_set_akm_suite( hdd_adapter_t *pAdapter,
            pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
            break;
#endif
        case WLAN_AKM_SUITE_SAE:
             hddLog(LOG1, "setting key mgmt type to SAE");
             pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
             break;
        default:
            hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Unsupported key mgmt type %d",
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2014, 2019  The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -84,6 +84,7 @@ typedef enum eAniAuthType
#if defined WLAN_FEATURE_VOWIFI_11R
    eSIR_FT_AUTH,
#endif
    eSIR_AUTH_TYPE_SAE = 3,
#if defined FEATURE_WLAN_ESE
    eSIR_LEAP_AUTH = 0x80,
#endif
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ typedef enum
    // MAC layer authentication types
    eCSR_AUTH_TYPE_OPEN_SYSTEM,
    eCSR_AUTH_TYPE_SHARED_KEY,
    eCSR_AUTH_TYPE_SAE,
    eCSR_AUTH_TYPE_AUTOSWITCH,

    // Upper layer authentication types
Loading