From 02cb9e02f1d22656ca4c1fe5c21340552e0a05c6 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Wed, 30 Aug 2017 17:39:50 +0530 Subject: [PATCH] qcacld-3.0: Changes to support DPP AKM Add changes to support and parse AKM required for DPP. Change-Id: Ie38a6b78e94d3cd918c02c7314bcb5696f53db24 CRs-Fixed: 2137519 --- core/hdd/src/wlan_hdd_assoc.c | 10 ++++++++-- core/hdd/src/wlan_hdd_cfg80211.c | 1 + core/hdd/src/wlan_hdd_cfg80211.h | 3 +++ core/sme/inc/csr_api.h | 1 + core/sme/src/csr/csr_api_scan.c | 4 ++++ core/sme/src/csr/csr_util.c | 27 +++++++++++++++++++++++++++ 6 files changed, 44 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 3c3ab8fa6566..377cd3acabed 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -122,6 +122,7 @@ uint8_t ccp_rsn_oui_0f[HDD_RSN_OUI_SIZE] = {0x00, 0x0F, 0xAC, 0x0F}; uint8_t ccp_rsn_oui_10[HDD_RSN_OUI_SIZE] = {0x00, 0x0F, 0xAC, 0x10}; uint8_t ccp_rsn_oui_11[HDD_RSN_OUI_SIZE] = {0x00, 0x0F, 0xAC, 0x11}; #endif +uint8_t ccp_rsn_oui_12[HDD_RSN_OUI_SIZE] = {0x50, 0x6F, 0x9A, 0x02}; /* Offset where the EID-Len-IE, start. */ #define FT_ASSOC_RSP_IES_OFFSET 6 /* Capability(2) + AID(2) + Status Code(2) */ @@ -4796,6 +4797,9 @@ eCsrAuthType hdd_translate_rsn_to_csr_auth_type(uint8_t auth_suite[4]) auth_type = eCSR_AUTH_TYPE_RSN_8021X_SHA256; } else #endif + if (memcmp(auth_suite, ccp_rsn_oui_12, 4) == 0) { + auth_type = eCSR_AUTH_TYPE_DPP_RSN; + } else { hdd_translate_fils_rsn_to_csr_auth(auth_suite, &auth_type); } @@ -5216,8 +5220,10 @@ int hdd_set_csr_auth_type(struct hdd_adapter *adapter, eCSR_AUTH_TYPE_CCKM_RSN; } else #endif - - if ((RSNAuthType == eCSR_AUTH_TYPE_FT_RSN) && + if (RSNAuthType == eCSR_AUTH_TYPE_DPP_RSN) { + roam_profile->AuthType.authType[0] = + eCSR_AUTH_TYPE_DPP_RSN; + } else if ((RSNAuthType == eCSR_AUTH_TYPE_FT_RSN) && ((pWextState-> authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) == IW_AUTH_KEY_MGMT_802_1X)) { diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 22b44b958f03..bcc65c4550f9 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -16329,6 +16329,7 @@ static int wlan_hdd_set_akm_suite(struct hdd_adapter *adapter, u32 key_mgmt) case WLAN_AKM_SUITE_PSK: case WLAN_AKM_SUITE_PSK_SHA256: case WLAN_AKM_SUITE_FT_PSK: + case WLAN_AKM_SUITE_DPP_RSN: hdd_debug("setting key mgmt type to PSK"); pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_PSK; break; diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 9c866e08a548..4daad461de34 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -110,6 +110,9 @@ struct hdd_context; #ifndef WLAN_AKM_SUITE_FT_FILS_SHA384 #define WLAN_AKM_SUITE_FT_FILS_SHA384 0x000FAC11 #endif +#ifndef WLAN_AKM_SUITE_DPP_RSN +#define WLAN_AKM_SUITE_DPP_RSN 0x506f9a02 +#endif #ifdef FEATURE_WLAN_TDLS #define WLAN_IS_TDLS_SETUP_ACTION(action) \ diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index e018186a343f..e66041d94e2a 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -69,6 +69,7 @@ typedef enum { eCSR_AUTH_TYPE_FILS_SHA384, eCSR_AUTH_TYPE_FT_FILS_SHA256, eCSR_AUTH_TYPE_FT_FILS_SHA384, + eCSR_AUTH_TYPE_DPP_RSN, 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/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 875614106a42..a55a00f1eec9 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -5031,6 +5031,8 @@ static enum wlan_auth_type csr_covert_auth_type_new(eCsrAuthType auth) return WLAN_AUTH_TYPE_FT_FILS_SHA256; case eCSR_AUTH_TYPE_FT_FILS_SHA384: return WLAN_AUTH_TYPE_FT_FILS_SHA384; + case eCSR_AUTH_TYPE_DPP_RSN: + return WLAN_AUTH_TYPE_DPP_RSN; case eCSR_NUM_OF_SUPPORT_AUTH_TYPE: default: return WLAN_AUTH_TYPE_OPEN_SYSTEM; @@ -5080,6 +5082,8 @@ static eCsrAuthType csr_covert_auth_type_old(enum wlan_auth_type auth) return eCSR_AUTH_TYPE_FT_FILS_SHA256; case WLAN_AUTH_TYPE_FT_FILS_SHA384: return eCSR_AUTH_TYPE_FT_FILS_SHA384; + case WLAN_AUTH_TYPE_DPP_RSN: + return eCSR_AUTH_TYPE_DPP_RSN; case WLAN_NUM_OF_SUPPORT_AUTH_TYPE: default: return eCSR_AUTH_TYPE_OPEN_SYSTEM; diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index e46e329af8ff..78bde62a8571 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -113,6 +113,9 @@ uint8_t csr_rsn_oui[][CSR_RSN_OUI_SIZE] = { {0x00, 0x0F, 0xAC, 0x08}, /* AES GCMP-256 */ {0x00, 0x0F, 0xAC, 0x09}, +#define ENUM_DPP_RSN 15 + /* DPP RSN */ + {0x50, 0x6F, 0x9A, 0x02}, /* define new oui here, update #define CSR_OUI_***_INDEX */ }; @@ -2418,6 +2421,7 @@ bool csr_is_profile_rsn(tCsrRoamProfile *pProfile) case eCSR_AUTH_TYPE_FILS_SHA384: case eCSR_AUTH_TYPE_FT_FILS_SHA256: case eCSR_AUTH_TYPE_FT_FILS_SHA384: + case eCSR_AUTH_TYPE_DPP_RSN: fRSNProfile = true; break; @@ -3183,6 +3187,23 @@ static bool csr_is_auth_fils_ft_sha384(tpAniSirGlobal mac, } #endif +/* + * csr_is_auth_dpp_rsn() - check whether oui is dpp rsn + * @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 dpp rsn, false otherwise + */ +static bool csr_is_auth_dpp_rsn(tpAniSirGlobal mac, + uint8_t all_suites[][CSR_RSN_OUI_SIZE], + uint8_t suite_count, uint8_t oui[]) +{ + return csr_is_oui_match(mac, all_suites, suite_count, + csr_rsn_oui[ENUM_DPP_RSN], oui); +} + static bool csr_is_auth_wpa(tpAniSirGlobal pMac, uint8_t AllSuites[][CSR_WPA_OUI_SIZE], uint8_t cAllSuites, uint8_t Oui[]) @@ -3387,6 +3408,12 @@ static bool csr_get_rsn_information(tHalHandle hal, tCsrAuthList *auth_type, csr_is_fils_auth(mac_ctx, authsuites, c_auth_suites, authentication, auth_type, i, &neg_authtype); /* Changed the AKM suites according to order of preference */ + if ((neg_authtype == eCSR_AUTH_TYPE_UNKNOWN) && + csr_is_auth_dpp_rsn(mac_ctx, authsuites, + c_auth_suites, authentication)) { + if (eCSR_AUTH_TYPE_DPP_RSN == auth_type->authType[i]) + neg_authtype = eCSR_AUTH_TYPE_DPP_RSN; + } if ((neg_authtype == eCSR_AUTH_TYPE_UNKNOWN) && csr_is_ft_auth_rsn(mac_ctx, authsuites, c_auth_suites, authentication)) {