Browse Source

qcacmn: Fix for wapi ping with x86 sta

The change adds support to fix ping issue for wapi with x86 sta
We add the txiv field to wlan_crypto_req_key structure, this will
be filled for wapi security only

Change-Id: Ic80ecf3aaf4440ba5f56bb9c243bfbca5be574e3
CRs-Fixed: 2098697
Rohan Dutta 7 years ago
parent
commit
bec3ab7f30

+ 4 - 0
umac/cmn_services/crypto/inc/wlan_crypto_global_def.h

@@ -243,6 +243,10 @@ struct wlan_crypto_req_key {
 	uint64_t   keytsc;
 	/* key value */
 	uint8_t    keydata[WLAN_CRYPTO_KEYBUF_SIZE + WLAN_CRYPTO_MICBUF_SIZE];
+	/* wapi key tx iv */
+	uint8_t    txiv[WLAN_CRYPTO_WAPI_IV_SIZE];
+	/* wapi key rx iv */
+	uint8_t    recviv[WLAN_CRYPTO_WAPI_IV_SIZE];
 };
 
 /**

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

@@ -633,6 +633,14 @@ QDF_STATUS wlan_crypto_getkey(struct wlan_objmgr_vdev *vdev,
 			return QDF_STATUS_SUCCESS;
 
 		req_key->type = cipher_table->cipher;
+		if (req_key->type == WLAN_CRYPTO_CIPHER_WAPI_SMS4) {
+			qdf_mem_copy((uint8_t *)(&req_key->txiv),
+					(uint8_t *)(key->txiv),
+					sizeof(req_key->txiv));
+			qdf_mem_copy((uint8_t *)(&req_key->recviv),
+					(uint8_t *)(key->recviv),
+					sizeof(req_key->recviv));
+		}
 	}
 
 	return QDF_STATUS_SUCCESS;