//
// X509_STORE_add_cert from 0xa54bd8 to 0xa54ccc (244 bytes)
//
// 6 xrefs:
// > ssl_build_cert_chain @ 0x9a72a0
// > ssl_build_cert_chain @ 0x9a72ec
// > X509_load_cert_file @ 0xa517ac
// > X509_load_cert_file @ 0xa51854
// > X509_load_cert_crl_file @ 0xa51afc
// > ??> @ 0x74f5c
//
// 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:25 +0000
//
int __fastcall X509_STORE_add_cert(int a1, int a2)
{
int *v4; // r0
int *v5; // r7
int v7; // r4
int v8; // r6
if ( !a2 )
return 0;
v4 = X509_OBJECT_new();
v5 = v4;
if ( !v4 )
return 0;
v7 = 1;
*v4 = 1;
v4[1] = a2;
X509_OBJECT_up_ref_count(v4);
CRYPTO_THREAD_write_lock(*(pthread_rwlock_t **)(a1 + 72));
if ( X509_OBJECT_retrieve_match(*(_DWORD **)(a1 + 4), v5) )
{
ERR_put_error(11, 124, 101, (int)"crypto/x509/x509_lu.c", 326);
v8 = 1;
CRYPTO_THREAD_unlock(*(pthread_rwlock_t **)(a1 + 72));
}
else
{
v8 = OPENSSL_sk_push(*(int **)(a1 + 4), (int)v5);
CRYPTO_THREAD_unlock(*(pthread_rwlock_t **)(a1 + 72));
if ( v8 )
goto LABEL_7;
}
X509_OBJECT_free(v5);
v7 = 0;
LABEL_7:
if ( !v8 )
ERR_put_error(11, 124, 65, (int)"crypto/x509/x509_lu.c", 338);
return v7;
}