//
// sub_DFD290 from 0xdfd290 to 0xdfd6c0 (1072 bytes)
//
// 1 xrefs:
// > ??> @ 0x1224da8
//
// 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
//
_QWORD *__fastcall sub_DFD290(__int64 a1, __int64 a2, unsigned int *a3)
{
_QWORD *v5; // x25
int v6; // w19
__int64 v7; // x0
const char *v8; // x20
_QWORD *v9; // x21
_BYTE *v10; // x23
__int64 v11; // x2
__int64 v12; // x3
__int64 v13; // x4
__int64 v14; // x2
__int64 v15; // x3
__int64 v16; // x4
__int64 v17; // x2
__int64 v18; // x3
__int64 v19; // x4
__int64 v20; // x2
__int64 v21; // x3
__int64 v22; // x4
unsigned int *v24; // x20
int *v25; // x24
__int64 v26; // x21
__int64 v27; // x0
unsigned int **v28; // x23
__int64 section; // x0
__int64 v30; // x20
int v31; // w21
int v32; // w0
v5 = (_QWORD *)ISSUING_DIST_POINT_new();
if ( v5 )
{
v6 = 0;
if ( (int)OPENSSL_sk_num(a3) > 0 )
{
while ( 1 )
{
v7 = OPENSSL_sk_value((__int64)a3, v6);
v8 = *(const char **)(v7 + 8);
v9 = (_QWORD *)v7;
v10 = *(_BYTE **)(v7 + 16);
if ( !strncmp(v8, "fullname", 9u) )
break;
if ( !strcmp(v8, "relativename") )
{
v28 = (unsigned int **)X509_NAME_new();
if ( !v28 )
goto LABEL_32;
section = X509V3_get_section(a2);
v30 = section;
if ( !section )
{
ERR_put_error(34, 158, 150, (__int64)"crypto/x509v3/v3_crld.c", 86);
goto LABEL_32;
}
v31 = X509V3_NAME_from_section(v28, section, 4097);
X509V3_section_free(a2, v30);
v24 = *v28;
*v28 = nullptr;
X509_NAME_free((__int64)v28);
if ( !v31 || (int)OPENSSL_sk_num(v24) <= 0 )
{
v25 = nullptr;
goto LABEL_31;
}
v32 = OPENSSL_sk_num(v24);
if ( *(_DWORD *)(OPENSSL_sk_value((__int64)v24, v32 - 1) + 16) )
{
v25 = nullptr;
ERR_put_error(34, 158, 161, (__int64)"crypto/x509v3/v3_crld.c", 102);
goto LABEL_31;
}
v26 = *v5;
v25 = nullptr;
if ( *v5 )
{
LABEL_30:
ERR_put_error(34, 158, 160, (__int64)"crypto/x509v3/v3_crld.c", 110);
LABEL_31:
OPENSSL_sk_pop_free(v25, (void (__fastcall *)(__int64))GENERAL_NAME_free);
OPENSSL_sk_pop_free((int *)v24, (void (__fastcall *)(__int64))X509_NAME_ENTRY_free);
goto LABEL_32;
}
LABEL_20:
v27 = DIST_POINT_NAME_new();
*v5 = v27;
if ( !v27 )
goto LABEL_31;
if ( v25 )
{
*(_QWORD *)(v27 + 8) = v25;
*(_DWORD *)v27 = v26;
}
else
{
*(_QWORD *)(v27 + 8) = v24;
*(_DWORD *)v27 = 1;
}
++v6;
goto LABEL_12;
}
if ( !strcmp(v8, "onlyuser") )
{
if ( !(unsigned int)X509V3_get_value_bool(v9, v5 + 1, v11, v12, v13) )
goto LABEL_32;
++v6;
}
else if ( !strcmp(v8, "onlyCA") )
{
if ( !(unsigned int)X509V3_get_value_bool(v9, (char *)v5 + 12, v14, v15, v16) )
goto LABEL_32;
++v6;
}
else if ( !strcmp(v8, "onlyAA") )
{
if ( !(unsigned int)X509V3_get_value_bool(v9, (char *)v5 + 28, v17, v18, v19) )
goto LABEL_32;
++v6;
}
else if ( !strcmp(v8, "indirectCRL") )
{
if ( !(unsigned int)X509V3_get_value_bool(v9, v5 + 3, v20, v21, v22) )
goto LABEL_32;
++v6;
}
else
{
if ( strcmp(v8, "onlysomereasons") )
{
ERR_put_error(34, 157, 106, (__int64)"crypto/x509v3/v3_crld.c", 398);
ERR_add_error_data(6, "section:", *v9, ",name:", v9[1], ",value:", v9[2]);
goto LABEL_32;
}
if ( !(unsigned int)sub_DFC5C0(v5 + 2, (__int64)v10) )
goto LABEL_32;
++v6;
}
LABEL_12:
if ( v6 >= (int)OPENSSL_sk_num(a3) )
return v5;
}
if ( *v10 == 64 )
{
v24 = (unsigned int *)X509V3_get_section(a2);
if ( !v24 )
{
LABEL_34:
v25 = (int *)v24;
ERR_put_error(34, 156, 150, (__int64)"crypto/x509v3/v3_crld.c", 55);
goto LABEL_31;
}
}
else
{
v24 = (unsigned int *)X509V3_parse_list(v10);
if ( !v24 )
goto LABEL_34;
}
v25 = v2i_GENERAL_NAMES(0, a2, v24);
if ( *v10 == 64 )
X509V3_section_free(a2, (__int64)v24);
else
OPENSSL_sk_pop_free((int *)v24, (void (__fastcall *)(__int64))X509V3_conf_free);
if ( !v25 )
{
v24 = nullptr;
goto LABEL_31;
}
v26 = *v5;
v24 = nullptr;
if ( *v5 )
goto LABEL_30;
goto LABEL_20;
}
return v5;
}
else
{
ERR_put_error(34, 157, 65, (__int64)"crypto/x509v3/v3_crld.c", 406);
LABEL_32:
ISSUING_DIST_POINT_free((__int64)v5);
return nullptr;
}
}