From e02bc940e961df8fb62e59c7597af48ab28b26bf Mon Sep 17 00:00:00 2001
From: Srinivas Girigowda <sgirigow@codeaurora.org>
Date: Sat, 28 Oct 2017 20:59:41 -0700
Subject: [PATCH] qcacld-2.0: Fix incorrect frame length of encrypted auth
 frame

STA is not able to connect to AP configured with WEP shared
due to incorrect frame length of encrypted auth frame.

Fix this by using the correct frame length.

Bug: 67754642
Change-Id: I4066139487ed56d4bccf46c03f9113505d9e8927
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
---
 .../staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSecurityUtils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSecurityUtils.c b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSecurityUtils.c
index 05c8f5579bf8..4849eb23c661 100644
--- a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSecurityUtils.c
+++ b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSecurityUtils.c
@@ -607,9 +607,9 @@ limEncryptAuthFrame(tpAniSirGlobal pMac, tANI_U8 keyId, tANI_U8 *pKey, tANI_U8 *
     vos_mem_copy((tANI_U8 *) &seed[3], pKey, keyLength - 3);
 
     // Compute CRC-32 and place them in last 4 bytes of plain text
-    limComputeCrc32(icv, pPlainText, sizeof(tSirMacAuthFrameBody));
+    limComputeCrc32(icv, pPlainText, framelen);
 
-    vos_mem_copy( pPlainText + sizeof(tSirMacAuthFrameBody),
+    vos_mem_copy( pPlainText + framelen,
                   icv, SIR_MAC_WEP_ICV_LENGTH);
 
     // Run RC4 on plain text with the seed
-- 
GitLab