Ver código fonte

qcacmn: Allow FILS decap for (Re)Assoc frame

Allow FILS decap for (Re)Association request/response frame
by returning keyid as 0.

Change-Id: Icdf6d325eeccda36eeaf5a5635fcf9cf361d1028
CRs-Fixed: 2217523
Subrat Mishra 7 anos atrás
pai
commit
4493d2d605

+ 1 - 0
umac/cmn_services/crypto/src/wlan_crypto_fils.c

@@ -432,6 +432,7 @@ void wlan_crypto_fils_delkey(struct wlan_objmgr_peer *peer)
 	if (key) {
 		qdf_mem_free(key->private);
 		key->private = NULL;
+		key->valid = 0;
 	}
 }
 #else

+ 12 - 0
umac/cmn_services/crypto/src/wlan_crypto_global_api.c

@@ -3198,6 +3198,18 @@ uint16_t wlan_crypto_get_keyid(uint8_t *data, int hdrlen)
 {
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)data;
 	uint8_t *iv;
+	uint8_t stype = WLAN_FC0_GET_STYPE(hdr->frame_control[0]);
+
+	/*
+	 * In FILS SK (Re)Association request/response frame has
+	 * to be decrypted
+	 */
+	if ((stype == WLAN_FC0_STYPE_ASSOC_REQ) ||
+	    (stype == WLAN_FC0_STYPE_REASSOC_REQ) ||
+	    (stype == WLAN_FC0_STYPE_ASSOC_RESP) ||
+	    (stype == WLAN_FC0_STYPE_REASSOC_RESP)) {
+		return 0;
+	}
 
 	if (hdr->frame_control[1] & WLAN_FC1_ISWEP) {
 		iv = data + hdrlen;