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

Commit ec11571f authored by Nirav Shah's avatar Nirav Shah Committed by nshrivas
Browse files

qcacmn: Disallow TKIP/WEP with HT supported client

As softap, send assoc failure if HT supported client try to associate
as WEP/TKIP pairwise key.

Change-Id: Ie33e5d83ec18e10aae51a4cc3515f754bd24774e
CRs-Fixed: 2623660
parent f8173d4b
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -683,6 +683,7 @@ bool wlan_crypto_check_wep(struct wlan_objmgr_psoc *psoc, uint8_t vedv_id);
 * @vdev_id: vdev id
 * @vdev_id: vdev id
 * @ie_ptr: pointer to IEs
 * @ie_ptr: pointer to IEs
 * @ie_len: IE length
 * @ie_len: IE length
 * @peer_crypto_params: return peer crypto parameters
 *
 *
 * This function gets called from ucfg to check RSN match.
 * This function gets called from ucfg to check RSN match.
 *
 *
@@ -690,7 +691,8 @@ bool wlan_crypto_check_wep(struct wlan_objmgr_psoc *psoc, uint8_t vedv_id);
 */
 */
bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
				 uint8_t vedv_id, uint8_t *ie_ptr,
				 uint8_t vedv_id, uint8_t *ie_ptr,
				 uint16_t ie_len);
				 uint16_t ie_len, struct wlan_crypto_params *
				 peer_crypto_params);


/**
/**
 * wlan_crypto_check_rsn_match - called by ucfg to check for WPA match
 * wlan_crypto_check_rsn_match - called by ucfg to check for WPA match
@@ -698,6 +700,7 @@ bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
 * @vdev_id: vdev id
 * @vdev_id: vdev id
 * @ie_ptr: pointer to IEs
 * @ie_ptr: pointer to IEs
 * @ie_len: IE length
 * @ie_len: IE length
 * @peer_crypto_params: return peer crypto parameters
 *
 *
 * This function gets called from ucfg to check WPA match.
 * This function gets called from ucfg to check WPA match.
 *
 *
@@ -705,7 +708,8 @@ bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
 */
 */
bool wlan_crypto_check_wpa_match(struct wlan_objmgr_psoc *psoc,
bool wlan_crypto_check_wpa_match(struct wlan_objmgr_psoc *psoc,
				 uint8_t vedv_id, uint8_t *ie_ptr,
				 uint8_t vedv_id, uint8_t *ie_ptr,
				 uint16_t ie_len);
				 uint16_t ie_len, struct wlan_crypto_params *
				 peer_crypto_params);


/**
/**
 * wlan_set_vdev_crypto_prarams_from_ie - Sets vdev crypto params from IE info
 * wlan_set_vdev_crypto_prarams_from_ie - Sets vdev crypto params from IE info
+12 −8
Original line number Original line Diff line number Diff line
@@ -3941,6 +3941,7 @@ wlan_get_crypto_params_from_wpa_ie(struct wlan_crypto_params *crypto_params,
 * @vdev_id: vdev id
 * @vdev_id: vdev id
 * @ie_ptr: pointer to IEs
 * @ie_ptr: pointer to IEs
 * @ie_len: IE length
 * @ie_len: IE length
 * @peer_crypto_params: return peer crypto parameters
 *
 *
 * This function gets called from ucfg to check RSN match.
 * This function gets called from ucfg to check RSN match.
 *
 *
@@ -3948,9 +3949,9 @@ wlan_get_crypto_params_from_wpa_ie(struct wlan_crypto_params *crypto_params,
 */
 */
bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
				 uint8_t vdev_id, uint8_t *ie_ptr,
				 uint8_t vdev_id, uint8_t *ie_ptr,
				 uint16_t ie_len)
				 uint16_t ie_len, struct wlan_crypto_params *
				 peer_crypto_params)
{
{
	struct wlan_crypto_params peer_crypto_params;
	struct wlan_objmgr_vdev *vdev;
	struct wlan_objmgr_vdev *vdev;
	bool match = true;
	bool match = true;
	QDF_STATUS status;
	QDF_STATUS status;
@@ -3959,7 +3960,7 @@ bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
		crypto_err("PSOC is NULL");
		crypto_err("PSOC is NULL");
		return false;
		return false;
	}
	}
	status = wlan_get_crypto_params_from_rsn_ie(&peer_crypto_params,
	status = wlan_get_crypto_params_from_rsn_ie(peer_crypto_params,
						    ie_ptr, ie_len);
						    ie_ptr, ie_len);
	if (QDF_STATUS_SUCCESS != status) {
	if (QDF_STATUS_SUCCESS != status) {
		crypto_err("get crypto prarams from RSN IE failed");
		crypto_err("get crypto prarams from RSN IE failed");
@@ -3972,7 +3973,8 @@ bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
		return false;
		return false;
	}
	}


	match = wlan_crypto_rsn_info(vdev, &peer_crypto_params);
	match = wlan_crypto_rsn_info(vdev, peer_crypto_params);

	wlan_objmgr_vdev_release_ref(vdev, WLAN_CRYPTO_ID);
	wlan_objmgr_vdev_release_ref(vdev, WLAN_CRYPTO_ID);


	return match;
	return match;
@@ -3984,6 +3986,7 @@ bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
 * @vdev_id: vdev id
 * @vdev_id: vdev id
 * @ie_ptr: pointer to IEs
 * @ie_ptr: pointer to IEs
 * @ie_len: IE length
 * @ie_len: IE length
 * @peer_crypto_params: return peer crypto parameters
 *
 *
 * This function gets called from ucfg to check WPA match.
 * This function gets called from ucfg to check WPA match.
 *
 *
@@ -3991,9 +3994,9 @@ bool wlan_crypto_check_rsn_match(struct wlan_objmgr_psoc *psoc,
 */
 */
bool wlan_crypto_check_wpa_match(struct wlan_objmgr_psoc *psoc,
bool wlan_crypto_check_wpa_match(struct wlan_objmgr_psoc *psoc,
				 uint8_t vdev_id, uint8_t *ie_ptr,
				 uint8_t vdev_id, uint8_t *ie_ptr,
				 uint16_t ie_len)
				 uint16_t ie_len, struct wlan_crypto_params *
				 peer_crypto_params)
{
{
	struct wlan_crypto_params peer_crypto_params;
	struct wlan_objmgr_vdev *vdev;
	struct wlan_objmgr_vdev *vdev;
	bool match = true;
	bool match = true;
	QDF_STATUS status;
	QDF_STATUS status;
@@ -4009,14 +4012,15 @@ bool wlan_crypto_check_wpa_match(struct wlan_objmgr_psoc *psoc,
		return false;
		return false;
	}
	}


	status = wlan_get_crypto_params_from_wpa_ie(&peer_crypto_params,
	status = wlan_get_crypto_params_from_wpa_ie(peer_crypto_params,
						    ie_ptr, ie_len);
						    ie_ptr, ie_len);
	if (QDF_STATUS_SUCCESS != status) {
	if (QDF_STATUS_SUCCESS != status) {
		crypto_err("get crypto prarams from WPA IE failed");
		crypto_err("get crypto prarams from WPA IE failed");
		match = false;
		match = false;
		goto send_res;
		goto send_res;
	}
	}
	match = wlan_crypto_rsn_info(vdev, &peer_crypto_params);
	match = wlan_crypto_rsn_info(vdev, peer_crypto_params);

send_res:
send_res:
	wlan_objmgr_vdev_release_ref(vdev, WLAN_CRYPTO_ID);
	wlan_objmgr_vdev_release_ref(vdev, WLAN_CRYPTO_ID);