//
// sub_10800E4 from 0x10800e4 to 0x10802a4 (448 bytes)
//
// 1 xrefs:
// > ??> @ 0x153d638
//
// 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:17:09 +0000
//
__int64 __fastcall sub_10800E4(__int64 a1, __int64 a2, char *a3)
{
__int64 v5; // x20
__int64 v6; // x0
__int64 v7; // x4
__int64 v8; // x21
void *v9; // x0
int v10; // w0
__int64 v11; // x1
__int64 v13; // x0
__int64 v15; // [xsp+38h] [xbp+38h]
int v16; // [xsp+40h] [xbp+40h] BYREF
unsigned int v17; // [xsp+44h] [xbp+44h] BYREF
__int64 v18; // [xsp+48h] [xbp+48h] BYREF
_BYTE v19[64]; // [xsp+50h] [xbp+50h] BYREF
if ( strcmp(a3, "hash") )
return s2i_ASN1_OCTET_STRING(a1, a2, a3);
v5 = ASN1_OCTET_STRING_new();
if ( !v5 )
{
ERR_put_error(34, 115, 65, (__int64)"crypto/x509v3/v3_skey.c", 69);
return 0;
}
if ( a2 )
{
if ( *(_DWORD *)a2 == 1 )
return v5;
v6 = *(_QWORD *)(a2 + 24);
if ( v6 )
{
v7 = *(_QWORD *)(v6 + 40);
goto LABEL_7;
}
v13 = *(_QWORD *)(a2 + 16);
if ( v13 )
{
v7 = *(_QWORD *)(v13 + 80);
LABEL_7:
if ( v7 )
{
X509_PUBKEY_get0_param(nullptr, &v18, &v16, nullptr, v7);
v8 = v18;
v15 = v16;
v9 = EVP_sha1();
if ( (unsigned int)EVP_Digest(v8, v15, (__int64)v19, &v17, (__int64)v9, 0) )
{
v10 = ASN1_OCTET_STRING_set(v5, v19, v17);
v11 = v5;
if ( v10 )
return v11;
ERR_put_error(34, 115, 65, (__int64)"crypto/x509v3/v3_skey.c", 97);
}
}
else
{
ERR_put_error(34, 115, 114, (__int64)"crypto/x509v3/v3_skey.c", 87);
}
goto LABEL_14;
}
}
ERR_put_error(34, 115, 114, (__int64)"crypto/x509v3/v3_skey.c", 77);
LABEL_14:
ASN1_OCTET_STRING_free(v5);
return 0;
}