Selaa lähdekoodia

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
Jianmin Zhu 4 vuotta sitten
vanhempi
sitoutus
c6aee5cbd6
1 muutettua tiedostoa jossa 3 lisäystä ja 6 poistoa
  1. 3 6
      umac/cmn_services/crypto/src/wlan_crypto_def_i.h

+ 3 - 6
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)