//
// sub_A65F2C from 0xa65f2c to 0xa6611c (496 bytes)
//
// 1 xrefs:
// > ??> @ 0xd181d0
//
// 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:08:36 +0000
//
int *__fastcall sub_A65F2C(int a1, _DWORD *a2, _DWORD *a3)
{
int *v6; // r7
signed int i; // r4
_DWORD *v8; // r1
int v9; // r5
const char *v10; // r0
int v11; // r0
void **v12; // r5
signed int v13; // r11
int v14; // r0
int v15; // r0
unsigned int v16; // r1
v6 = OPENSSL_sk_new_null();
if ( v6 )
{
for ( i = 0; ; ++i )
{
if ( i >= OPENSSL_sk_num((int)a3) )
return v6;
v9 = OPENSSL_sk_value(a3, i);
if ( !name_cmp(*(_DWORD *)(v9 + 4), "issuer")
&& (v10 = *(const char **)(v9 + 8)) != nullptr
&& !strcmp(v10, "copy") )
{
if ( !a2 )
goto LABEL_20;
if ( *a2 != 1 )
{
v11 = a2[1];
if ( !v11 )
{
LABEL_20:
ERR_put_error(34, 123, 127, (int)"crypto/x509v3/v3_alt.c", 233);
LABEL_21:
OPENSSL_sk_pop_free((int)v6, (void (__fastcall *)(int))GENERAL_NAME_free);
return nullptr;
}
if ( X509_get_ext_by_NID(v11) >= 0 )
{
if ( X509_get_ext(a2[1]) && (v12 = (void **)X509V3_EXT_d2i()) != nullptr )
{
v13 = 0;
do
{
v15 = OPENSSL_sk_num((int)v12);
v16 = v13;
if ( v13++ >= v15 )
{
OPENSSL_sk_free(v12);
goto LABEL_5;
}
v14 = OPENSSL_sk_value(v12, v16);
}
while ( OPENSSL_sk_push(v6, v14) );
ERR_put_error(34, 123, 65, (int)"crypto/x509v3/v3_alt.c", 248);
}
else
{
ERR_put_error(34, 123, 126, (int)"crypto/x509v3/v3_alt.c", 241);
}
goto LABEL_21;
}
}
}
else
{
v8 = v2i_GENERAL_NAME(a1, (int)a2, v9);
if ( !v8 )
goto LABEL_21;
OPENSSL_sk_push(v6, (int)v8);
}
LABEL_5:
;
}
}
ERR_put_error(34, 153, 65, (int)"crypto/x509v3/v3_alt.c", 199);
return v6;
}