staging: vt6655: 64 bit fixes TKIP mic correct sizeof long.
Correct to endian base type __le32. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d0daef301d
commit
35a9562b02
|
@ -729,27 +729,27 @@ device_receive_frame(
|
||||||
// Soft MIC
|
// Soft MIC
|
||||||
if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) {
|
if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) {
|
||||||
if (bIsWEP) {
|
if (bIsWEP) {
|
||||||
unsigned long *pdwMIC_L;
|
__le32 *pdwMIC_L;
|
||||||
unsigned long *pdwMIC_R;
|
__le32 *pdwMIC_R;
|
||||||
unsigned long dwMIC_Priority;
|
__le32 dwMIC_Priority;
|
||||||
unsigned long dwMICKey0 = 0, dwMICKey1 = 0;
|
__le32 dwMICKey0 = 0, dwMICKey1 = 0;
|
||||||
u32 dwLocalMIC_L = 0;
|
u32 dwLocalMIC_L = 0;
|
||||||
u32 dwLocalMIC_R = 0;
|
u32 dwLocalMIC_R = 0;
|
||||||
viawget_wpa_header *wpahdr;
|
viawget_wpa_header *wpahdr;
|
||||||
|
|
||||||
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
|
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
|
||||||
dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[24]));
|
dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[24]));
|
||||||
dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[28]));
|
dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[28]));
|
||||||
} else {
|
} else {
|
||||||
if (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) {
|
if (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) {
|
||||||
dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[16]));
|
dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[16]));
|
||||||
dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[20]));
|
dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[20]));
|
||||||
} else if ((pKey->dwKeyIndex & BIT28) == 0) {
|
} else if ((pKey->dwKeyIndex & BIT28) == 0) {
|
||||||
dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[16]));
|
dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[16]));
|
||||||
dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[20]));
|
dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[20]));
|
||||||
} else {
|
} else {
|
||||||
dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[24]));
|
dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[24]));
|
||||||
dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[28]));
|
dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[28]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -763,14 +763,14 @@ device_receive_frame(
|
||||||
MIC_vGetMIC(&dwLocalMIC_L, &dwLocalMIC_R);
|
MIC_vGetMIC(&dwLocalMIC_L, &dwLocalMIC_R);
|
||||||
MIC_vUnInit();
|
MIC_vUnInit();
|
||||||
|
|
||||||
pdwMIC_L = (unsigned long *)(skb->data + 4 + FrameSize);
|
pdwMIC_L = (__le32 *)(skb->data + 4 + FrameSize);
|
||||||
pdwMIC_R = (unsigned long *)(skb->data + 4 + FrameSize + 4);
|
pdwMIC_R = (__le32 *)(skb->data + 4 + FrameSize + 4);
|
||||||
//DBG_PRN_GRP12(("RxL: %lx, RxR: %lx\n", *pdwMIC_L, *pdwMIC_R));
|
//DBG_PRN_GRP12(("RxL: %lx, RxR: %lx\n", *pdwMIC_L, *pdwMIC_R));
|
||||||
//DBG_PRN_GRP12(("LocalL: %lx, LocalR: %lx\n", dwLocalMIC_L, dwLocalMIC_R));
|
//DBG_PRN_GRP12(("LocalL: %lx, LocalR: %lx\n", dwLocalMIC_L, dwLocalMIC_R));
|
||||||
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwMICKey0= %lx,dwMICKey1= %lx \n", dwMICKey0, dwMICKey1);
|
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwMICKey0= %lx,dwMICKey1= %lx \n", dwMICKey0, dwMICKey1);
|
||||||
|
|
||||||
if ((cpu_to_le32(*pdwMIC_L) != dwLocalMIC_L) ||
|
if ((le32_to_cpu(*pdwMIC_L) != dwLocalMIC_L) ||
|
||||||
(cpu_to_le32(*pdwMIC_R) != dwLocalMIC_R) ||
|
(le32_to_cpu(*pdwMIC_R) != dwLocalMIC_R) ||
|
||||||
pDevice->bRxMICFail) {
|
pDevice->bRxMICFail) {
|
||||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MIC comparison is fail!\n");
|
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MIC comparison is fail!\n");
|
||||||
pDevice->bRxMICFail = false;
|
pDevice->bRxMICFail = false;
|
||||||
|
|
Loading…
Reference in New Issue