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.
51 lines
1.3 KiB
C
51 lines
1.3 KiB
C
/* Provenance: openssl/openssl GENERAL_NAME_cmp (fixed).
|
|
* repo: openssl/openssl
|
|
* commit: f960d81215ebf3f65e03d4d5d857fb9b666d6920
|
|
* parent: aa0ad2011d3e7ad8a611da274ef7d9c7706e289b
|
|
* commit_url: https://github.com/openssl/openssl/commit/f960d81215ebf3f65e03d4d5d857fb9b666d6920
|
|
* cve: CVE-2020-1971
|
|
* license: OpenSSL License
|
|
* function: GENERAL_NAME_cmp
|
|
* relpath: crypto/x509v3/v3_genn.c
|
|
*/
|
|
|
|
int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b)
|
|
{
|
|
int result = -1;
|
|
|
|
if (!a || !b || a->type != b->type)
|
|
return -1;
|
|
switch (a->type) {
|
|
case GEN_X400:
|
|
result = ASN1_TYPE_cmp(a->d.x400Address, b->d.x400Address);
|
|
break;
|
|
|
|
case GEN_EDIPARTY:
|
|
result = edipartyname_cmp(a->d.ediPartyName, b->d.ediPartyName);
|
|
break;
|
|
|
|
case GEN_OTHERNAME:
|
|
result = OTHERNAME_cmp(a->d.otherName, b->d.otherName);
|
|
break;
|
|
|
|
case GEN_EMAIL:
|
|
case GEN_DNS:
|
|
case GEN_URI:
|
|
result = ASN1_STRING_cmp(a->d.ia5, b->d.ia5);
|
|
break;
|
|
|
|
case GEN_DIRNAME:
|
|
result = X509_NAME_cmp(a->d.dirn, b->d.dirn);
|
|
break;
|
|
|
|
case GEN_IPADD:
|
|
result = ASN1_OCTET_STRING_cmp(a->d.ip, b->d.ip);
|
|
break;
|
|
|
|
case GEN_RID:
|
|
result = OBJ_cmp(a->d.rid, b->d.rid);
|
|
break;
|
|
}
|
|
return result;
|
|
}
|