//
// X509_VERIFY_PARAM_set1_host from 0x106c9b4 to 0x106cb40 (396 bytes)
//
// 3 xrefs:
// > SSL_set1_host @ 0xfbcdd0
// > SSL_dane_enable @ 0xfbeb10
// > ??> @ 0x4e3d0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:16:57 +0000
//
__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_106C590);
*(_QWORD *)(a1 + 56) = 0;
return (unsigned int)v9;
}
if ( !a2[v6 - 1] )
--v6;
OPENSSL_sk_pop_free(*(int **)(a1 + 56), (void (__fastcall *)(__int64))sub_106C590);
*(_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;
}