Files
Open_Ultra_SAST/benchmarks/pairs/vfc/openssl-cve-2022-2068-hash_dir/vuln.in
T
Marius Ciepluch 0116f9bea6 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.
2026-09-04 16:45:38 +02:00

39 lines
1.2 KiB
Plaintext

/* Provenance: openssl/openssl hash_dir (vuln).
* repo: openssl/openssl
* commit: abebcec7b1a30fbb1fd5c5cbbe8817690c139163
* parent: abebcec7b1a30fbb1fd5c5cbbe8817690c139163
* commit_url: https://github.com/openssl/openssl/commit/2c9c35870601b4a44d86ddbf512b38df38285cfa
* cve: CVE-2022-2068
* license: Apache-2.0
* function: hash_dir
* relpath: tools/c_rehash.in
*/
sub hash_dir {
my %hashlist;
print "Doing $_[0]\n";
chdir $_[0];
opendir(DIR, ".");
my @flist = sort readdir(DIR);
closedir DIR;
if ( $removelinks ) {
# Delete any existing symbolic links
foreach (grep {/^[\da-f]+\.r{0,1}\d+$/} @flist) {
if (-l $_) {
print "unlink $_" if $verbose;
unlink $_ || warn "Can't unlink $_, $!\n";
}
}
}
FILE: foreach $fname (grep {/\.(pem)|(crt)|(cer)|(crl)$/} @flist) {
# Check to see if certificates and/or CRLs present.
my ($cert, $crl) = check_file($fname);
if (!$cert && !$crl) {
print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
next;
}
link_hash_cert($fname) if ($cert);
link_hash_crl($fname) if ($crl);
}
}