//
// X509_VERIFY_PARAM_set1_policies from 0x846974 to 0x846a34 (192 bytes)
//
// 3 xrefs:
// > X509_VERIFY_PARAM_inherit @ 0x8470c4
// > X509_VERIFY_PARAM_inherit @ 0x84712c
// > ??> @ 0x679cc
//
// 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 X509_VERIFY_PARAM_set1_policies(int a1, _DWORD *a2)
{
_DWORD *v4; // r0
signed int v5; // r4
const char **v6; // r0
const char **v7; // r6
int v8; // r0
unsigned int v9; // r1
if ( !a1 )
return 0;
OPENSSL_sk_pop_free(*(_DWORD *)(a1 + 32), (void (__fastcall *)(int))ASN1_OBJECT_free);
if ( !a2 )
{
*(_DWORD *)(a1 + 32) = 0;
return 1;
}
v4 = OPENSSL_sk_new_null();
*(_DWORD *)(a1 + 32) = v4;
if ( !v4 )
return 0;
v5 = 0;
do
{
v8 = OPENSSL_sk_num((int)a2);
v9 = v5;
if ( v5++ >= v8 )
{
*(_DWORD *)(a1 + 12) |= 0x80u;
return 1;
}
v6 = (const char **)OPENSSL_sk_value(a2, v9);
v7 = OBJ_dup(v6);
if ( !v7 )
return 0;
}
while ( OPENSSL_sk_push(*(int **)(a1 + 32), (int)v7) );
ASN1_OBJECT_free(v7);
return 0;
}