//
// CTLOG_new from 0xd82ea8 to 0xd82fcc (292 bytes)
//
// 2 xrefs:
// > CTLOG_new_from_base64 @ 0xe249f4
// > ??> @ 0x86838
//
// 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 CTLOG_new(__int64 a1, __int64 a2)
{
__int64 *v4; // x19
__int64 v5; // x0
__int64 v7; // [xsp+38h] [xbp+38h] BYREF
v4 = (__int64 *)CRYPTO_zalloc(48, "crypto/ct/ct_log.c", 237);
if ( !v4 )
{
ERR_put_error(50, 117, 65, "crypto/ct/ct_log.c", 240);
return nullptr;
}
v5 = CRYPTO_strdup(a2, "crypto/ct/ct_log.c", 244);
*v4 = v5;
if ( !v5 )
{
ERR_put_error(50, 117, 65, "crypto/ct/ct_log.c", 246);
goto LABEL_7;
}
v7 = 0;
if ( (int)i2d_PUBKEY(a1, &v7) <= 0 )
{
ERR_put_error(50, 125, 113, "crypto/ct/ct_log.c", 81);
CRYPTO_free(v7, "crypto/ct/ct_log.c", 88);
LABEL_7:
CTLOG_free(v4);
return nullptr;
}
SHA256(v7);
CRYPTO_free(v7, "crypto/ct/ct_log.c", 88);
v4[5] = a1;
return v4;
}