undefined4
RTMPSoftDecryptCCMP(undefined4 param_1,byte *param_2,int param_3,undefined1 *param_4,ushort *param_5
)
{
uint uVar1;
ushort uVar2;
bool bVar3;
int iVar4;
undefined4 uVar5;
uint uVar6;
undefined4 local_70;
undefined4 local_6c;
uint local_68;
undefined1 local_64;
undefined1 local_63;
undefined1 local_62;
undefined1 local_61;
undefined1 local_60;
undefined1 local_5f;
undefined1 auStack_5c [16];
undefined1 auStack_4c [36];
local_68 = (uint)*param_5;
local_70 = 0;
local_6c = 0;
if (*(char *)(param_3 + 0x41) == '\0') {
if (RTDebugLevel == 0) {
uVar5 = 0;
}
else {
printk("%s : The key is not available !\n","RTMPSoftDecryptCCMP");
uVar5 = 0;
}
}
else {
memset(auStack_4c,0,0x1e) //possible issue identified - semgrep
memset(auStack_5c,0,0xd) //possible issue identified - semgrep
uVar6 = (uint)param_2[1] & ((uint)param_2[1] << 0x1e) >> 0x1f;
local_64 = *param_4;
local_63 = param_4[1];
local_62 = param_4[4];
local_61 = param_4[5];
local_60 = param_4[6];
local_5f = param_4[7];
uVar2 = *param_5;
uVar1 = ((uint)*param_2 << 0x1c) >> 0x1e;
bVar3 = (byte)((*param_2 >> 4) - 8) < 4;
RTMPConstructCCMPAAD(param_2,uVar1 == 2,uVar6,bVar3,auStack_4c,&local_70);
RTMPConstructCCMPNonce(param_2,uVar6,bVar3,uVar1 == 0,&local_64,auStack_5c,&local_6c);
iVar4 = AES_CCM_Decrypt(param_4 + 8,uVar2 - 8,param_3,0x10,auStack_5c,local_6c,auStack_4c,
local_70,8,param_4,&local_68);
if (iVar4 == 0) {
uVar5 = 1;
*param_5 = (ushort)local_68;
}
else {
uVar5 = 0;
}
}
return uVar5;
}