//
// SSL_SESSION_new from 0x79d548 to 0x79d640 (248 bytes)
//
// 4 xrefs:
// > ssl_get_new_session @ 0x79da4c
// > d2i_SSL_SESSION @ 0x7b94bc
// > d2i_SSL_SESSION @ 0x7b94e0
// > ??> @ 0x5ca0c
//
// 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
//
_DWORD *SSL_SESSION_new()
{
_DWORD *v0; // r0
_DWORD *v1; // r4
int v2; // r5
v0 = (_DWORD *)CRYPTO_zalloc(240, "ssl/ssl_sess.c", 84);
v1 = v0;
if ( v0 )
{
v0[38] = 1;
v0[39] = 1;
v0[40] = 304;
v0[41] = time(nullptr);
v2 = CRYPTO_THREAD_lock_new();
v1[59] = v2;
if ( v2 )
{
if ( CRYPTO_new_ex_data(2, v1, v1 + 46) )
{
return v1;
}
else
{
CRYPTO_THREAD_lock_free(v1[59]);
CRYPTO_free(v1, "ssl/ssl_sess.c", 103);
return nullptr;
}
}
else
{
ERR_put_error(20, 189, 65, "ssl/ssl_sess.c", 96);
CRYPTO_free(v1, "ssl/ssl_sess.c", 97);
return nullptr;
}
}
else
{
ERR_put_error(20, 189, 65, "ssl/ssl_sess.c", 86);
return nullptr;
}
}