mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-18 12:39:28 +00:00
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.
29 lines
922 B
C
29 lines
922 B
C
/* Provenance: openssl/openssl pkey_sm2_decrypt (fixed).
|
|
* repo: openssl/openssl
|
|
* commit: 59f5e75f3bced8fc0e130d72a3f582cf7b480b46
|
|
* parent: 8c74c9d1ade0fbdab5b815ddb747351b8b839641
|
|
* commit_url: https://github.com/openssl/openssl/commit/59f5e75f3bced8fc0e130d72a3f582cf7b480b46
|
|
* cve: CVE-2021-3711
|
|
* license: OpenSSL License
|
|
* function: pkey_sm2_decrypt
|
|
* relpath: crypto/sm2/sm2_pmeth.c
|
|
*/
|
|
|
|
static int pkey_sm2_decrypt(EVP_PKEY_CTX *ctx,
|
|
unsigned char *out, size_t *outlen,
|
|
const unsigned char *in, size_t inlen)
|
|
{
|
|
EC_KEY *ec = ctx->pkey->pkey.ec;
|
|
SM2_PKEY_CTX *dctx = ctx->data;
|
|
const EVP_MD *md = (dctx->md == NULL) ? EVP_sm3() : dctx->md;
|
|
|
|
if (out == NULL) {
|
|
if (!sm2_plaintext_size(in, inlen, outlen))
|
|
return -1;
|
|
else
|
|
return 1;
|
|
}
|
|
|
|
return sm2_decrypt(ec, md, in, inlen, out, outlen);
|
|
}
|