Browse Source

qcacld-3.0: Increase PMK max length to 64bytes

For SAE-EXT-KEY AKM with group-21 pwe, the PMK
length is 64bytes. Therefore, increase the max
size of the PMK to 64bytes in host to facilitate
PMK storage and PMK offloads.

Change-Id: I777a31acd56073d6a0312c47d95fe7d155b06fc6
CRs-Fixed: 3353102
Surya Prakash Sivaraj 2 years ago
parent
commit
2095242876

+ 3 - 4
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h

@@ -130,7 +130,6 @@
 #define ROAM_REASON_MASK 0x0F
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
-#define ROAM_SCAN_PSK_SIZE    48
 #define ROAM_R0KH_ID_MAX_LEN  48
 /* connected but not authenticated */
 #define ROAM_AUTH_STATUS_CONNECTED      0x1
@@ -541,7 +540,7 @@ struct rso_config {
 #endif
 #endif
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	uint8_t psk_pmk[ROAM_SCAN_PSK_SIZE];
+	uint8_t psk_pmk[MAX_PMK_LEN];
 	uint8_t pmk_len;
 #endif
 	struct owe_transition_mode_info owe_info;
@@ -1454,7 +1453,7 @@ struct wlan_rso_11i_params {
 	bool fw_okc;
 	bool fw_pmksa_cache;
 	bool is_sae_same_pmk;
-	uint8_t psk_pmk[WMI_ROAM_SCAN_PSK_SIZE];
+	uint8_t psk_pmk[MAX_PMK_LEN];
 	uint8_t pmk_len;
 };
 
@@ -1472,7 +1471,7 @@ struct wlan_rso_11r_params {
 	bool is_11r_assoc;
 	bool is_adaptive_11r;
 	bool enable_ft_im_roaming;
-	uint8_t psk_pmk[WMI_ROAM_SCAN_PSK_SIZE];
+	uint8_t psk_pmk[MAX_PMK_LEN];
 	uint8_t pmk_len;
 	uint32_t r0kh_id_length;
 	uint8_t r0kh_id[WMI_ROAM_R0KH_ID_MAX_LEN];

+ 12 - 5
components/wmi/src/wmi_unified_roam_tlv.c

@@ -3669,8 +3669,6 @@ extract_roam_event(wmi_unified_t wmi_handle, void *evt_buf, uint32_t len,
 }
 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
 
-#define ROAM_OFFLOAD_PMK_EXT_BYTES 16
-
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 /**
  * wmi_fill_roam_offload_11r_params() - Fill roam scan params to send it to fw
@@ -4173,9 +4171,13 @@ wmi_fill_rso_tlvs(wmi_unified_t wmi_handle, uint8_t *buf,
 				     src_11i_info->psk_pmk,
 				     roam_offload_11i->pmk_len);
 
-			roam_offload_11i->pmk_ext_len =
-			    src_11i_info->pmk_len > ROAM_OFFLOAD_PMK_BYTES ?
-			    ROAM_OFFLOAD_PMK_EXT_BYTES : 0;
+			roam_offload_11i->pmk_ext_len = 0;
+			if (src_11i_info->pmk_len > ROAM_OFFLOAD_PMK_BYTES) {
+				roam_offload_11i->pmk_ext_len =
+					QDF_MIN(src_11i_info->pmk_len -
+						ROAM_OFFLOAD_PMK_BYTES,
+						ROAM_OFFLOAD_PMK_BYTES);
+			}
 			qdf_mem_copy(
 				roam_offload_11i->pmk_ext,
 				&src_11i_info->psk_pmk[ROAM_OFFLOAD_PMK_BYTES],
@@ -4212,6 +4214,11 @@ wmi_fill_rso_tlvs(wmi_unified_t wmi_handle, uint8_t *buf,
 						   QDF_TRACE_LEVEL_DEBUG,
 						   roam_offload_11i->pmk,
 						   WLAN_MAX_PMK_DUMP_BYTES);
+			if (roam_offload_11i->pmk_ext_len)
+				QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI,
+						   QDF_TRACE_LEVEL_DEBUG,
+						   roam_offload_11i->pmk_ext,
+						   WLAN_MAX_PMK_DUMP_BYTES);
 		}
 	} else {
 		WMITLV_SET_HDR(buf, WMITLV_TAG_ARRAY_STRUC, 0);

+ 3 - 3
core/hdd/src/wlan_hdd_cfg80211.c

@@ -7244,7 +7244,7 @@ static int __wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
 	}
 
 	if ((!data) || (data_len <= 0) ||
-	    (data_len > ROAM_SCAN_PSK_SIZE)) {
+	    (data_len > MAX_PMK_LEN)) {
 		hdd_err("Invalid data");
 		return -EINVAL;
 	}
@@ -22871,11 +22871,11 @@ static void hdd_fill_pmksa_info(struct hdd_adapter *adapter,
 		return;
 
 	qdf_mem_copy(pmk_cache->pmkid, pmksa->pmkid, PMKID_LEN);
-	if (pmksa->pmk_len && (pmksa->pmk_len <= CSR_RSN_MAX_PMK_LEN)) {
+	if (pmksa->pmk_len && (pmksa->pmk_len <= MAX_PMK_LEN)) {
 		qdf_mem_copy(pmk_cache->pmk, pmksa->pmk, pmksa->pmk_len);
 		pmk_cache->pmk_len = pmksa->pmk_len;
 	} else
-		hdd_debug("pmk len is %zu", pmksa->pmk_len);
+		hdd_err("Invalid pmk len is %zu", pmksa->pmk_len);
 }
 #else
 /*

+ 0 - 2
core/sme/inc/csr_api.h

@@ -184,8 +184,6 @@ typedef enum {
 	eCSR_INI_CHANNEL_BONDING_STATE_MAX = 11
 } eIniChanBondState;
 
-#define CSR_RSN_MAX_PMK_LEN         48
-
 typedef struct tagCsrChannelInfo {
 	uint8_t numOfChannels;
 	uint32_t *freq_list;