//
// sub_105074C from 0x105074c to 0x1050a8c (832 bytes)
//
// 1 xrefs:
// > ??> @ 0x140dcf8
//
// 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:38 +0000
//
__int64 __fastcall sub_105074C(__int64 a1, __int64 *a2, __int64 a3, unsigned int a4)
{
__int64 v9; // x0
__int64 v10; // x20
__int64 *v11; // x23
__int64 *v12; // x23
__int64 *v13; // x0
__int64 v14; // x1
__int64 v15; // x1
if ( (unsigned int)OBJ_obj2nid(*a2) == 912 )
{
v9 = ASN1_TYPE_unpack_sequence(&RSA_PSS_PARAMS_it, a2[1]);
v10 = v9;
if ( v9 )
{
v11 = *(__int64 **)(v9 + 8);
if ( v11 && (unsigned int)OBJ_obj2nid(*v11) == 911 )
v12 = (__int64 *)ASN1_TYPE_unpack_sequence(X509_ALGOR_it, v11[1]);
else
v12 = nullptr;
if ( (int)BIO_puts(a1, (__int64)&byte_11AAA48) <= 0
|| !(unsigned int)BIO_indent(a1, a4, 128)
|| (int)BIO_puts(a1, (__int64)"Hash Algorithm: ") <= 0 )
{
goto LABEL_10;
}
if ( *(_QWORD *)v10 )
{
if ( (int)i2a_ASN1_OBJECT(a1, **(_QWORD **)v10) <= 0 )
goto LABEL_10;
}
else if ( (int)BIO_puts(a1, (__int64)"sha1 (default)") <= 0 )
{
goto LABEL_10;
}
if ( (int)BIO_puts(a1, (__int64)&byte_11AAA48) <= 0
|| !(unsigned int)BIO_indent(a1, a4, 128)
|| (int)BIO_puts(a1, (__int64)"Mask Algorithm: ") <= 0 )
{
goto LABEL_10;
}
v13 = *(__int64 **)(v10 + 8);
if ( v13 )
{
if ( (int)i2a_ASN1_OBJECT(a1, *v13) <= 0 || (int)BIO_puts(a1, (__int64)" with ") <= 0 )
goto LABEL_10;
if ( v12 )
{
if ( (int)i2a_ASN1_OBJECT(a1, *v12) <= 0 )
goto LABEL_10;
}
else if ( (int)BIO_puts(a1, (__int64)"INVALID") <= 0 )
{
goto LABEL_10;
}
}
else if ( (int)BIO_puts(a1, (__int64)"mgf1 with sha1 (default)") <= 0 )
{
goto LABEL_10;
}
BIO_puts(a1, (__int64)&byte_11AAA48);
if ( !(unsigned int)BIO_indent(a1, a4, 128) || (int)BIO_puts(a1, (__int64)"Salt Length: 0x") <= 0 )
goto LABEL_10;
v14 = *(_QWORD *)(v10 + 16);
if ( v14 )
{
if ( (int)i2a_ASN1_INTEGER(a1, v14) <= 0 )
goto LABEL_10;
}
else if ( (int)BIO_puts(a1, (__int64)"14 (default)") <= 0 )
{
goto LABEL_10;
}
BIO_puts(a1, (__int64)&byte_11AAA48);
if ( (unsigned int)BIO_indent(a1, a4, 128) && (int)BIO_puts(a1, (__int64)"Trailer Field: 0x") > 0 )
{
v15 = *(_QWORD *)(v10 + 24);
if ( v15 )
{
if ( (int)i2a_ASN1_INTEGER(a1, v15) > 0 )
{
LABEL_33:
BIO_puts(a1, (__int64)&byte_11AAA48);
LABEL_34:
RSA_PSS_PARAMS_free(v10);
X509_ALGOR_free((__int64)v12);
if ( a3 )
return X509_signature_dump(a1, a3, a4);
return 1;
}
}
else if ( (int)BIO_puts(a1, (__int64)"BC (default)") > 0 )
{
goto LABEL_33;
}
}
}
else
{
v12 = nullptr;
if ( (int)BIO_puts(a1, (__int64)" (INVALID PSS PARAMETERS)\n") > 0 )
goto LABEL_34;
}
LABEL_10:
RSA_PSS_PARAMS_free(v10);
X509_ALGOR_free((__int64)v12);
return 0;
}
if ( a3 )
return X509_signature_dump(a1, a3, a4);
return (int)BIO_puts(a1, (__int64)&byte_11AAA48) > 0;
}