mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 03:49:26 +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: 7880536fe17c2b5450e279155bedd51771d28c9f
|
|
* parent: adf77d6657e836fc87391fad53d857927a764297
|
|
* commit_url: https://github.com/openssl/openssl/commit/7880536fe17c2b5450e279155bedd51771d28c9f
|
|
* cve: CVE-2023-0286
|
|
* license: Apache-2.0
|
|
* function: GENERAL_NAME_cmp
|
|
* relpath: crypto/x509/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_STRING_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;
|
|
}
|