//
// RSA_padding_add_SSLv23 from 0xdd8b5c to 0xdd8c60 (260 bytes)
//
// 2 xrefs:
// > sub_DD4B3C @ 0xdd4d8c
// > ??> @ 0x5d4f8
//
// 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_padding_add_SSLv23(_BYTE *a1, int a2, const void *a3, unsigned int a4)
{
int v6; // w20
_BYTE *v7; // x19
_BYTE *v8; // x20
if ( a2 - 10 <= (int)a4 )
{
ERR_put_error(4, 110, 110, (__int64)"crypto/rsa/rsa_ssl.c", 24);
return 0;
}
v6 = a2 - 11 - a4;
*a1 = 0;
v7 = a1 + 2;
a1[1] = 2;
if ( (int)RAND_bytes((__int64)(a1 + 2), (unsigned int)v6) <= 0 )
return 0;
if ( v6 > 0 )
{
v8 = &v7[v6 - 1 + 1];
while ( *v7 )
{
LABEL_6:
if ( ++v7 == v8 )
goto LABEL_7;
}
while ( (int)RAND_bytes((__int64)v7, 1) > 0 )
{
if ( *v7 )
goto LABEL_6;
}
return 0;
}
v8 = v7;
LABEL_7:
v8[8] = 0;
*(_QWORD *)v8 = 0x303030303030303LL;
memcpy(v8 + 9, a3, a4);
return 1;
}