//
// X509_VERIFY_PARAM_set1_host from 0xa5b638 to 0xa5b7a8 (368 bytes)
//
// 3 xrefs:
// > SSL_set1_host @ 0x9aa990
// > SSL_dane_enable @ 0x9ac6a0
// > ??> @ 0x7533c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:08:29 +0000
//
int *__fastcall X509_VERIFY_PARAM_set1_host(int a1, char *a2, unsigned int a3)
{
bool v3; // zf
int v6; // r4
size_t v7; // r5
size_t v8; // r2
int *v10; // r4
unsigned __int8 *v11; // r5
v3 = a2 == nullptr;
if ( a2 )
v3 = a3 == 0;
v6 = a2 == nullptr;
if ( v3 )
{
if ( !a2 || (v7 = strlen(a2)) == 0 )
{
OPENSSL_sk_pop_free(*(_DWORD *)(a1 + 36), (void (__fastcall *)(int))sub_A5B294);
v10 = &dword_0 + 1;
*(_DWORD *)(a1 + 36) = 0;
return v10;
}
}
else
{
v7 = a3;
if ( a3 <= 1 )
v8 = 1;
else
v8 = a3 - 1;
if ( memchr(a2, 0, v8) )
return nullptr;
}
if ( !a2[v7 - 1] )
--v7;
if ( !v7 )
v6 |= 1u;
OPENSSL_sk_pop_free(*(_DWORD *)(a1 + 36), (void (__fastcall *)(int))sub_A5B294);
*(_DWORD *)(a1 + 36) = 0;
if ( v6 )
return &dword_0 + 1;
v11 = CRYPTO_strndup((unsigned __int8 *)a2, v7, (int)"crypto/x509/x509_vpm.c", 60);
if ( !v11 )
return nullptr;
v10 = *(int **)(a1 + 36);
if ( !v10 )
{
v10 = OPENSSL_sk_new_null();
*(_DWORD *)(a1 + 36) = v10;
if ( !v10 )
{
CRYPTO_free(v11, (int)"crypto/x509/x509_vpm.c", 66);
return v10;
}
}
if ( !OPENSSL_sk_push(v10, (int)v11) )
{
CRYPTO_free(v11, (int)"crypto/x509/x509_vpm.c", 71);
v10 = (int *)OPENSSL_sk_num(*(_DWORD *)(a1 + 36));
if ( !v10 )
{
OPENSSL_sk_free(*(void ***)(a1 + 36));
*(_DWORD *)(a1 + 36) = 0;
return v10;
}
return nullptr;
}
return &dword_0 + 1;
}