// // tls_prepare_client_certificate from 0x9b907c to 0x9b9390 (788 bytes) // // 2 xrefs: // > ossl_statem_client_post_process_message @ 0x9b93ac // > @ 0x76e3c // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // 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 12:07:00 +0000 // int __fastcall tls_prepare_client_certificate(int *a1, int a2) { _DWORD *v4; // r3 int (*v5)(void); // r2 int v6; // r0 _DWORD *v7; // r2 int v8; // r0 int v9; // r4 int v10; // r2 _DWORD *v11; // r0 _DWORD *v12; // r3 int v13; // [sp+8h] [bp-Ch] BYREF int v14; // [sp+Ch] [bp-8h] BYREF v13 = 0; v14 = 0; if ( a2 == 3 ) { v4 = (_DWORD *)a1[50]; v5 = (int (*)(void))v4[48]; if ( !v5 ) goto LABEL_42; v6 = v5(); if ( v6 < 0 ) { a1[5] = 4; return 3; } if ( !v6 ) { LABEL_22: ssl3_send_alert(a1, 2, 80); ossl_statem_set_error((int)a1); return 0; } v4 = (_DWORD *)a1[50]; a1[5] = 1; if ( v4 ) { LABEL_42: v7 = (_DWORD *)*v4; if ( *(_DWORD *)*v4 && v7[1] && ((*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 2) == 0 || *(_DWORD *)(a1[26] + 858993460 * (v7 - (v4 + 5)) + 628)) && ((v4[4] & 0x30001) == 0 || tls1_check_chain(a1, 0, 0, 0, -2)) ) { return 2; } } } else if ( a2 != 4 ) { return 0; } v8 = ssl_do_client_cert_cb(a1, (int)&v13, (int)&v14); v9 = v8; if ( v8 < 0 ) { a1[5] = 4; return 4; } a1[5] = 1; if ( v8 == 1 ) { if ( v14 && v13 ) { if ( SSL_use_certificate((int)a1, v13) && SSL_use_PrivateKey((int)a1, v14) ) { X509_free(v13); EVP_PKEY_free(v14); goto LABEL_27; } } else { ERR_put_error(20, 360, 106, "ssl/statem/statem_clnt.c", 2752); } X509_free(v13); EVP_PKEY_free(v14); goto LABEL_19; } X509_free(v13); EVP_PKEY_free(v14); if ( !v9 ) goto LABEL_19; LABEL_27: v11 = (_DWORD *)a1[50]; if ( v11 ) { v12 = (_DWORD *)*v11; if ( *(_DWORD *)*v11 ) { if ( v12[1] ) { if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 2) != 0 ) { v10 = a1[26]; if ( !*(_DWORD *)(v10 + 858993460 * (v12 - (v11 + 5)) + 628) ) goto LABEL_20; } if ( (v11[4] & 0x30001) == 0 || tls1_check_chain(a1, 0, 0, 0, -2) ) return 2; } } } LABEL_19: v10 = a1[26]; LABEL_20: if ( *a1 != 768 ) { *(_DWORD *)(v10 + 536) = 2; if ( !ssl3_digest_cached_records(a1, 0) ) goto LABEL_22; return 2; } *(_DWORD *)(v10 + 536) = 0; ssl3_send_alert(a1, 1, 41); return 2; }
GD Web Decomp Icon

GD Web Decomp

Raw Source