From 98ca64303872d3be52e8d54c1460547ddca56365 Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Wed, 18 Nov 2020 21:23:47 +0800 Subject: [PATCH] qcacmn: Fix assert when connect WEP AP When 5G open mode AP and 2G WEP mode AP use same ssid, and WEP mode AP is selected to connect on UI, 5G open mode AP will be candidate in driver too for wrong security filter(WLAN_CRYPTO_CIPHER_NONE is supported by default, WEP match isn't checked at all for open AP). Since 5G is preferred, 5G open mode AP is selected and connected at last, peer is set as authenticated without waiting for key install. But WEP mode AP is assumed connected in wpa supplicant, so WEP key is sent to driver and F/W later. If peer is set as authenticated before PTK is installed, data may be sent without encryption, so F/W add assert for such order. To fix this issue, when reset cipher and auth set in vdev, don't keep WLAN_CRYPTO_CIPHER_NONE and WLAN_CRYPTO_AUTH_OPEN, just set to 0, all cipher and auth set should be get from connect request, scm_check_wep can be called for open mode AP in scm_is_security_match, when only WEP cipher is set in filter, open mode AP won't be selected. Change-Id: I48f9e74d0e8e31e789f33d038b11614d6b2ee6d0 CRs-Fixed: 2820129 --- umac/cmn_services/crypto/src/wlan_crypto_def_i.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/umac/cmn_services/crypto/src/wlan_crypto_def_i.h b/umac/cmn_services/crypto/src/wlan_crypto_def_i.h index 7baf0f237b12..9be3fb714b36 100644 --- a/umac/cmn_services/crypto/src/wlan_crypto_def_i.h +++ b/umac/cmn_services/crypto/src/wlan_crypto_def_i.h @@ -290,8 +290,7 @@ static inline void wlan_crypto_put_be64(u8 *a, u64 val) #define CLEAR_PARAM(__param, __val) ((__param) &= ((~1) << (__val))) -#define RESET_AUTHMODE(_param) ((_param)->authmodeset = \ - (1 << WLAN_CRYPTO_AUTH_OPEN)) +#define RESET_AUTHMODE(_param) ((_param)->authmodeset = 0) #define SET_AUTHMODE(_param, _mode) ((_param)->authmodeset |= (1 << (_mode))) #define HAS_AUTHMODE(_param, _mode) ((_param)->authmodeset & (1 << (_mode))) @@ -310,8 +309,7 @@ static inline void wlan_crypto_put_be64(u8 *a, u64 val) (((_param1)->authmodeset & (_param2)->authmodeset) != 0) -#define RESET_UCAST_CIPHERS(_param) ((_param)->ucastcipherset =\ - (1 << WLAN_CRYPTO_CIPHER_NONE)) +#define RESET_UCAST_CIPHERS(_param) ((_param)->ucastcipherset = 0) #define SET_UCAST_CIPHER(_param, _c) ((_param)->ucastcipherset |= (1 << (_c))) #define HAS_UCAST_CIPHER(_param, _c) ((_param)->ucastcipherset & (1 << (_c))) @@ -332,8 +330,7 @@ static inline void wlan_crypto_put_be64(u8 *a, u64 val) #define UCIPHER_IS_SMS4(_param) \ HAS_UCAST_CIPHER((_param), WLAN_CRYPTO_CIPHER_WAPI_SMS4) -#define RESET_MCAST_CIPHERS(_param) ((_param)->mcastcipherset = \ - (1 << WLAN_CRYPTO_CIPHER_NONE)) +#define RESET_MCAST_CIPHERS(_param) ((_param)->mcastcipherset = 0) #define SET_MCAST_CIPHER(_param, _c) ((_param)->mcastcipherset |= (1 << (_c))) #define HAS_MCAST_CIPHER(_param, _c) ((_param)->mcastcipherset & (1 << (_c))) #define HAS_ANY_MCAST_CIPHER(_param) ((_param)->mcastcipherset)