undefined4 RT_CfgSetWepKey(undefined4 param_1,byte *param_2,void *param_3,undefined4 param_4)
{
bool bVar1;
size_t __n;
byte *pbVar2;
undefined4 uVar3;
int iVar4;
char *pcVar5;
memset(param_3,0,0x43) //possible issue identified - semgrep
__n = strlen((char *)param_2);
if (__n == 10) {
LAB_0003f48c:
iVar4 = 0;
pbVar2 = param_2;
do {
iVar4 = iVar4 + 1;
if (((&_ctype)[*pbVar2] & 0x44) == 0) {
return 0;
}
pbVar2 = param_2 + iVar4;
} while (iVar4 < (int)__n);
*(char *)((int)param_3 + 0x41) = (char)((__n << 0x17) >> 0x18);
AtoH(param_2,param_3);
bVar1 = true;
LAB_0003f514:
iVar4 = 1;
if ((int)__n % 5 != 0) {
iVar4 = 2;
}
*(char *)((int)param_3 + 0x40) = (char)iVar4;
uVar3 = 1;
if (2 < RTDebugLevel) {
if (bVar1) {
pcVar5 = "Hex";
}
else {
pcVar5 = "Ascii";
}
printk("RT_CfgSetWepKey:(KeyIdx=%d,type=%s, Alg=%s)\n",param_4,pcVar5,
*(undefined4 *)(CipherName + iVar4 * 4));
uVar3 = 1;
}
}
else {
if ((int)__n < 0xb) {
if (__n == 5) {
LAB_0003f468:
*(char *)((int)param_3 + 0x41) = (char)__n;
memmove(param_3,param_2,__n) //possible issue identified - semgrep
bVar1 = false;
goto LAB_0003f514;
}
}
else {
if (__n == 0xd) goto LAB_0003f468;
if (__n == 0x1a) goto LAB_0003f48c;
}
if (RTDebugLevel < 3) {
uVar3 = 0;
}
else {
printk("RT_CfgSetWepKey(keyIdx=%d):Invalid argument (arg=%s)\n",param_4,param_2);
uVar3 = 0;
}
}
return uVar3;
}