//
// sub_9F300C from 0x9f300c to 0x9f3164 (344 bytes)
//
// 2 xrefs:
// > ??> @ 0xc77b94
// > ??> @ 0xc77c04
//
// 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:30 +0000
//
int __fastcall sub_9F300C(int a1, int a2)
{
int v4; // r6
int v5; // r0
int *v6; // r4
int v7; // r1
int v8; // r0
size_t *v9; // r0
int v10; // r8
int v11; // r6
int v12; // r0
int v14; // [sp+Ch] [bp-4h] BYREF
v4 = *(_DWORD *)(a2 + 20);
v14 = 0;
v5 = ASN1_STRING_new();
v6 = (int *)v5;
if ( v5 )
{
v7 = v5 + 8;
if ( *(_UNKNOWN **)(a2 + 12) == &dhx_asn1_meth )
v8 = i2d_DHxparams(v4, v7);
else
v8 = i2d_DHparams(v4, v7);
*v6 = v8;
if ( v8 <= 0 )
{
ERR_put_error(5, 109, 65, "crypto/dh/dh_ameth.c", 115);
}
else
{
v9 = (size_t *)BN_to_ASN1_INTEGER(*(_DWORD *)(v4 + 20), 0);
v10 = (int)v9;
if ( v9 )
{
v11 = i2d_ASN1_INTEGER(v9, &v14);
ASN1_INTEGER_free(v10);
if ( v11 <= 0 )
{
ERR_put_error(5, 109, 65, "crypto/dh/dh_ameth.c", 129);
}
else
{
v12 = OBJ_nid2obj(**(_DWORD **)(a2 + 12));
if ( X509_PUBKEY_set0_param(a1, v12, 16, v6, v14, v11) )
return 1;
}
}
}
}
else
{
ERR_put_error(5, 109, 65, "crypto/dh/dh_ameth.c", 110);
}
CRYPTO_free(v14, "crypto/dh/dh_ameth.c", 138);
ASN1_STRING_free((int)v6);
return 0;
}