//
// sub_1062BB4 from 0x1062bb4 to 0x1062cac (248 bytes)
//
// 1 xrefs:
// > ??> @ 0x1552500
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:16:51 +0000
//
__int64 __fastcall sub_1062BB4(__int64 a1, int a2, char *a3, __int64 a4)
{
__int64 v4; // x19
__int64 result; // x0
const char *default_cert_dir_env; // x0
char *default_cert_dir; // x1
v4 = *(_QWORD *)(a1 + 16);
if ( a2 != 2 )
return 0;
if ( a4 == 3 )
{
default_cert_dir_env = (const char *)X509_get_default_cert_dir_env();
default_cert_dir = getenv(default_cert_dir_env);
if ( (default_cert_dir || (default_cert_dir = (char *)X509_get_default_cert_dir()) != nullptr) && *default_cert_dir )
{
result = sub_1062954((unsigned int **)(v4 + 8), default_cert_dir, 1);
if ( (_DWORD)result )
return result;
}
else
{
ERR_put_error(11, 100, 113, (__int64)"crypto/x509/by_dir.c", 158);
}
ERR_put_error(11, 102, 103, (__int64)"crypto/x509/by_dir.c", 90);
return 0;
}
if ( a3 && *a3 )
return sub_1062954((unsigned int **)(v4 + 8), a3, a4);
ERR_put_error(11, 100, 113, (__int64)"crypto/x509/by_dir.c", 158);
return 0;
}