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

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

wlan: Add support for OWE

propagation from qcacld-3.0 to prima

Add AKM suite changes to support Opportunistic Wireless
Encryption. Also, add changes to populate OWE IE's if
OWE AKM is present.

Change-Id: I3cf9e5b0a5980e4f535034127dbc4c6e54764da6
CRs-Fixed: 2531177
parent 4cde829a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -147,6 +147,11 @@ typedef struct {
#define WLAN_AKM_SUITE_SAE 0x000FAC08
#endif

#ifndef WLAN_AKM_SUITE_OWE_1
#define WLAN_AKM_SUITE_OWE_1 0x000FAC12
#endif


enum qca_nl80211_vendor_subcmds {
    QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
    QCA_NL80211_VENDOR_SUBCMD_TEST = 1,
+21 −3
Original line number Diff line number Diff line
@@ -156,6 +156,8 @@ v_U8_t ccpRSNOui08[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x05 };
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
/* OWE https://tools.ietf.org/html/rfc8110 */
uint8_t ccp_rsn_oui_18[HDD_RSN_OUI_SIZE] = {0x00, 0x0F, 0xAC, 0x12};

#if defined(WLAN_FEATURE_VOWIFI_11R)
// Offset where the EID-Len-IE, start.
@@ -4499,6 +4501,11 @@ eCsrAuthType hdd_TranslateRSNToCsrAuthType( u_int8_t auth_suite[4])
        auth_type = eCSR_AUTH_TYPE_RSN_8021X_SHA256;
    } else
#endif
    if (!memcmp(auth_suite, ccp_rsn_oui_18, 4))
    {
       auth_type = eCSR_AUTH_TYPE_OWE;
    } else

    {
    /* If auth suite is of SAE, auth_type will be
     * overwritten in hdd_translate_sae_rsn_to_csr_auth
@@ -4506,6 +4513,8 @@ eCsrAuthType hdd_TranslateRSNToCsrAuthType( u_int8_t auth_suite[4])
     hdd_translate_sae_rsn_to_csr_auth(auth_suite, &auth_type);
     }

    hddLog(LOG1, FL("auth_type : %d"), auth_type);

    return auth_type;
}

@@ -4909,7 +4918,10 @@ int hdd_set_csr_auth_type ( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType)
    ENTER();

    pRoamProfile->AuthType.numEntries = 1;
    hddLog( LOG1, "%s: pHddStaCtx->conn_info.authType = %d", __func__, pHddStaCtx->conn_info.authType);
    hddLog( LOG1,
           "%s: authType = %d RSNAuthType %d wpa_versions %d",
           __func__, pHddStaCtx->conn_info.authType, RSNAuthType,
           pWextState->wpaVersion);

    switch( pHddStaCtx->conn_info.authType)
    {
@@ -4984,7 +4996,12 @@ int hdd_set_csr_auth_type ( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType)
                                            eCSR_AUTH_TYPE_RSN_8021X_SHA256;
            } else
#endif

            if ((RSNAuthType == eCSR_AUTH_TYPE_OWE) &&
                ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
                 == IW_AUTH_KEY_MGMT_802_1X)) {
                /* OWE case */
                pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_OWE;
            } else
            if( (pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
                    == IW_AUTH_KEY_MGMT_802_1X) {
               pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_RSN;
@@ -4992,7 +5009,8 @@ int hdd_set_csr_auth_type ( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType)
            if ( (pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_PSK)
                    == IW_AUTH_KEY_MGMT_PSK) {
               pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_RSN_PSK;
            } else {
            } else
            {
               pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_UNKNOWN;
            }
        }
+32 −1
Original line number Diff line number Diff line
@@ -16405,8 +16405,13 @@ static int wlan_hdd_set_akm_suite( hdd_adapter_t *pAdapter,
             pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
             break;
        case WLAN_AKM_SUITE_OWE_1:
             hddLog(LOG1, "setting key mgmt type to OWE");
             pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
             break;
        default:
            hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Unsupported key mgmt type %d",
            hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Unsupported key mgmt type %x",
                    __func__, key_mgmt);
            return -EINVAL;
@@ -16880,6 +16885,32 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter,
                }
                break;
#endif
            case SIR_MAC_REQUEST_EID_MAX:
                 if (genie[0] == SIR_DH_PARAMETER_ELEMENT_EXT_EID)
                 {
                    v_U16_t curAddIELen = pWextState->assocAddIE.length;
                    if (SIR_MAC_MAX_ADD_IE_LENGTH <
                        (pWextState->assocAddIE.length + eLen))
                    {
                       hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate assocAddIE "
                              "Need bigger buffer space");
                       VOS_ASSERT(0);
                       return -ENOMEM;
                    }
                 hddLog(VOS_TRACE_LEVEL_INFO, "Set DH EXT IE(len %d)",
                        eLen + 2);
                 memcpy( pWextState->assocAddIE.addIEdata + curAddIELen,
                         genie - 2, eLen + 2);
                 pWextState->assocAddIE.length += eLen + 2;
                 pWextState->roamProfile.pAddIEAssoc =
                                            pWextState->assocAddIE.addIEdata;
                 pWextState->roamProfile.nAddIEAssocLength =
                                            pWextState->assocAddIE.length;
                }else {
                hddLog(VOS_TRACE_LEVEL_FATAL, "UNKNOWN EID: %X", genie[0]);
                }
                break;
            default:
                hddLog (VOS_TRACE_LEVEL_ERROR,
                        "%s Set UNKNOWN IE %X", __func__, elementId);
+1 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ typedef enum eAniAuthType
    eSIR_FT_AUTH,
#endif
    eSIR_AUTH_TYPE_SAE = 3,
    eSIR_AUTH_TYPE_OWE = 4,
#if defined FEATURE_WLAN_ESE
    eSIR_LEAP_AUTH = 0x80,
#endif
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2016, 2017 The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2016, 2017, 2019 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -463,6 +463,9 @@

#define SIR_MAC_OUI_VERSION_1         1

/* OWE DH Parameter element https://tools.ietf.org/html/rfc8110 */
#define SIR_DH_PARAMETER_ELEMENT_EXT_EID 32

// OUI and type definition for WPA IE in network byte order
#define SIR_MAC_WPA_OUI             0x01F25000
#define SIR_MAC_WME_OUI             0x02F25000
Loading