mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-21 05:59:29 +00:00
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.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
/* Provenance: openssl/openssl X509_issuer_and_serial_hash (fixed).
|
||||
* repo: openssl/openssl
|
||||
* commit: 122a19ab48091c657f7cb1fb3af9fc07bd557bbf
|
||||
* parent: c8c6e7438c03b2fc24e7ead460feeaef04911fb4
|
||||
* commit_url: https://github.com/openssl/openssl/commit/122a19ab48091c657f7cb1fb3af9fc07bd557bbf
|
||||
* cve: CVE-2021-23841
|
||||
* license: OpenSSL License
|
||||
* function: X509_issuer_and_serial_hash
|
||||
* relpath: crypto/x509/x509_cmp.c
|
||||
*/
|
||||
|
||||
unsigned long X509_issuer_and_serial_hash(X509 *a)
|
||||
{
|
||||
unsigned long ret = 0;
|
||||
EVP_MD_CTX *ctx = EVP_MD_CTX_new();
|
||||
unsigned char md[16];
|
||||
char *f;
|
||||
|
||||
if (ctx == NULL)
|
||||
goto err;
|
||||
f = X509_NAME_oneline(a->cert_info.issuer, NULL, 0);
|
||||
if (f == NULL)
|
||||
goto err;
|
||||
if (!EVP_DigestInit_ex(ctx, EVP_md5(), NULL))
|
||||
goto err;
|
||||
if (!EVP_DigestUpdate(ctx, (unsigned char *)f, strlen(f)))
|
||||
goto err;
|
||||
OPENSSL_free(f);
|
||||
if (!EVP_DigestUpdate
|
||||
(ctx, (unsigned char *)a->cert_info.serialNumber.data,
|
||||
(unsigned long)a->cert_info.serialNumber.length))
|
||||
goto err;
|
||||
if (!EVP_DigestFinal_ex(ctx, &(md[0]), NULL))
|
||||
goto err;
|
||||
ret = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) |
|
||||
((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L)
|
||||
) & 0xffffffffL;
|
||||
err:
|
||||
EVP_MD_CTX_free(ctx);
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user