Files
Open_Ultra_SAST/benchmarks/pairs/vfc/openssl-cve-2021-3711-sm2_asym_decrypt/fixed.c
T
Marius Ciepluch 0116f9bea6 feat(real-world-vfc-slice): add labeled OpenSSL/Firefox/Chromium/curl pair corpus
Harvest 176 isolated vuln-vs-fix functions (109 CVEs, 352 training rows)
into benchmarks/pairs/vfc with provenance and a JSONL training manifest.
Score the slice as an honesty dashboard (ousast pairs --slice vfc);
keep the pair gate on the local fixtures only.
2026-09-04 16:45:38 +02:00

30 lines
960 B
C

/* Provenance: openssl/openssl sm2_asym_decrypt (fixed).
* repo: openssl/openssl
* commit: 36cf45ef3ba71e44a8be06ee81cb31aa02cb0010
* parent: 4b8a8bb75229b64d1c7598d845fdc3c7e7d7eee2
* commit_url: https://github.com/openssl/openssl/commit/36cf45ef3ba71e44a8be06ee81cb31aa02cb0010
* cve: CVE-2021-3711
* license: OpenSSL License
* function: sm2_asym_decrypt
* relpath: providers/implementations/asymciphers/sm2_enc.c
*/
static int sm2_asym_decrypt(void *vpsm2ctx, unsigned char *out, size_t *outlen,
size_t outsize, const unsigned char *in,
size_t inlen)
{
PROV_SM2_CTX *psm2ctx = (PROV_SM2_CTX *)vpsm2ctx;
const EVP_MD *md = sm2_get_md(psm2ctx);
if (md == NULL)
return 0;
if (out == NULL) {
if (!ossl_sm2_plaintext_size(in, inlen, outlen))
return 0;
return 1;
}
return ossl_sm2_decrypt(psm2ctx->key, md, in, inlen, out, outlen);
}