//
// sub_854684 from 0x854684 to 0x8548e0 (604 bytes)
//
// 2 xrefs:
// > sub_854924 @ 0x8549c0
// > X509_POLICY_NODE_print @ 0x8557a8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_854684(int a1, _DWORD *a2, int a3)
{
signed int v6; // r7
int result; // r0
int *v8; // r5
char *v9; // r0
const char *v10; // r4
int v11; // r3
int *v12; // r5
signed int v13; // r4
void *v14; // r9
int v15; // r0
bool v16; // zf
int v17; // r9
int v18; // r3
int v19; // r2
int v20; // r3
int v21; // [sp+10h] [bp-24h]
int v22; // [sp+14h] [bp-20h]
v6 = 0;
result = OPENSSL_sk_num((int)a2);
if ( result > 0 )
{
do
{
v8 = (int *)OPENSSL_sk_value(a2, v6);
v9 = OBJ_obj2nid(*v8);
if ( v9 == (char *)&dword_A4 )
{
BIO_printf(a1, "%*sCPS: %s\n", a3, &byte_9B1912, *(_DWORD *)(v8[1] + 8));
}
else if ( v9 == (_BYTE *)&dword_A4 + 1 )
{
v10 = &byte_9B1912;
BIO_printf(a1, "%*sUser Notice:\n", a3, &byte_9B1912);
v11 = v8[1];
v12 = *(int **)v11;
v22 = v11;
v21 = a3 + 2;
if ( *(_DWORD *)v11 )
{
BIO_printf(a1, "%*sOrganization: %s\n", a3 + 2, &byte_9B1912, *(const char **)(*v12 + 8));
if ( OPENSSL_sk_num(v12[1]) > 1 )
v10 = "s";
BIO_printf(a1, "%*sNumber%s: ", v21, &byte_9B1912, v10);
v13 = 0;
while ( v13 < OPENSSL_sk_num(v12[1]) )
{
v15 = OPENSSL_sk_value((_DWORD *)v12[1], v13);
v16 = v13++ == 0;
v17 = v15;
if ( !v16 )
BIO_puts(a1, (int)", ");
v14 = (void *)i2s_ASN1_INTEGER(0, v17);
BIO_puts(a1, (int)v14);
CRYPTO_free(v14, (int)"crypto/x509v3/v3_cpols.c", 418);
}
BIO_puts(a1, (int)"\n");
v11 = v22;
}
v18 = *(_DWORD *)(v11 + 4);
if ( v18 )
BIO_printf(a1, "%*sExplicit Text: %s\n", v21, &byte_9B1912, *(const char **)(v18 + 8));
}
else
{
BIO_printf(a1, "%*sUnknown Qualifier: ", a3 + 2, &byte_9B1912);
i2a_ASN1_OBJECT(a1, *v8, v19, v20);
BIO_puts(a1, (int)"\n");
}
result = OPENSSL_sk_num((int)a2);
++v6;
}
while ( v6 < result );
}
return result;
}