void * KDF(void *in,size_t inlen,void *out,size_t *outlen)
{
void *pvVar1;
int iVar2;
uint uVar3;
int iVar4;
void *in_stack_00000010;
size_t in_stack_00000014;
int in_stack_00000018;
ushort in_stack_0000001c;
char *local_30 [3];
os_alloc_mem(0,local_30,0x400);
if (local_30[0] == (char *)0x0) {
if (RTDebugLevel == 0) {
pvVar1 = (void *)0x0;
}
else {
pvVar1 = (void *)printk("!!!KDF: no memory!!!\n");
}
}
else {
memset(local_30[0],0,0x400) //possible issue identified - semgrep
*local_30[0] = '\x01';
local_30[0][1] = '\0';
memmove(local_30[0] + 2,out,(size_t)outlen) //possible issue identified - semgrep
memmove(local_30[0] + (int)outlen + 2,in_stack_00000010,in_stack_00000014) //possible issue identified - semgrep
iVar4 = in_stack_00000014 + (int)outlen + 2 //possible issue identified - semgrep
iVar2 = (uint)in_stack_0000001c * 8;
local_30[0][iVar4] = (char)iVar2;
local_30[0][iVar4 + 1] = (char)((uint)iVar2 >> 8);
for (uVar3 = 1; uVar3 <= iVar2 + 0xffU >> 8; uVar3 = uVar3 + 1 & 0xffff) {
RT_HMAC_SHA256(in,inlen,local_30[0],iVar4 + 2,in_stack_00000018,0x20);
*local_30[0] = *local_30[0] + '\x01';
in_stack_00000018 = in_stack_00000018 + 0x20;
}
pvVar1 = (void *)os_free_mem(0,local_30[0]);
}
return pvVar1;
}