mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-17 12:09:27 +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: b33c48b75aaf33c93aeda42d7138616b9e6a64cb
|
|
* parent: 198b11683568452282bd48828fcf60d4835bf327
|
|
* commit_url: https://github.com/openssl/openssl/commit/b33c48b75aaf33c93aeda42d7138616b9e6a64cb
|
|
* cve: CVE-2020-1971
|
|
* license: OpenSSL License
|
|
* 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_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;
|
|
}
|