summaryrefslogtreecommitdiff
path: root/package/ramips/drivers/mt7620/patches/025-wpa-key-mismatch.patch
blob: 97bb4268bb76acb97566f07e0f89e187a3edc50f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Index: mt7620-p4rev-120998/src/ap/ap.c
===================================================================
--- mt7620-p4rev-120998.orig/src/ap/ap.c
+++ mt7620-p4rev-120998/src/ap/ap.c
@@ -306,6 +306,17 @@ VOID APStartUp(
 		else
 			pMbss->WpaMixPairCipher = MIX_CIPHER_NOTUSE;
 
+        if (pMbss->WepStatus == Ndis802_11Encryption2Enabled ||
+            pMbss->WepStatus == Ndis802_11Encryption3Enabled ||
+            pMbss->WepStatus == Ndis802_11Encryption4Enabled)
+        {
+            RT_CfgSetWPAPSKKey(pAd, pMbss->WPAKeyString,
+                               strlen(pMbss->WPAKeyString),
+                               (PUCHAR)pAd->ApCfg.MBSSID[apidx].Ssid,
+                               pAd->ApCfg.MBSSID[apidx].SsidLen,
+                               pAd->ApCfg.MBSSID[apidx].PMK);
+        }
+
 		/* Generate the corresponding RSNIE */
 		RTMPMakeRSNIE(pAd, pMbss->AuthMode, pMbss->WepStatus, apidx);
 
Index: mt7620-p4rev-120998/src/ap/ap_cfg.c
===================================================================
--- mt7620-p4rev-120998.orig/src/ap/ap_cfg.c
+++ mt7620-p4rev-120998/src/ap/ap_cfg.c
@@ -7157,6 +7157,9 @@ INT	Set_AP_WPAPSK_Proc(
 	if (retval == FALSE)
 		return FALSE;
 
+    /* Keep this key string */
+    strcpy(pAd->ApCfg.MBSSID[apidx].WPAKeyString, arg);
+
 #ifdef WSC_AP_SUPPORT
     NdisZeroMemory(pMBSSStruct->WscControl.WpaPsk, 64);
     pMBSSStruct->WscControl.WpaPskLen = 0;
Index: mt7620-p4rev-120998/src/common/cmm_profile.c
===================================================================
--- mt7620-p4rev-120998.orig/src/common/cmm_profile.c
+++ mt7620-p4rev-120998/src/common/cmm_profile.c
@@ -1710,6 +1710,9 @@ static int rtmp_parse_wpapsk_buffer_from
 	if (ret == FALSE)
 		return FALSE;
 
+    /* Keep this key string */
+    strcpy(pAd->ApCfg.MBSSID[i].WPAKeyString, tmpbuf);
+
 #ifdef WSC_AP_SUPPORT
 	NdisZeroMemory(pAd->ApCfg.MBSSID[i].WscControl.WpaPsk, 64);
 	pAd->ApCfg.MBSSID[i].WscControl.WpaPskLen = 0;
Index: mt7620-p4rev-120998/src/include/rtmp.h
===================================================================
--- mt7620-p4rev-120998.orig/src/include/rtmp.h
+++ mt7620-p4rev-120998/src/include/rtmp.h
@@ -1475,6 +1475,7 @@ typedef struct _MULTISSID_STRUCT {
 	UCHAR TimBitmaps[WLAN_MAX_NUM_OF_TIM];
 
 	/* WPA */
+	UCHAR WPAKeyString[65];
 	UCHAR GMK[32];
 	UCHAR PMK[32];
 	UCHAR GTK[32];