//
// RSA_sign_ASN1_OCTET_STRING from 0xdd8174 to 0xdd82cc (344 bytes)
//
// 2 xrefs:
// > sub_DD6E04 @ 0xdd6f1c
// > ??> @ 0xc7098
//
// 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 RSA_sign_ASN1_OCTET_STRING(__int64 a1, __int64 a2, int a3, __int64 a4, int *a5, __int64 a6)
{
unsigned int v9; // w22
int v10; // w1
unsigned __int64 v11; // x19
_BYTE *v12; // x21
int v13; // w0
unsigned int v14; // w20
_BYTE *v16; // [xsp+60h] [xbp+60h] BYREF
_DWORD v17[2]; // [xsp+68h] [xbp+68h] BYREF
__int64 v18; // [xsp+70h] [xbp+70h]
v18 = a2;
v17[0] = a3;
v17[1] = 4;
v9 = i2d_ASN1_OCTET_STRING((__int64)v17, nullptr);
v10 = RSA_size(a6);
if ( (int)v9 >= v10 - 10 )
{
ERR_put_error(4, 118, 112, (__int64)"crypto/rsa/rsa_saos.c", 34);
return 0;
}
else
{
v11 = (unsigned int)(v10 + 1);
v12 = CRYPTO_malloc((void *)v11, (__int64)"crypto/rsa/rsa_saos.c", 37);
if ( v12 )
{
v16 = v12;
i2d_ASN1_OCTET_STRING((__int64)v17, (__int64 *)&v16);
v13 = RSA_private_encrypt(v9, (__int64)v12, a4, a6);
if ( v13 <= 0 )
{
v14 = 0;
}
else
{
*a5 = v13;
v14 = 1;
}
CRYPTO_clear_free(v12, v11, (__int64)"crypto/rsa/rsa_saos.c", 0x32u);
return v14;
}
else
{
ERR_put_error(4, 118, 65, (__int64)"crypto/rsa/rsa_saos.c", 39);
return 0;
}
}
}