//
// DIST_POINT_set_dpname from 0x856b90 to 0x856c54 (196 bytes)
//
// 3 xrefs:
// > sub_848D54 @ 0x848ed0
// > sub_85AB54 @ 0x85af74
// > ??> @ 0x681ac
//
// 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 DIST_POINT_set_dpname(int a1, int a2)
{
int v3; // r6
_DWORD *v5; // r7
int v6; // r0
signed int v7; // r4
int v8; // r0
_BOOL4 v9; // r3
if ( !a1 || *(_DWORD *)a1 != 1 )
return 1;
v5 = *(_DWORD **)(a1 + 4);
v6 = X509_NAME_dup(a2);
*(_DWORD *)(a1 + 8) = v6;
if ( !v6 )
return 0;
v7 = 0;
while ( v7 < OPENSSL_sk_num((int)v5) )
{
v8 = OPENSSL_sk_value(v5, v7);
v9 = v7++ == 0;
v3 = X509_NAME_add_entry(*(int **)(a1 + 8), v8, -1, v9);
if ( !v3 )
{
X509_NAME_free(*(_DWORD **)(a1 + 8));
*(_DWORD *)(a1 + 8) = 0;
return v3;
}
}
if ( i2d_X509_NAME(*(size_t **)(a1 + 8), nullptr) >= 0 )
return 1;
v3 = 0;
X509_NAME_free(*(_DWORD **)(a1 + 8));
*(_DWORD *)(a1 + 8) = 0;
return v3;
}