//
// X509_certificate_type from 0x106df40 to 0x106e0c0 (384 bytes)
//
// 3 xrefs:
// > ssl3_check_cert_and_algorithm @ 0xfc95e4
// > tls_process_cert_verify @ 0xfd1974
// > ??> @ 0x668f8
//
// 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:58 +0000
//
__int64 __fastcall X509_certificate_type(__int64 a1, unsigned int *a2)
{
int v3; // w0
int v4; // w22
unsigned int v5; // w23
unsigned int v6; // w20
unsigned int v7; // w21
int signature_nid; // w0
int v10; // [xsp+4Ch] [xbp+4Ch] BYREF
if ( a1 )
{
if ( a2 || (a2 = (unsigned int *)X509_get0_pubkey(a1)) != nullptr )
{
v3 = EVP_PKEY_id(a2);
if ( v3 == 408 )
{
v4 = 1112;
v5 = 600;
v6 = 344;
v7 = 88;
goto LABEL_9;
}
if ( v3 > 408 )
{
if ( v3 == 811 || v3 >= 811 && (unsigned int)(v3 - 979) <= 1 )
{
v4 = 1104;
v5 = 592;
v6 = 336;
v7 = 80;
goto LABEL_9;
}
}
else
{
switch ( v3 )
{
case 28:
v4 = 1092;
v5 = 580;
v6 = 324;
v7 = 68;
goto LABEL_9;
case 116:
v4 = 1042;
v5 = 530;
v6 = 274;
v7 = 18;
goto LABEL_9;
case 6:
v4 = 1073;
v5 = 561;
v6 = 305;
v7 = 49;
goto LABEL_9;
}
}
v4 = 1024;
v5 = 512;
v6 = 256;
v7 = 0;
LABEL_9:
signature_nid = X509_get_signature_nid(a1);
v10 = signature_nid;
if ( signature_nid && (unsigned int)OBJ_find_sigid_algs(signature_nid, nullptr, &v10) )
{
if ( v10 == 67 )
return v5;
if ( v10 > 67 )
{
if ( v10 != 116 )
{
v6 = v4;
if ( v10 == 408 )
return v6;
return v7;
}
return v5;
}
if ( v10 == 6 || v10 == 19 )
return v6;
}
return v7;
}
}
return 0;
}