//
// SSL_add_dir_cert_subjects_to_stack from 0xd3b178 to 0xd3b2dc (356 bytes)
//
// 2 xrefs:
// > sub_D61CA0 @ 0xd61cc0
// > ??> @ 0x5c1c0
//
// 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
//
__int64 __fastcall SSL_add_dir_cert_subjects_to_stack(__int64 a1, const char *a2)
{
size_t v4; // x19
const char *v5; // x20
_DWORD *v6; // x0
unsigned int v7; // w19
__int64 v9; // [xsp+58h] [xbp+58h] BYREF
_BYTE v10[1024]; // [xsp+60h] [xbp+60h] BYREF
v9 = 0;
while ( 1 )
{
v5 = (const char *)OPENSSL_DIR_read(&v9, a2);
if ( !v5 )
break;
v4 = strlen(a2);
if ( v4 + strlen(v5) + 2 > 0x400 )
{
ERR_put_error(20, 215, 270, "ssl/ssl_cert.c", 713);
LABEL_9:
v7 = 0;
goto LABEL_10;
}
if ( (unsigned int)BIO_snprintf(v10, 1024, "%s/%s", a2, v5) - 1 > 0x3FE
|| !(unsigned int)SSL_add_file_cert_subjects_to_stack(a1, (__int64)v10) )
{
goto LABEL_9;
}
}
v6 = (_DWORD *)__errno();
v7 = 1;
if ( *v6 )
{
v7 = 0;
ERR_put_error(2, 10, (unsigned int)*v6, "ssl/ssl_cert.c", 728);
ERR_add_error_data(3, "OPENSSL_DIR_read(&ctx, '", a2);
ERR_put_error(20, 215, 2, "ssl/ssl_cert.c", 730);
}
LABEL_10:
if ( v9 )
OPENSSL_DIR_end(&v9);
return v7;
}