summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbings <bings@codeaurora.org>2019-02-18 16:25:27 +0800
committerbings <bings@codeaurora.org>2019-02-27 14:33:38 +0800
commit3f6aa4ba035026e6bf533bf911bd3934397a40da (patch)
tree71283c4d93c485ce9884831f73bfff327dd4f617
parent13a31272763b53912162ba69ea5997c56d284638 (diff)
qcacld-2.0: Add support for OWE
propagation from qcacld-3.0 to qcacld-2.0 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: 2405955
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg80211.h4
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c16
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c29
-rw-r--r--CORE/MAC/inc/aniSystemDefs.h1
-rw-r--r--CORE/MAC/inc/sirMacProtDef.h5
-rw-r--r--CORE/SME/inc/csrApi.h1
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c6
-rw-r--r--CORE/SME/src/csr/csrUtil.c30
8 files changed, 88 insertions, 4 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h
index 2413a48d7451..cb89976093cc 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg80211.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h
@@ -152,6 +152,10 @@ typedef struct {
#define WLAN_AKM_SUITE_SAE 0x000FAC08
#endif
+#ifndef WLAN_AKM_SUITE_OWE
+#define WLAN_AKM_SUITE_OWE 0x000FAC12
+#endif
+
/* Vendor id to be used in vendor specific command and events
* to user space.
* NOTE: The authoritative place for definition of QCA_NL80211_VENDOR_ID,
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 456c8db31b9b..1f8b2ec2dff9 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -110,6 +110,9 @@ 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
+/* OWE https://tools.ietf.org/html/rfc8110 */
+uint8_t ccp_rsn_oui_18[HDD_RSN_OUI_SIZE] = {0x00, 0x0F, 0xAC, 0x12};
+
#ifdef WLAN_FEATURE_FILS_SK
uint8_t ccp_rsn_oui_0e[HDD_RSN_OUI_SIZE] = {0x00, 0x0F, 0xAC, 0x0E};
uint8_t ccp_rsn_oui_0f[HDD_RSN_OUI_SIZE] = {0x00, 0x0F, 0xAC, 0x0F};
@@ -5134,6 +5137,8 @@ eCsrAuthType hdd_TranslateRSNToCsrAuthType( u_int8_t auth_suite[4])
if (memcmp(auth_suite , ccpRSNOui08, 4) == 0)
{
auth_type = eCSR_AUTH_TYPE_RSN_8021X_SHA256;
+ } else if (memcmp(auth_suite, ccp_rsn_oui_18, 4) == 0) {
+ auth_type = eCSR_AUTH_TYPE_OWE;
} else
#endif
{
@@ -5537,7 +5542,10 @@ int hdd_set_csr_auth_type ( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType)
hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
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)
{
@@ -5618,6 +5626,12 @@ int hdd_set_csr_auth_type ( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType)
hddLog(LOG1, "updated profile authtype as %d", RSNAuthType);
} 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;
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 388a7517b109..0dd96ff5452a 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -23892,6 +23892,11 @@ 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:
+ 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",
__func__, key_mgmt);
@@ -24269,6 +24274,30 @@ 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);
diff --git a/CORE/MAC/inc/aniSystemDefs.h b/CORE/MAC/inc/aniSystemDefs.h
index 5f0e8b67abfd..7e2eb8248b12 100644
--- a/CORE/MAC/inc/aniSystemDefs.h
+++ b/CORE/MAC/inc/aniSystemDefs.h
@@ -86,6 +86,7 @@ typedef enum eAniAuthType
eSIR_FILS_SK_WITH_PFS = 5,
eSIR_FILS_PK_AUTH = 6,
#endif
+ eSIR_AUTH_TYPE_OWE = 7,
#if defined FEATURE_WLAN_ESE
eSIR_LEAP_AUTH = 0x80,
#endif
diff --git a/CORE/MAC/inc/sirMacProtDef.h b/CORE/MAC/inc/sirMacProtDef.h
index edd14557df9d..5cec930cb15e 100644
--- a/CORE/MAC/inc/sirMacProtDef.h
+++ b/CORE/MAC/inc/sirMacProtDef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017, 2019 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -447,6 +447,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
diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h
index c6a5480fd45c..8a9961e0d877 100644
--- a/CORE/SME/inc/csrApi.h
+++ b/CORE/SME/inc/csrApi.h
@@ -80,6 +80,7 @@ typedef enum
eCSR_AUTH_TYPE_FT_FILS_SHA256,
eCSR_AUTH_TYPE_FT_FILS_SHA384,
#endif
+ eCSR_AUTH_TYPE_OWE,
eCSR_NUM_OF_SUPPORT_AUTH_TYPE,
eCSR_AUTH_TYPE_FAILED = 0xff,
eCSR_AUTH_TYPE_UNKNOWN = eCSR_AUTH_TYPE_FAILED,
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 71819efc92e6..d1f6d8507cbb 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -3585,8 +3585,10 @@ eHalStatus csrRoamPrepareBssConfig(tpAniSirGlobal pMac, tCsrRoamProfile *pProfil
pBssConfig->uCfgDot11Mode = eCSR_CFG_DOT11_MODE_11A;
}
}
- smsLog(pMac, LOG1, FL("phyMode %d uCfgDot11Mode %d"),
- pProfile->phyMode, pBssConfig->uCfgDot11Mode);
+ smsLog(pMac, LOG1,
+ FL("phyMode %d uCfgDot11Mode %d negotiatedAuthType %d"),
+ pProfile->phyMode, pBssConfig->uCfgDot11Mode,
+ pProfile->negotiatedAuthType);
//Qos
if ((pBssConfig->uCfgDot11Mode != eCSR_CFG_DOT11_MODE_11N) &&
(pMac->roam.configParam.WMMSupportMode == eCsrRoamWmmNoQos))
diff --git a/CORE/SME/src/csr/csrUtil.c b/CORE/SME/src/csr/csrUtil.c
index bc583072e175..de261e180e83 100644
--- a/CORE/SME/src/csr/csrUtil.c
+++ b/CORE/SME/src/csr/csrUtil.c
@@ -104,6 +104,9 @@ tANI_U8 csrRSNOui[][ CSR_RSN_OUI_SIZE ] = {
{0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00},
#endif
+#define ENUM_OWE 15
+ /* OWE https://tools.ietf.org/html/rfc8110 */
+ {0x00, 0x0F, 0xAC, 0x12},
/* define new oui here */
};
@@ -2397,6 +2400,10 @@ tANI_BOOLEAN csrIsProfileRSN( tCsrRoamProfile *pProfile )
case eCSR_AUTH_TYPE_SAE:
fRSNProfile = true;
break;
+ case eCSR_AUTH_TYPE_OWE:
+ fRSNProfile = true;
+ break;
+
default:
fRSNProfile = FALSE;
break;
@@ -3210,6 +3217,23 @@ static bool csr_is_auth_wpa_sae(tpAniSirGlobal mac,
}
#endif
+/*
+ * csr_is_auth_wpa_owe() - check whether oui is OWE
+ * @mac: Global MAC context
+ * @all_suites: pointer to all supported akm suites
+ * @suite_count: all supported akm suites count
+ * @oui: Oui needs to be matched
+ *
+ * Return: True if OUI is SAE, false otherwise
+ */
+static bool csr_is_auth_wpa_owe(tpAniSirGlobal mac,
+ uint8_t all_suites[][CSR_RSN_OUI_SIZE],
+ uint8_t suite_count, uint8_t oui[])
+{
+ return csrIsOuiMatch
+ (mac, all_suites, suite_count, csrRSNOui[ENUM_OWE], oui);
+}
+
static tANI_BOOLEAN csrIsAuthWpa( tpAniSirGlobal pMac, tANI_U8 AllSuites[][CSR_WPA_OUI_SIZE],
tANI_U8 cAllSuites,
tANI_U8 Oui[] )
@@ -3474,6 +3498,12 @@ tANI_BOOLEAN csrGetRSNInformation( tHalHandle hHal, tCsrAuthList *pAuthType, eCs
negAuthType = eCSR_AUTH_TYPE_RSN_8021X_SHA256;
}
#endif
+ if ((negAuthType == eCSR_AUTH_TYPE_UNKNOWN) &&
+ csr_is_auth_wpa_owe(pMac, AuthSuites,
+ cAuthSuites, Authentication)) {
+ if (eCSR_AUTH_TYPE_OWE == pAuthType->authType[i])
+ negAuthType = eCSR_AUTH_TYPE_OWE;
+ }
// The 1st auth type in the APs RSN IE, to match stations connecting
// profiles auth type will cause us to exit this loop