mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-20 21:49:28 +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,31 @@
|
||||
/* Provenance: openssl/openssl has_san_id (fixed).
|
||||
* repo: openssl/openssl
|
||||
* commit: d69ae8a93bfc0f2489c008fcf303a98d77a6df4d
|
||||
* parent: 758754966791c537ea95241438454aa86f91f256
|
||||
* commit_url: https://github.com/openssl/openssl/commit/d69ae8a93bfc0f2489c008fcf303a98d77a6df4d
|
||||
* cve: CVE-2021-4044
|
||||
* license: OpenSSL License
|
||||
* function: has_san_id
|
||||
* relpath: crypto/x509/x509_vfy.c
|
||||
*/
|
||||
|
||||
static int has_san_id(X509 *x, int gtype)
|
||||
{
|
||||
int i;
|
||||
int ret = 0;
|
||||
GENERAL_NAMES *gs = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
|
||||
|
||||
if (gs == NULL)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < sk_GENERAL_NAME_num(gs); i++) {
|
||||
GENERAL_NAME *g = sk_GENERAL_NAME_value(gs, i);
|
||||
|
||||
if (g->type == gtype) {
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
GENERAL_NAMES_free(gs);
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/* Provenance: openssl/openssl has_san_id (vuln).
|
||||
* repo: openssl/openssl
|
||||
* commit: 758754966791c537ea95241438454aa86f91f256
|
||||
* parent: 758754966791c537ea95241438454aa86f91f256
|
||||
* commit_url: https://github.com/openssl/openssl/commit/d69ae8a93bfc0f2489c008fcf303a98d77a6df4d
|
||||
* cve: CVE-2021-4044
|
||||
* license: OpenSSL License
|
||||
* function: has_san_id
|
||||
* relpath: crypto/x509/x509_vfy.c
|
||||
*/
|
||||
|
||||
static int has_san_id(X509 *x, int gtype)
|
||||
{
|
||||
int i;
|
||||
int ret = 0;
|
||||
GENERAL_NAMES *gs = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
|
||||
|
||||
if (gs == NULL)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < sk_GENERAL_NAME_num(gs); i++) {
|
||||
GENERAL_NAME *g = sk_GENERAL_NAME_value(gs, i);
|
||||
|
||||
if (g->type == gtype) {
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
GENERAL_NAMES_free(gs);
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user