Files
Open_Ultra_SAST/benchmarks/pairs/vfc/openssl-cve-2026-75803-chacha20_poly1305_cipher/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

32 lines
993 B
C

/* Provenance: openssl/openssl chacha20_poly1305_cipher (fixed).
* repo: openssl/openssl
* commit: 119ab9555dc62275bbd71f6f49529b1a44feba42
* parent: 39488cb863074d5b8ece833905f7ad2b357d44fe
* commit_url: https://github.com/openssl/openssl/commit/119ab9555dc62275bbd71f6f49529b1a44feba42
* cve: CVE-2026-75803
* license: Apache-2.0
* function: chacha20_poly1305_cipher
* relpath: providers/implementations/ciphers/cipher_chacha20_poly1305.c
*/
static int chacha20_poly1305_cipher(void *vctx, unsigned char *out,
size_t *outl, size_t outsize,
const unsigned char *in, size_t inl)
{
PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
PROV_CIPHER_HW_CHACHA20_POLY1305 *hw = (PROV_CIPHER_HW_CHACHA20_POLY1305 *)ctx->hw;
if (!ossl_prov_is_running())
return 0;
if (outsize < inl) {
ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
return 0;
}
if (!hw->aead_cipher(ctx, out, outl, in, inl))
return 0;
return 1;
}