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

Commit 88691d0f authored by Kiran Kumar Lokere's avatar Kiran Kumar Lokere Committed by snandini
Browse files

qcacmn: Fix the issue with OWE AP scan in 6GHz

Check the RSNXE IE presence only for SAP key mgmt type.

Change-Id: I3c9df627589e351a30dc9899ccaa7f24e9516965
CRs-Fixed: 2924842
parent 63a1982b
Loading
Loading
Loading
Loading
+20 −35
Original line number Diff line number Diff line
@@ -1296,27 +1296,6 @@ cm_calculate_etp_score(struct wlan_objmgr_psoc *psoc,
				  entry->rssi_raw,
				  phy_config);
}

#ifdef CONFIG_BAND_6GHZ
static bool cm_check_h2e_support(const uint8_t *rsnxe, uint8_t sae_pwe)
{
	const uint8_t *rsnxe_cap;
	uint8_t cap_len;

	rsnxe_cap = wlan_crypto_parse_rsnxe_ie(rsnxe, &cap_len);
	if (!rsnxe_cap) {
		mlme_debug("RSNXE caps not present");
		return false;
	}

	if (*rsnxe_cap & WLAN_CRYPTO_RSNX_CAP_SAE_H2E)
		return true;

	mlme_debug("RSNXE caps %x dont have H2E support", *rsnxe_cap);

	return false;
}
#endif
#else
static bool
cm_get_pcl_weight_of_channel(uint32_t chan_freq,
@@ -1375,19 +1354,6 @@ cm_calculate_etp_score(struct wlan_objmgr_psoc *psoc,
{
	return 0;
}

#ifdef CONFIG_BAND_6GHZ
static bool cm_check_h2e_support(const uint8_t *rsnxe, uint8_t sae_pwe)
{
	/* limiting to H2E usage only */
	if (sae_pwe == 1)
		return true;

	mlme_debug("sae_pwe %d is not H2E", sae_pwe);

	return false;
}
#endif
#endif

/**
@@ -1823,6 +1789,25 @@ void wlan_cm_calculate_bss_score(struct wlan_objmgr_pdev *pdev,
}

#ifdef CONFIG_BAND_6GHZ
static bool cm_check_h2e_support(const uint8_t *rsnxe)
{
	const uint8_t *rsnxe_cap;
	uint8_t cap_len;

	rsnxe_cap = wlan_crypto_parse_rsnxe_ie(rsnxe, &cap_len);
	if (!rsnxe_cap) {
		mlme_debug("RSNXE caps not present");
		return false;
	}

	if (*rsnxe_cap & WLAN_CRYPTO_RSNX_CAP_SAE_H2E)
		return true;

	mlme_debug("RSNXE caps %x dont have H2E support", *rsnxe_cap);

	return false;
}

bool wlan_cm_6ghz_allowed_for_akm(struct wlan_objmgr_psoc *psoc,
				  uint32_t key_mgmt, uint16_t rsn_caps,
				  const uint8_t *rsnxe, uint8_t sae_pwe,
@@ -1871,7 +1856,7 @@ bool wlan_cm_6ghz_allowed_for_akm(struct wlan_objmgr_psoc *psoc,
	      QDF_HAS_PARAM(key_mgmt, WLAN_CRYPTO_KEY_MGMT_FT_SAE)))
		return true;

	return cm_check_h2e_support(rsnxe, sae_pwe);
	return cm_check_h2e_support(rsnxe);
}

void wlan_cm_set_check_6ghz_security(struct wlan_objmgr_psoc *psoc,
+7 −15
Original line number Diff line number Diff line
@@ -919,9 +919,6 @@ QDF_STATUS __scm_handle_bcn_probe(struct scan_bcn_probe_event *bcn)
	struct scan_cache_node *scan_node;
	struct wlan_frame_hdr *hdr = NULL;
	struct wlan_crypto_params sec_params;
	uint8_t sae_pwe = 0;
	const uint8_t *rsnxe_cap;
	uint8_t rsnxe_len = 0;

	if (!bcn) {
		scm_err("bcn is NULL");
@@ -1019,12 +1016,9 @@ QDF_STATUS __scm_handle_bcn_probe(struct scan_bcn_probe_event *bcn)
		}
		if (wlan_cm_get_check_6ghz_security(psoc) &&
		    wlan_reg_is_6ghz_chan_freq(scan_entry->channel.chan_freq)) {
			rsnxe_cap = wlan_crypto_parse_rsnxe_ie(
					util_scan_entry_rsnxe(scan_entry),
					&rsnxe_len);
			if (!util_scan_entry_rsn(scan_entry) || !rsnxe_cap) {
			if (!util_scan_entry_rsn(scan_entry)) {
				scm_info("Drop frame from "QDF_MAC_ADDR_FMT
					 ": No RSN/RSNXE IE for 6GHz AP",
					 ": No RSN IE for 6GHz AP",
					 QDF_MAC_ADDR_REF(
						 scan_entry->bssid.bytes));
				util_scan_free_cache_entry(scan_entry);
@@ -1044,14 +1038,12 @@ QDF_STATUS __scm_handle_bcn_probe(struct scan_bcn_probe_event *bcn)
				qdf_mem_free(scan_node);
				continue;
			}
			if (*rsnxe_cap & WLAN_CRYPTO_RSNX_CAP_SAE_H2E)
				sae_pwe = 1;
			if (!wlan_cm_6ghz_allowed_for_akm(psoc,
					sec_params.key_mgmt,
					sec_params.rsn_caps,
					util_scan_entry_rsnxe(scan_entry),
					sae_pwe, false)) {
				scm_err("Drop frame from "QDF_MAC_ADDR_FMT
					0, false)) {
				scm_info("Drop frame from "QDF_MAC_ADDR_FMT
					 ": Security check failed for 6GHz AP",
					 QDF_MAC_ADDR_REF(
						 scan_entry->bssid.bytes));