//
// SSL_dane_enable from 0x797a2c to 0x797b8c (352 bytes)
//
// 1 xrefs:
// > ??> @ 0x5bd2c
//
// 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 SSL_dane_enable(int *a1, char *a2)
{
int v2; // r2
int v3; // r4
int v7; // r0
int v8; // r0
v2 = a1[69];
v3 = *(unsigned __int8 *)(v2 + 492);
if ( *(_BYTE *)(v2 + 492) )
{
if ( a1[33] )
{
ERR_put_error(20, 395, 172, "ssl/ssl_lib.c", 833);
return 0;
}
else if ( a1[87] || SSL_ctrl((int)a1, 55, 0, a2) )
{
v7 = X509_VERIFY_PARAM_set1_host(a1[31], a2);
if ( v7 )
{
a1[32] = a1[69] + 484;
a1[38] = -1;
a1[39] = -1;
v8 = OPENSSL_sk_new_null(v7);
a1[33] = v8;
if ( v8 )
{
return 1;
}
else
{
ERR_put_error(20, 395, 65, "ssl/ssl_lib.c", 861);
return -1;
}
}
else
{
ERR_put_error(20, 395, 204, "ssl/ssl_lib.c", 851);
return -1;
}
}
else
{
ERR_put_error(20, 395, 204, "ssl/ssl_lib.c", 844);
return -1;
}
}
else
{
ERR_put_error(20, 395, 167, "ssl/ssl_lib.c", 829);
return v3;
}
}