소스 검색

qcacld-3.0: Reset crypto params on open mode connect request

In case of open mode the crypto params are not updated and thus
older params values are maintained. This can lead to failure
in open mode connect.

Thus Reset crypto params on open mode connect request

Change-Id: Ia986f1b0d7b29410d32090be3e9bfb9db96c6c11
CRs-Fixed: 2713346
gaurank kathpalia 4 년 전
부모
커밋
015b76d0c7
1개의 변경된 파일26개의 추가작업 그리고 5개의 파일을 삭제
  1. 26 5
      core/hdd/src/wlan_hdd_cfg80211.c

+ 26 - 5
core/hdd/src/wlan_hdd_cfg80211.c

@@ -19132,20 +19132,41 @@ static void hdd_populate_crypto_cipher_type(u32 cipher,
 static void hdd_populate_crypto_params(struct wlan_objmgr_vdev *vdev,
 				       struct cfg80211_connect_params *req)
 {
+	uint32_t set_val = 0;
+
 	hdd_populate_crypto_auth_type(vdev, req->auth_type);
 
-	if (req->crypto.n_akm_suites)
+	if (req->crypto.n_akm_suites) {
 		hdd_populate_crypto_akm_type(vdev, req->crypto.akm_suites[0]);
-
-	if (req->crypto.n_ciphers_pairwise)
+	} else {
+		/* Reset to none */
+		HDD_SET_BIT(set_val, WLAN_CRYPTO_KEY_MGMT_NONE);
+		wlan_crypto_set_vdev_param(vdev,
+					    WLAN_CRYPTO_PARAM_KEY_MGMT,
+					    set_val);
+	}
+	if (req->crypto.n_ciphers_pairwise) {
 		hdd_populate_crypto_cipher_type(req->crypto.ciphers_pairwise[0],
 						vdev,
 						WLAN_CRYPTO_PARAM_UCAST_CIPHER);
-
-	if (req->crypto.cipher_group)
+	} else {
+		/* Reset to none */
+		HDD_SET_BIT(set_val, WLAN_CRYPTO_CIPHER_NONE);
+		wlan_crypto_set_vdev_param(vdev,
+					    WLAN_CRYPTO_PARAM_UCAST_CIPHER,
+					    0);
+	}
+	if (req->crypto.cipher_group) {
 		hdd_populate_crypto_cipher_type(req->crypto.cipher_group,
 						vdev,
 						WLAN_CRYPTO_PARAM_MCAST_CIPHER);
+	} else {
+		/* Reset to none */
+		HDD_SET_BIT(set_val, WLAN_CRYPTO_CIPHER_NONE);
+		wlan_crypto_set_vdev_param(vdev,
+					    WLAN_CRYPTO_PARAM_MCAST_CIPHER,
+					    0);
+	}
 }
 
 /**