//
// ssl_cert_type from 0x9bbac4 to 0x9bbb68 (164 bytes)
//
// 8 xrefs:
// > sub_9B015C @ 0x9b0184
// > sub_9B02F8 @ 0x9b030c
// > SSL_use_PrivateKey @ 0x9b0aa8
// > SSL_CTX_use_PrivateKey @ 0x9b1374
// > tls_process_server_certificate @ 0x9b6230
// > tls_process_cert_verify @ 0x9c0ac8
// > tls1_check_chain @ 0x9c8f40
// > ??> @ 0x7624c
//
// 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:07:02 +0000
//
int __fastcall ssl_cert_type(int a1, int a2)
{
int v2; // r0
bool v3; // cc
int v5; // r0
if ( a2 )
{
v2 = EVP_PKEY_id(a2);
v3 = v2 <= 408;
if ( v2 != 408 )
goto LABEL_3;
return 3;
}
v5 = X509_get0_pubkey(a1);
if ( !v5 )
return -1;
v2 = EVP_PKEY_id(v5);
v3 = v2 <= 408;
if ( v2 == 408 )
return 3;
LABEL_3:
if ( v3 )
{
if ( v2 == 6 )
{
return 0;
}
else
{
if ( v2 != 116 )
return -1;
return 2;
}
}
else
{
switch ( v2 )
{
case 979:
return 5;
case 980:
return 6;
case 811:
return 4;
default:
return -1;
}
}
}