Address feedback

Smaller fixes. I split out the API change of the fallback function into
a separate commit.
This commit is contained in:
Johanna Amann 2020-03-12 11:21:39 -07:00
parent 0a7b358985
commit 3ed9379b9e
4 changed files with 9 additions and 15 deletions

View file

@ -214,14 +214,11 @@ event file_hash(f: fa_file, kind: string, hash: string)
if ( ! f?$info || "X509" !in f$info$analyzers || kind != "sha256" )
return;
if ( caching_required_encounters == 0 )
if ( caching_required_encounters == 0 || hash in certificate_cache )
return;
if ( hash !in certificates_encountered )
certificates_encountered[hash] = 0;
certificates_encountered[hash] += 1;
if ( certificates_encountered[hash] < caching_required_encounters )
return;
certificates_encountered[hash] = 1;
else
certificates_encountered[hash] += 1;
}