//
// ENGINE_set_default from 0x7f6e50 to 0x7f6f6c (284 bytes)
//
// 3 xrefs:
// > sub_644A2C @ 0x644a3e
// > ENGINE_set_default_string @ 0x7f6fb4
// > ??> @ 0x5550c
//
// 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(int a1, __int16 a2)
{
if ( (a2 & 0x40) != 0 )
{
if ( !ENGINE_set_default_ciphers() )
return 0;
if ( (a2 & 0x80) == 0 )
{
LABEL_3:
if ( (a2 & 1) == 0 )
goto LABEL_4;
goto LABEL_17;
}
}
else if ( (a2 & 0x80) == 0 )
{
goto LABEL_3;
}
if ( !ENGINE_set_default_digests(a1) )
return 0;
if ( (a2 & 1) != 0 )
{
LABEL_17:
if ( !ENGINE_set_default_RSA(a1) )
return 0;
}
LABEL_4:
if ( (a2 & 2) != 0 && !ENGINE_set_default_DSA(a1) )
return 0;
if ( (a2 & 4) != 0 )
{
if ( ENGINE_set_default_DH(a1) )
{
if ( (a2 & 0x800) == 0 )
goto LABEL_7;
goto LABEL_21;
}
return 0;
}
if ( (a2 & 0x800) == 0 )
goto LABEL_7;
LABEL_21:
if ( !ENGINE_set_default_EC(a1) )
return 0;
LABEL_7:
if ( (a2 & 8) != 0 && !ENGINE_set_default_RAND(a1) || (a2 & 0x200) != 0 && !ENGINE_set_default_pkey_meths(a1) )
return 0;
return (a2 & 0x400) == 0 || ENGINE_set_default_pkey_asn1_meths(a1) != 0;
}