//
// ENGINE_set_default from 0xd9ce54 to 0xd9cf40 (236 bytes)
//
// 3 xrefs:
// > sub_BB8EA0 @ 0xbb8ec4
// > ENGINE_set_default_string @ 0xd9cf88
// > ??> @ 0xc3bb8
//
// 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
//
bool __fastcall ENGINE_set_default(__int64 a1, __int16 a2)
{
if ( (a2 & 0x40) != 0 && !(unsigned int)ENGINE_set_default_ciphers() )
return 0;
if ( (a2 & 0x80) != 0 )
{
if ( !(unsigned int)ENGINE_set_default_digests(a1) )
return 0;
if ( (a2 & 1) == 0 )
{
LABEL_4:
if ( (a2 & 2) == 0 )
goto LABEL_5;
goto LABEL_17;
}
}
else if ( (a2 & 1) == 0 )
{
goto LABEL_4;
}
if ( !(unsigned int)ENGINE_set_default_RSA(a1) )
return 0;
if ( (a2 & 2) == 0 )
{
LABEL_5:
if ( (a2 & 4) == 0 )
goto LABEL_6;
goto LABEL_19;
}
LABEL_17:
if ( !(unsigned int)ENGINE_set_default_DSA(a1) )
return 0;
if ( (a2 & 4) == 0 )
{
LABEL_6:
if ( (a2 & 0x800) == 0 )
goto LABEL_7;
LABEL_21:
if ( !(unsigned int)ENGINE_set_default_EC(a1) )
return 0;
if ( (a2 & 8) == 0 )
goto LABEL_8;
goto LABEL_23;
}
LABEL_19:
if ( !(unsigned int)ENGINE_set_default_DH(a1) )
return 0;
if ( (a2 & 0x800) != 0 )
goto LABEL_21;
LABEL_7:
if ( (a2 & 8) == 0 )
{
LABEL_8:
if ( (a2 & 0x200) == 0 )
goto LABEL_9;
LABEL_25:
if ( (unsigned int)ENGINE_set_default_pkey_meths(a1) )
{
if ( (a2 & 0x400) == 0 )
return 1;
return (unsigned int)ENGINE_set_default_pkey_asn1_meths(a1) != 0;
}
return 0;
}
LABEL_23:
if ( !(unsigned int)ENGINE_set_default_RAND(a1) )
return 0;
if ( (a2 & 0x200) != 0 )
goto LABEL_25;
LABEL_9:
if ( (a2 & 0x400) == 0 )
return 1;
return (unsigned int)ENGINE_set_default_pkey_asn1_meths(a1) != 0;
}