// // CMS_add1_recipient_cert from 0x873ff8 to 0x8741c4 (460 bytes) // // 1 xrefs: // > @ 0x6a1bc // // 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 // _DWORD *__fastcall CMS_add1_recipient_cert(int *a1, int a2, int a3) { int v5; // r10 _DWORD *v6; // r4 int v7; // r0 int v8; // r11 int ri_type; // r0 _DWORD *v11; // r0 _DWORD *v12; // r5 int v13; // r3 int v14; // r2 int *v15; // r0 v5 = cms_get0_enveloped(a1); if ( !v5 ) { v6 = nullptr; goto LABEL_10; } v6 = ASN1_item_new((int)CMS_RecipientInfo_it); if ( !v6 ) goto LABEL_22; v7 = X509_get0_pubkey(a2); v8 = v7; if ( !v7 ) { ERR_put_error(46, 101, 113, (int)"crypto/cms/cms_env.c", 195); goto LABEL_10; } ri_type = cms_pkey_get_ri_type(v7); if ( !ri_type ) { v11 = ASN1_item_new((int)&CMS_KeyTransRecipientInfo_it); v12 = v11; v6[1] = v11; if ( !v11 ) goto LABEL_10; v13 = a3 & 0x10000; if ( (a3 & 0x10000) != 0 ) v13 = 2; *v6 = 0; v14 = (a3 & 0x10000) != 0 ? 1 : v13; *v11 = v13; if ( !cms_set1_SignerIdentifier(v11[1], a2, v14) ) goto LABEL_10; X509_up_ref(a2); EVP_PKEY_up_ref(v8); v12[5] = v8; v12[4] = a2; if ( (a3 & 0x40000) != 0 ) { v15 = (int *)EVP_PKEY_CTX_new(v8, nullptr); v12[6] = v15; if ( !v15 || EVP_PKEY_encrypt_init(v15) <= 0 ) goto LABEL_10; } else if ( !cms_env_asn1_ctrl(v6, a3 & 0x40000) ) { goto LABEL_10; } goto LABEL_7; } if ( ri_type == 1 ) { if ( cms_RecipientInfo_kari_init(v6, a2, v8, a3) ) { LABEL_7: if ( OPENSSL_sk_push(*(int **)(v5 + 8), (int)v6) ) return v6; LABEL_22: ERR_put_error(46, 101, 65, (int)"crypto/cms/cms_env.c", 224); } } else { ERR_put_error(46, 101, 125, (int)"crypto/cms/cms_env.c", 213); } LABEL_10: ASN1_item_free(v6, CMS_RecipientInfo_it); return nullptr; }
GD Web Decomp Icon

GD Web Decomp

Raw Source