qcacld-3.0: Prepare non-zero IV for auth seq 3 frames

If the initialization vector is zero, some IOT APs unable to decrypt
auth sequence 3 frame, which leads to disconnection. As IV is first 3
bytes of uninitialized "seed local variable", there are the changes of
having IV value as 0.
Hence host prepares non-zero initialization vector to encrypt auth
sequence 3 frame.

Change-Id: Ifc24ccc6c669bac3fc0389670580f6a9ec2672a0
CRs-Fixed: 2750718
This commit is contained in:
Abhishek Ambure 2020-08-19 20:06:45 +05:30 • committed by snandini
commit 3edba3ed86

View file

@ -517,6 +517,13 @@ lim_encrypt_auth_frame(struct mac_context *mac, uint8_t keyId, uint8_t *pKey,
SIR_MAC_AUTH_FRAME_INFO_LEN + SIR_MAC_CHALLENGE_ID_LEN;
keyLength += 3;
/*
* Make sure that IV is non-zero, because few IOT APs fails to decrypt
* auth sequence 3 encrypted frames if initialization vector value is 0
*/
while (!(*(uint32_t *)seed))
qdf_get_random_bytes(seed, SIR_MAC_WEP_IV_LENGTH);
/* Bytes 3-7 of seed is key */
qdf_mem_copy((uint8_t *) &seed[3], pKey, keyLength - 3);