//
// RSA_sign_ASN1_OCTET_STRING from 0x10564d4 to 0x105662c (344 bytes)
//
// 2 xrefs:
// > sub_1055164 @ 0x105527c
// > ??> @ 0x102f28
//
// 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:16:41 +0000
//
__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;
}
}
}