//
// sub_7DAFE0 from 0x7dafe0 to 0x7db144 (356 bytes)
//
// 3 xrefs:
// > CTLOG_STORE_load_file @ 0x7db29c
// > CTLOG_STORE_load_file @ 0x7db2ac
// > ??> @ 0x7db3a0
//
// 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_7DAFE0(int a1, int a2, int a3)
{
int v4; // r0
int v5; // r6
int v6; // r5
char *string; // r1
int v8; // r5
_DWORD *v10; // [sp+Ch] [bp-4h] BYREF
v10 = nullptr;
if ( !a1 )
return 1;
v4 = CRYPTO_strndup(a1, a2, "crypto/ct/ct_log.c", 167);
v5 = v4;
if ( !v4 )
{
LABEL_14:
CTLOG_free(v10);
ERR_put_error(50, 130, 65, "crypto/ct/ct_log.c", 191);
return -1;
}
v6 = *(_DWORD *)(a3 + 4);
if ( !NCONF_get_string(v6, v4, "description") )
{
ERR_put_error(50, 119, 111, "crypto/ct/ct_log.c", 125);
LABEL_11:
CRYPTO_free(v5, "crypto/ct/ct_log.c", 172);
goto LABEL_12;
}
string = (char *)NCONF_get_string(v6, v5, "key");
if ( !string )
{
ERR_put_error(50, 119, 112, "crypto/ct/ct_log.c", 131);
goto LABEL_11;
}
v8 = CTLOG_new_from_base64((int)&v10, string);
CRYPTO_free(v5, "crypto/ct/ct_log.c", 172);
if ( v8 < 0 )
return v8;
if ( v8 )
{
if ( OPENSSL_sk_push(**(_DWORD **)a3, v10) )
return 1;
goto LABEL_14;
}
LABEL_12:
++*(_DWORD *)(a3 + 8);
return 1;
}