Staging: rt3070: WEP fixes
Propagate WEP fixes from rt28[67]0 to rt3070. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
a149b51d2d
commit
3cf830a1db
4 changed files with 4 additions and 36 deletions
|
@ -39,14 +39,10 @@
|
||||||
// WPA OUI
|
// WPA OUI
|
||||||
UCHAR OUI_WPA_NONE_AKM[4] = {0x00, 0x50, 0xF2, 0x00};
|
UCHAR OUI_WPA_NONE_AKM[4] = {0x00, 0x50, 0xF2, 0x00};
|
||||||
UCHAR OUI_WPA_VERSION[4] = {0x00, 0x50, 0xF2, 0x01};
|
UCHAR OUI_WPA_VERSION[4] = {0x00, 0x50, 0xF2, 0x01};
|
||||||
#ifndef RT30xx
|
|
||||||
UCHAR OUI_WPA_WEP40[4] = {0x00, 0x50, 0xF2, 0x01};
|
UCHAR OUI_WPA_WEP40[4] = {0x00, 0x50, 0xF2, 0x01};
|
||||||
#endif
|
|
||||||
UCHAR OUI_WPA_TKIP[4] = {0x00, 0x50, 0xF2, 0x02};
|
UCHAR OUI_WPA_TKIP[4] = {0x00, 0x50, 0xF2, 0x02};
|
||||||
UCHAR OUI_WPA_CCMP[4] = {0x00, 0x50, 0xF2, 0x04};
|
UCHAR OUI_WPA_CCMP[4] = {0x00, 0x50, 0xF2, 0x04};
|
||||||
#ifndef RT30xx
|
|
||||||
UCHAR OUI_WPA_WEP104[4] = {0x00, 0x50, 0xF2, 0x05};
|
UCHAR OUI_WPA_WEP104[4] = {0x00, 0x50, 0xF2, 0x05};
|
||||||
#endif
|
|
||||||
UCHAR OUI_WPA_8021X_AKM[4] = {0x00, 0x50, 0xF2, 0x01};
|
UCHAR OUI_WPA_8021X_AKM[4] = {0x00, 0x50, 0xF2, 0x01};
|
||||||
UCHAR OUI_WPA_PSK_AKM[4] = {0x00, 0x50, 0xF2, 0x02};
|
UCHAR OUI_WPA_PSK_AKM[4] = {0x00, 0x50, 0xF2, 0x02};
|
||||||
// WPA2 OUI
|
// WPA2 OUI
|
||||||
|
@ -55,9 +51,7 @@ UCHAR OUI_WPA2_TKIP[4] = {0x00, 0x0F, 0xAC, 0x02};
|
||||||
UCHAR OUI_WPA2_CCMP[4] = {0x00, 0x0F, 0xAC, 0x04};
|
UCHAR OUI_WPA2_CCMP[4] = {0x00, 0x0F, 0xAC, 0x04};
|
||||||
UCHAR OUI_WPA2_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x01};
|
UCHAR OUI_WPA2_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x01};
|
||||||
UCHAR OUI_WPA2_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x02};
|
UCHAR OUI_WPA2_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x02};
|
||||||
#ifndef RT30xx
|
|
||||||
UCHAR OUI_WPA2_WEP104[4] = {0x00, 0x0F, 0xAC, 0x05};
|
UCHAR OUI_WPA2_WEP104[4] = {0x00, 0x0F, 0xAC, 0x05};
|
||||||
#endif
|
|
||||||
// MSA OUI
|
// MSA OUI
|
||||||
UCHAR OUI_MSA_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x05}; // Not yet final - IEEE 802.11s-D1.06
|
UCHAR OUI_MSA_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x05}; // Not yet final - IEEE 802.11s-D1.06
|
||||||
UCHAR OUI_MSA_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x06}; // Not yet final - IEEE 802.11s-D1.06
|
UCHAR OUI_MSA_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x06}; // Not yet final - IEEE 802.11s-D1.06
|
||||||
|
@ -376,7 +370,6 @@ static VOID RTMPInsertRsnIeCipher(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef RT30xx
|
|
||||||
if ((pAd->OpMode == OPMODE_STA) &&
|
if ((pAd->OpMode == OPMODE_STA) &&
|
||||||
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
|
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
|
||||||
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
|
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
|
||||||
|
@ -392,7 +385,7 @@ static VOID RTMPInsertRsnIeCipher(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
// swap for big-endian platform
|
// swap for big-endian platform
|
||||||
pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
|
pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
|
||||||
pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount);
|
pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount);
|
||||||
|
@ -453,7 +446,6 @@ static VOID RTMPInsertRsnIeCipher(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef RT30xx
|
|
||||||
if ((pAd->OpMode == OPMODE_STA) &&
|
if ((pAd->OpMode == OPMODE_STA) &&
|
||||||
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
|
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
|
||||||
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
|
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
|
||||||
|
@ -469,7 +461,7 @@ static VOID RTMPInsertRsnIeCipher(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
// swap for big-endian platform
|
// swap for big-endian platform
|
||||||
pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
|
pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
|
||||||
pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount);
|
pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount);
|
||||||
|
|
|
@ -3912,11 +3912,8 @@ VOID BssTableSsidSort(
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// check group cipher
|
// check group cipher
|
||||||
if (
|
if (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled &&
|
||||||
#ifndef RT30xx
|
|
||||||
pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled &&
|
|
||||||
pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled &&
|
pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled &&
|
||||||
#endif
|
|
||||||
pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher)
|
pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -3936,11 +3933,8 @@ VOID BssTableSsidSort(
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// check group cipher
|
// check group cipher
|
||||||
if (
|
if (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled &&
|
||||||
#ifndef RT30xx
|
|
||||||
pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled &&
|
|
||||||
pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled &&
|
pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled &&
|
||||||
#endif
|
|
||||||
pAd->StaCfg.WepStatus < pInBss->WPA2.GroupCipher)
|
pAd->StaCfg.WepStatus < pInBss->WPA2.GroupCipher)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -4219,16 +4213,10 @@ VOID BssCipherParse(
|
||||||
switch (*pTmp)
|
switch (*pTmp)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
#ifndef RT30xx
|
|
||||||
pBss->WPA.GroupCipher = Ndis802_11GroupWEP40Enabled;
|
pBss->WPA.GroupCipher = Ndis802_11GroupWEP40Enabled;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
pBss->WPA.GroupCipher = Ndis802_11GroupWEP104Enabled;
|
pBss->WPA.GroupCipher = Ndis802_11GroupWEP104Enabled;
|
||||||
#endif
|
|
||||||
#ifdef RT30xx
|
|
||||||
case 5: // Although WEP is not allowed in WPA related auth mode, we parse it anyway
|
|
||||||
pBss->WPA.GroupCipher = Ndis802_11Encryption1Enabled;
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
pBss->WPA.GroupCipher = Ndis802_11Encryption2Enabled;
|
pBss->WPA.GroupCipher = Ndis802_11Encryption2Enabled;
|
||||||
|
@ -4344,16 +4332,10 @@ VOID BssCipherParse(
|
||||||
switch (pCipher->Type)
|
switch (pCipher->Type)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
#ifndef RT30xx
|
|
||||||
pBss->WPA2.GroupCipher = Ndis802_11GroupWEP40Enabled;
|
pBss->WPA2.GroupCipher = Ndis802_11GroupWEP40Enabled;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
pBss->WPA2.GroupCipher = Ndis802_11GroupWEP104Enabled;
|
pBss->WPA2.GroupCipher = Ndis802_11GroupWEP104Enabled;
|
||||||
#endif
|
|
||||||
#ifdef RT30xx
|
|
||||||
case 5: // Although WEP is not allowed in WPA related auth mode, we parse it anyway
|
|
||||||
pBss->WPA2.GroupCipher = Ndis802_11Encryption1Enabled;
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
pBss->WPA2.GroupCipher = Ndis802_11Encryption2Enabled;
|
pBss->WPA2.GroupCipher = Ndis802_11Encryption2Enabled;
|
||||||
|
|
|
@ -1384,12 +1384,10 @@ VOID WpaGroupMsg1Action(
|
||||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP;
|
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP;
|
||||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
|
else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
|
||||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES;
|
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES;
|
||||||
#ifndef RT30xx
|
|
||||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
|
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
|
||||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64;
|
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64;
|
||||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
|
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
|
||||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128;
|
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128;
|
||||||
#endif
|
|
||||||
|
|
||||||
//hex_dump("Group Key :", pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, LEN_TKIP_EK);
|
//hex_dump("Group Key :", pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, LEN_TKIP_EK);
|
||||||
}
|
}
|
||||||
|
@ -1797,12 +1795,10 @@ BOOLEAN ParseKeyData(
|
||||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP;
|
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP;
|
||||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
|
else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
|
||||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES;
|
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES;
|
||||||
#ifndef RT30xx
|
|
||||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
|
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
|
||||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64;
|
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64;
|
||||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
|
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
|
||||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128;
|
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128;
|
||||||
#endif
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
|
@ -2216,7 +2216,6 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
|
||||||
|
|
||||||
NdisZeroMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, 16);
|
NdisZeroMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, 16);
|
||||||
NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, ext->key, ext->key_len);
|
NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, ext->key, ext->key_len);
|
||||||
#ifndef RT30xx
|
|
||||||
if (pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled ||
|
if (pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled ||
|
||||||
pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
|
pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
|
||||||
{
|
{
|
||||||
|
@ -2231,7 +2230,6 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
|
||||||
// Indicate Connected for GUI
|
// Indicate Connected for GUI
|
||||||
pAdapter->IndicateMediaState = NdisMediaStateConnected;
|
pAdapter->IndicateMediaState = NdisMediaStateConnected;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case IW_ENCODE_ALG_TKIP:
|
case IW_ENCODE_ALG_TKIP:
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_TKIP - keyIdx = %d, ext->key_len = %d\n", __func__, keyIdx, ext->key_len));
|
DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_TKIP - keyIdx = %d, ext->key_len = %d\n", __func__, keyIdx, ext->key_len));
|
||||||
|
|
Loading…
Add table
Reference in a new issue