//
// X509_VERIFY_PARAM_set1_host from 0xdee674 to 0xdee800 (396 bytes)
//
// 3 xrefs:
// > SSL_set1_host @ 0xd3ea7c
// > SSL_dane_enable @ 0xd407bc
// > ??> @ 0x35400
//
// 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 X509_VERIFY_PARAM_set1_host(__int64 a1, char *a2, unsigned __int64 a3)
{
_BOOL4 v3; // w22
size_t v6; // x19
size_t v7; // x2
int *v9; // x19
_BYTE *v10; // x20
int *v11; // x0
v3 = a2 == nullptr;
v6 = a3;
if ( a2 && a3 )
{
if ( a3 <= 1 )
v7 = 1;
else
v7 = a3 - 1;
if ( memchr(a2, 0, v7) )
return 0;
}
else if ( !a2 || (v6 = strlen(a2)) == 0 )
{
LODWORD(v9) = 1;
OPENSSL_sk_pop_free(*(int **)(a1 + 56), (void (__fastcall *)(__int64))sub_DEE250);
*(_QWORD *)(a1 + 56) = 0;
return (unsigned int)v9;
}
if ( !a2[v6 - 1] )
--v6;
OPENSSL_sk_pop_free(*(int **)(a1 + 56), (void (__fastcall *)(__int64))sub_DEE250);
*(_QWORD *)(a1 + 56) = 0;
if ( !v6 || v3 )
return 1;
v10 = CRYPTO_strndup(a2, v6, (__int64)"crypto/x509/x509_vpm.c", 0x3Cu);
if ( !v10 )
return 0;
v9 = *(int **)(a1 + 56);
if ( !v9 )
{
v11 = (int *)OPENSSL_sk_new_null();
*(_QWORD *)(a1 + 56) = v11;
v9 = v11;
if ( !v11 )
{
CRYPTO_free(v10, (__int64)"crypto/x509/x509_vpm.c", 66);
return (unsigned int)v9;
}
}
if ( !(unsigned int)OPENSSL_sk_push(v9, (__int64)v10) )
{
CRYPTO_free(v10, (__int64)"crypto/x509/x509_vpm.c", 71);
LODWORD(v9) = OPENSSL_sk_num(*(unsigned int **)(a1 + 56));
if ( !(_DWORD)v9 )
{
OPENSSL_sk_free(*(void ***)(a1 + 56));
*(_QWORD *)(a1 + 56) = 0;
return (unsigned int)v9;
}
return 0;
}
return 1;
}