// // X509_chain_check_suiteb from 0xde6b38 to 0xde6e64 (812 bytes) // // 6 xrefs: // > tls1_check_chain @ 0xd5afe4 // > tls1_check_chain @ 0xd5b0d4 // > sub_DEBD8C @ 0xdeca50 // > X509_verify_cert @ 0xded070 // > X509_verify_cert @ 0xded0fc // > @ 0x69228 // // 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 X509_chain_check_suiteb(int *a1, __int64 a2, unsigned int *a3, unsigned __int64 a4) { __int64 v6; // x19 int v8; // w21 unsigned int *v9; // x0 unsigned int *v10; // x24 unsigned int v11; // w20 unsigned int v12; // w1 int v14; // w19 __int64 v15; // x0 __int64 v16; // x0 int v17; // w0 __int64 v18; // x0 __int64 v19; // x0 int curve_name; // w0 __int64 v21; // x0 __int64 v22; // x0 int v23; // w0 unsigned __int64 v24; // x26 int signature_nid; // w20 unsigned int *v26; // x0 __int64 v27; // x0 __int64 v28; // x0 int v29; // w0 v6 = a2; if ( (a4 & 0x30000) != 0 ) { v8 = 0; if ( !a2 ) { v8 = 1; v6 = OPENSSL_sk_value((__int64)a3, 0); } v9 = (unsigned int *)X509_get0_pubkey(v6); v10 = v9; if ( !a3 ) { if ( v9 && (unsigned int)EVP_PKEY_id(v9) == 408 ) { v18 = EVP_PKEY_get0_EC_KEY((__int64)v10); v19 = EC_KEY_get0_group(v18); v12 = 57; if ( v19 ) { curve_name = EC_GROUP_get_curve_name(v19); if ( curve_name == 715 ) { if ( (a4 & 0x20000) != 0 ) return 0; else return 60; } else { v12 = 58; if ( curve_name == 415 ) { if ( (a4 & 0x10000) != 0 ) return 0; else return 60; } } } } else { return 57; } return v12; } if ( X509_get_version(v6) != 2 ) { v8 = 0; v11 = 56; LABEL_7: if ( a1 ) *a1 = v8; return v11; } if ( !v10 || (unsigned int)EVP_PKEY_id(v10) != 408 ) { v8 = 0; v11 = 57; goto LABEL_7; } v21 = EVP_PKEY_get0_EC_KEY((__int64)v10); v22 = EC_KEY_get0_group(v21); if ( !v22 ) { v11 = 57; v8 = 0; goto LABEL_7; } v23 = EC_GROUP_get_curve_name(v22); if ( v23 == 715 ) { v11 = 60; v24 = a4 & 0xFFFFFFFFFFFEFFFFLL; if ( (a4 & 0x20000) != 0 ) goto LABEL_36; v8 = 0; goto LABEL_7; } v11 = 58; if ( v23 != 415 || (v11 = 60, v24 = a4, (a4 & 0x10000) == 0) ) { v8 = 0; goto LABEL_7; } LABEL_36: while ( v8 < (int)OPENSSL_sk_num(a3) ) { signature_nid = X509_get_signature_nid(v6); v6 = OPENSSL_sk_value((__int64)a3, v8); if ( X509_get_version(v6) != 2 ) { v11 = 56; goto LABEL_7; } v26 = (unsigned int *)X509_get0_pubkey(v6); v10 = v26; if ( !v26 || (unsigned int)EVP_PKEY_id(v26) != 408 || (v27 = EVP_PKEY_get0_EC_KEY((__int64)v10), (v28 = EC_KEY_get0_group(v27)) == 0) ) { v11 = 57; goto LABEL_7; } v29 = EC_GROUP_get_curve_name(v28); if ( v29 == 715 ) { if ( signature_nid != 795 && signature_nid != -1 ) goto LABEL_47; if ( (v24 & 0x20000) == 0 ) { v11 = 60; goto LABEL_48; } v24 &= ~0x10000uLL; } else { if ( v29 != 415 ) { v11 = 58; goto LABEL_7; } if ( signature_nid != 794 && signature_nid != -1 ) { LABEL_47: v11 = 59; goto LABEL_48; } if ( (v24 & 0x10000) == 0 ) { v11 = 60; goto LABEL_48; } } ++v8; } v14 = X509_get_signature_nid(v6); v11 = 57; if ( (unsigned int)EVP_PKEY_id(v10) != 408 ) goto LABEL_7; v15 = EVP_PKEY_get0_EC_KEY((__int64)v10); v16 = EC_KEY_get0_group(v15); if ( !v16 ) goto LABEL_7; v17 = EC_GROUP_get_curve_name(v16); if ( v17 == 715 ) { if ( v14 == 795 || (v11 = 59, v14 == -1) ) { v11 = 60; if ( (v24 & 0x20000) != 0 ) return 0; } goto LABEL_48; } v11 = 58; if ( v17 != 415 ) goto LABEL_7; if ( v14 != 794 && (v11 = 59, v14 != -1) || (v11 = 60, (v24 & 0x10000) == 0) ) { LABEL_48: v8 -= v8 != 0; if ( v11 == 60 && a4 != v24 ) v11 = 61; goto LABEL_7; } } return 0; }
GD Web Decomp Icon

GD Web Decomp

Raw Source