mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
X509 caching: small API changes, tests & test updates
Changed some configuration defaults to potentially more same values. The callback function is now a hook to allow costomization of the events that are raised. Tests now exist. Test baselines are updated.
This commit is contained in:
parent
65e99bafed
commit
4b09947f41
15 changed files with 227 additions and 92 deletions
14
testing/btest/scripts/base/files/x509/caching-hook.test
Normal file
14
testing/btest/scripts/base/files/x509/caching-hook.test
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Test that certificate caching works as expected.
|
||||
# Prevent certificate events to be raised/caching from occurring for cached certificates.
|
||||
|
||||
# @TEST-EXEC: zeek -r $TRACES/tls/google-duplicate.trace %INPUT
|
||||
# @TEST-EXEC: btest-diff x509.log
|
||||
# @TEST-EXEC: btest-diff .stdout
|
||||
|
||||
redef X509::caching_required_encounters = 1;
|
||||
|
||||
hook X509::x509_certificate_cache_replay(f: fa_file, sha256: string) &priority=1
|
||||
{
|
||||
print "Encountered cached certificate not further handled by core", sha256;
|
||||
break;
|
||||
}
|
12
testing/btest/scripts/base/files/x509/caching.test
Normal file
12
testing/btest/scripts/base/files/x509/caching.test
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Test that certificate caching works as expected.
|
||||
|
||||
# @TEST-EXEC: zeek -r $TRACES/tls/google-duplicate.trace %INPUT
|
||||
# @TEST-EXEC: btest-diff x509.log
|
||||
# @TEST-EXEC: btest-diff .stdout
|
||||
|
||||
redef X509::caching_required_encounters = 1;
|
||||
|
||||
hook X509::x509_certificate_cache_replay(f: fa_file, sha256: string) &priority=1
|
||||
{
|
||||
print "Encountered cached certificate not further handled by core", sha256;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue