//
// sub_D888D0 from 0xd888d0 to 0xd88a48 (376 bytes)
//
// 1 xrefs:
// > ??> @ 0x1122c70
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_D888D0(_QWORD *a1, __int64 a2)
{
__int64 v3; // x1
_DWORD *v5; // x19
int v6; // w0
__int64 v7; // x0
__int64 v8; // x20
__int64 v9; // x0
int v10; // w0
unsigned int v11; // w1
int v13; // [xsp+38h] [xbp+38h]
__int64 v14; // [xsp+48h] [xbp+48h] BYREF
v14 = 0;
v3 = *(_QWORD *)(a2 + 32);
if ( !v3 || !*(_QWORD *)(v3 + 48) )
{
v5 = nullptr;
ERR_put_error(10, 116, 101, "crypto/dsa/dsa_ameth.c", 206);
goto LABEL_7;
}
v5 = (_DWORD *)ASN1_STRING_new();
if ( !v5 )
{
ERR_put_error(10, 116, 65, "crypto/dsa/dsa_ameth.c", 213);
goto LABEL_7;
}
v6 = i2d_DSAparams(*(_QWORD *)(a2 + 32));
*v5 = v6;
if ( v6 <= 0 )
{
ERR_put_error(10, 116, 65, "crypto/dsa/dsa_ameth.c", 219);
goto LABEL_7;
}
v5[1] = 16;
v7 = BN_to_ASN1_INTEGER(*(_QWORD *)(*(_QWORD *)(a2 + 32) + 48LL), 0);
v8 = v7;
if ( !v7 )
{
ERR_put_error(10, 116, 109, "crypto/dsa/dsa_ameth.c", 228);
goto LABEL_7;
}
v13 = i2d_ASN1_INTEGER(v7, &v14);
ASN1_STRING_clear_free(v8);
v9 = OBJ_nid2obj(116);
v10 = PKCS8_pkey_set0(a1, v9, 0, 0x10u, (__int64)v5, v14, v13);
v11 = 1;
if ( !v10 )
{
LABEL_7:
CRYPTO_free(v14, "crypto/dsa/dsa_ameth.c", 244);
ASN1_STRING_free((__int64)v5);
ASN1_STRING_clear_free(0);
return 0;
}
return v11;
}