mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-18 04:29: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.
48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
/* Provenance: openssl/openssl hash_dir (fixed).
|
|
* repo: openssl/openssl
|
|
* commit: 2c9c35870601b4a44d86ddbf512b38df38285cfa
|
|
* 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 $dir = shift;
|
|
my %hashlist;
|
|
|
|
print "Doing $dir\n";
|
|
|
|
if (!chdir $dir) {
|
|
print STDERR "WARNING: Cannot chdir to '$dir', $!\n";
|
|
return;
|
|
}
|
|
|
|
opendir(DIR, ".") || print STDERR "WARNING: Cannot opendir '.', $!\n";
|
|
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 $_\n" 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);
|
|
}
|
|
|
|
chdir $pwd;
|
|
}
|