undefined4
PeerAssocReqCmmSanity
(int param_1,char param_2,int param_3,int param_4,void *param_5,void *param_6,
void *param_7,void *param_8,byte *param_9,void *param_10,byte *param_11,
undefined1 *param_12,void *param_13,char *param_14,undefined1 *param_15,char *param_16,
uint *param_17,void *param_18,undefined1 *param_19,void *param_20)
{
byte bVar1;
char cVar2;
int iVar3;
int iVar4;
uint uVar5;
undefined4 uVar6;
char *pcVar7;
uint uVar8;
byte *__s1;
byte *__src;
uint uVar9;
undefined1 local_40;
undefined1 local_3f;
undefined1 local_3e;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
*param_9 = 0;
*param_11 = 0;
*param_14 = '\0';
*param_15 = 0;
*param_17 = 0;
*param_19 = 0;
local_40 = 0;
local_3c = 0x1f25000;
local_3f = 0xf;
local_3e = 0xac;
memcpy(param_5,(void *)(param_3 + 10),6) //possible issue identified - semgrep
iVar3 = MacTableLookup(param_1,param_5);
if (iVar3 == 0) {
uVar6 = 0;
}
else {
memmove(param_6,(void *)(param_3 + 0x18),2) //possible issue identified - semgrep
memmove(param_7,(void *)(param_3 + 0x1a),2) //possible issue identified - semgrep
__src = (byte *)(param_3 + 0x1c);
if (param_2 != '\0') {
memmove(param_8,__src,6) //possible issue identified - semgrep
__src = (byte *)(param_3 + 0x22);
}
uVar9 = 0;
local_30 = 0x968b8482;
for (; uVar8 = (uint)__src[1], __src + uVar8 + 1 < (byte *)(param_3 + param_4);
__src = __src + uVar8 + 2) {
bVar1 = *__src;
if (bVar1 == 0x30) {
LAB_00073f04:
__s1 = __src + 2;
iVar4 = memcmp(__s1,&WPS_OUI,4);
cVar2 = '\x01';
pcVar7 = param_16;
if (iVar4 != 0) {
iVar4 = memcmp(__s1,&BROADCOM_OUI,3);
if (((iVar4 == 0) && (__src[5] == 0x33)) && (__src[1] == 0x1e)) {
memmove(param_20,__src + 6,0x1a) //possible issue identified - semgrep
*param_19 = 0x1a;
}
iVar4 = memcmp(__s1,&RALINK_OUI,3);
if ((iVar4 == 0) && (__src[1] == 7)) {
if (__src[5] == 0) {
*param_17 = 0xf0000000;
}
else {
*param_17 = (uint)__src[5];
}
goto LAB_00074130;
}
iVar4 = memcmp(__s1,&WME_INFO_ELEM,6);
if (iVar4 == 0) {
if (__src[1] == 7) {
*param_15 = 1;
UAPSD_AssocParse(param_1,iVar3,__src + 8);
uVar8 = (uint)__src[1];
goto LAB_00074134;
}
bVar1 = *(byte *)(iVar3 + 0x31);
}
else {
bVar1 = *(byte *)(iVar3 + 0x31);
}
if (*(uint *)(param_1 + (uint)bVar1 * 0x1140 + 0x51dc) < 3) {
uVar8 = (uint)__src[1];
goto LAB_00074134;
}
iVar4 = memcmp(__s1,&local_3c,4);
if (iVar4 == 0) {
bVar1 = __src[1];
}
else {
iVar4 = memcmp(__src + 4,&local_40,3);
if (iVar4 != 0) {
if (2 < RTDebugLevel) {
pcVar7 = "Not RSN IE, maybe WMM IE!!!\n";
goto LAB_00074098;
}
uVar8 = (uint)__src[1];
goto LAB_00074134;
}
bVar1 = __src[1];
}
if (bVar1 < 0x12) {
*param_14 = '\0';
if (RTDebugLevel < 3) {
return 0;
}
printk("PeerAssocReqSanity - missing IE_WPA(%d)\n",__src[1]);
return 0;
}
hex_dump("Received RSNIE in Assoc-Req",__src,bVar1 + 2);
memmove(param_13,__src,__src[1] + 2) //possible issue identified - semgrep
cVar2 = __src[1] + 2 //possible issue identified - semgrep
pcVar7 = param_14;
}
*pcVar7 = cVar2;
LAB_00074130:
uVar8 = (uint)__src[1];
}
else if (bVar1 < 0x31) {
if (bVar1 == 1) {
if ((uVar8 - 1 & 0xff) < 0xc) {
memmove(param_12,__src + 2,uVar8) //possible issue identified - semgrep
if (2 < RTDebugLevel) {
printk("PeerAssocReqSanity - IE_SUPP_RATES., Len=%d. Rates[0]=%x\n",__src[1],*param_12
);
}
if (RTDebugLevel < 3) {
bVar1 = __src[1];
}
else {
printk("Rates[1]=%x %x %x %x %x %x %x\n",param_12[1],param_12[2],param_12[3],
param_12[4],param_12[5],param_12[6],param_12[7]);
bVar1 = __src[1];
}
uVar9 = uVar9 | 2;
LAB_00073e50:
*param_11 = bVar1;
}
else {
*param_11 = 8;
local_34 = 0x6c482412;
local_38 = local_30;
memmove(param_12,&local_38,8) //possible issue identified - semgrep
uVar9 = uVar9 | 2;
if (2 < RTDebugLevel) {
uVar8 = (uint)__src[1];
pcVar7 = "PeerAssocReqSanity - wrong IE_SUPP_RATES., Len=%d\n";
LAB_00073e18:
printk(pcVar7,uVar8);
uVar8 = (uint)__src[1];
goto LAB_00074134;
}
}
goto LAB_00074130;
}
if (bVar1 == 0) {
if ((uVar9 & 1) == 0) {
if (uVar8 < 0x21) {
memmove(param_10,__src + 2,uVar8) //possible issue identified - semgrep
uVar8 = (uint)__src[1];
*param_9 = __src[1];
uVar9 = uVar9 | 1;
if (2 < RTDebugLevel) {
pcVar7 = "PeerAssocReqSanity - SsidLen = %d \n";
goto LAB_00073e18;
}
goto LAB_00074130;
}
if (RTDebugLevel < 3) {
return 0;
}
pcVar7 = "PeerAssocReqSanity - wrong IE_SSID\n";
goto LAB_00074188;
}
uVar8 = (uint)__src[1];
}
else if (bVar1 == 0x2d) {
if (0x19 < uVar8) {
memmove(param_20,__src + 2,0x1a) //possible issue identified - semgrep
*param_19 = 0x1a;
if (1 < RTDebugLevel) {
pcVar7 = "PeerAssocReqSanity - IE_HT_CAP\n";
goto LAB_00074098;
}
goto LAB_00074130;
}
if (1 < RTDebugLevel) {
pcVar7 = "PeerAssocReqSanity - wrong IE_HT_CAP.eid_ptr->Len = %d\n";
goto LAB_00073e18;
}
uVar8 = (uint)__src[1];
}
else {
uVar8 = (uint)__src[1];
}
}
else if (bVar1 == 0x7f) {
if (uVar8 == 0) {
uVar8 = (uint)__src[1];
}
else {
memmove(param_18,__src + 2,1) //possible issue identified - semgrep
if (RTDebugLevel < 2) {
uVar8 = (uint)__src[1];
}
else {
pcVar7 = "PeerAssocReqSanity - IE_EXT_CAPABILITY!\n";
LAB_00074098:
printk(pcVar7);
uVar8 = (uint)__src[1];
}
}
}
else {
if (bVar1 == 0xdd) goto LAB_00073f04;
if (bVar1 == 0x32) {
uVar5 = (uint)*param_11;
if (0xc < uVar5 + uVar8) {
memmove(param_12 + uVar5,__src + 2,0xc - uVar5) //possible issue identified - semgrep
*param_11 = 0xc;
goto LAB_00074130;
}
memmove(param_12 + uVar5,__src + 2,uVar8) //possible issue identified - semgrep
bVar1 = *param_11 + __src[1];
goto LAB_00073e50;
}
uVar8 = (uint)__src[1];
}
LAB_00074134:
}
if (uVar9 == 3) {
uVar6 = 1;
if (2 < RTDebugLevel) {
printk("PeerAssocReqSanity - success\n");
uVar6 = 1;
}
}
else if (RTDebugLevel < 2) {
uVar6 = 0;
}
else {
pcVar7 = "PeerAssocReqSanity - missing mandatory field\n";
LAB_00074188:
printk(pcVar7);
uVar6 = 0;
}
}
return uVar6;
}