//
// NAME_CONSTRAINTS_check_CN from 0xa6cf88 to 0xa6d078 (240 bytes)
//
// 2 xrefs:
// > sub_A589E0 @ 0xa59ad0
// > ??> @ 0x8105c
//
// 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:40 +0000
//
int __fastcall NAME_CONSTRAINTS_check_CN(int a1, int *a2)
{
int index_by_NID; // r4
int *subject_name; // r5
int entry; // r0
int *data; // r6
int v7; // r3
int v8; // r6
void *v10; // [sp+4h] [bp-1Ch] BYREF
_DWORD v11[2]; // [sp+8h] [bp-18h] BYREF
_DWORD v12[4]; // [sp+10h] [bp-10h] BYREF
v11[0] = 2;
v12[3] = 0;
v12[1] = 22;
v11[1] = v12;
index_by_NID = -1;
subject_name = (int *)X509_get_subject_name(a1);
while ( 1 )
{
do
{
index_by_NID = X509_NAME_get_index_by_NID(subject_name, 0xDu, index_by_NID);
if ( index_by_NID == -1 )
return 0;
entry = X509_NAME_get_entry(subject_name, index_by_NID);
data = (int *)X509_NAME_ENTRY_get_data(entry);
}
while ( !asn1_valid_host(data) );
v7 = ASN1_STRING_to_UTF8(&v10, data);
if ( v7 <= 0 )
break;
v12[0] = v7;
v12[2] = v10;
v8 = sub_A6CB64(v11, a2);
CRYPTO_free(v10, (int)"crypto/x509v3/v3_ncons.c", 267);
if ( v8 )
return v8;
}
return 17;
}