//
// o2i_SCT_LIST from 0x9f08f4 to 0x9f0b28 (564 bytes)
//
// 3 xrefs:
// > SSL_get0_peer_scts @ 0x9af22c
// > d2i_SCT_LIST @ 0x9f0d8c
// > ??> @ 0x7608c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:07:29 +0000
//
int __fastcall o2i_SCT_LIST(int *a1, unsigned __int8 **a2, int a3)
{
unsigned int v3; // r4
int v6; // r2
int v8; // r6
int v9; // r0
unsigned int v10; // lr
unsigned int v11; // r3
_BOOL4 v12; // r2
int v13; // r0
_BOOL4 v14; // r1
unsigned int v15; // r4
int v16; // r8
v3 = a3 - 2;
if ( (unsigned int)(a3 - 2) > 0xFFFD )
{
ERR_put_error(50, 111, 105, "crypto/ct/ct_oct.c", 269);
return 0;
}
else
{
v6 = (*a2)[1] | (**a2 << 8);
*a2 += 2;
if ( v3 == v6 )
{
if ( a1 && (v8 = *a1) != 0 )
{
while ( 1 )
{
v9 = OPENSSL_sk_pop(v8);
if ( !v9 )
break;
SCT_free(v9);
}
if ( !v3 )
goto LABEL_27;
}
else
{
v8 = OPENSSL_sk_new_null(a1);
if ( !v8 )
return 0;
if ( !v3 )
{
LABEL_26:
if ( !a1 )
return v8;
LABEL_27:
if ( !*a1 )
*a1 = v8;
return v8;
}
}
if ( v3 <= 1 )
{
LABEL_30:
ERR_put_error(50, 111, 105, "crypto/ct/ct_oct.c", 296);
}
else
{
v10 = a3 - 4;
v11 = (*a2)[1] | (**a2 << 8);
v12 = v11 == 0;
if ( v11 > a3 - 4 )
v12 = 1;
*a2 += 2;
if ( v12 )
{
LABEL_31:
ERR_put_error(50, 111, 105, "crypto/ct/ct_oct.c", 303);
}
else
{
while ( 1 )
{
v15 = v10 - v11;
v16 = o2i_SCT(nullptr, a2, v11);
if ( !v16 )
break;
v13 = OPENSSL_sk_push(v8, v16);
v10 = v15 - 2;
if ( !v13 )
{
SCT_free(v16);
break;
}
if ( !v15 )
goto LABEL_26;
if ( v15 == 1 )
goto LABEL_30;
v11 = (*a2)[1] | (**a2 << 8);
v14 = v11 == 0;
if ( v11 > v10 )
v14 = 1;
*a2 += 2;
if ( v14 )
goto LABEL_31;
}
}
}
if ( !a1 || !*a1 )
SCT_LIST_free(v8);
return 0;
}
ERR_put_error(50, 111, 105, "crypto/ct/ct_oct.c", 275);
return 0;
}
}