zeek/testing/btest/plugins
Robin Sommer 9b0d525728
Let our TCP-based application analyzers operate without any TCP parent analyzer.
Conceptually, a TCP-based application analyzer should not need any
knowledge about the underlying TCP analysis; it's supposed to just
process its reassembled input stream as it's handed over. But our
analyzers break that assumption at a few places because sometimes
knowledge about the TCP state of the connection can be helpful for
heuristics. This is fine as long as there actually *is* a TCP parent
analyzer available. Sometimes, however, there isn't: if the payload
stream is encapsulated inside another application-layer protocol, the
semantic link to TCP is broken. And if the outer connection is even
UDP, then we don't have a TCP analyzer at all.

We didn't handle this situation well so far. Most analyzers needing
TCP state would just crash if there's no TCP analyzer (in debug mode
with an `assert`, in release mode with a null pointer deref ...). Only
HTTP did the right thing already: check if TCP is available and adapt
accordingly.

We know extend that check to all other analyzers as well: all accesses
to `TCP()` are guarded, with reasonable defaults if not available.
It's actually a pretty small change overall, which is evidence for how
little this layering violation actually matters.

The existing behavior is what's causing
https://github.com/corelight/zeek-spicy-openvpn/issues/3.
2022-01-28 16:25:27 +01:00
..
binpac-flowbuffer-frame-length-plugin Let our TCP-based application analyzers operate without any TCP parent analyzer. 2022-01-28 16:25:27 +01:00
doctest-plugin Add testcases for plugin with doctest usage 2021-12-06 12:17:22 -08:00
file-plugin Prefix #includes of .bif.h files with zeek/ 2021-02-02 19:15:05 -08:00
func-hook-plugin Update plugin btests for namespace changes 2020-08-24 12:07:03 -07:00
hooks-plugin Added plugin.unprocessed_packet_hook btest 2021-11-12 09:30:26 -07:00
logging-hooks-plugin Update plugin btests for namespace changes 2020-08-24 12:07:03 -07:00
packet-protocol-plugin Remove Session prefix from some session-related classes and files 2021-04-29 11:09:35 -07:00
pktdumper-plugin Update minimum required CMake to 3.5 2020-12-01 22:13:52 -08:00
pktsrc-plugin Update minimum required CMake to 3.5 2020-12-01 22:13:52 -08:00
plugin-load-dependency Add test creating multiple plugins with load dependencies. 2020-11-24 16:59:11 +00:00
plugin-load-file-extended Add new hook HookLoadFileExtended that allows plugins to supply Zeek script code to parse. 2021-11-05 13:01:19 +01:00
plugin-nopatchversion-plugin Update plugin btests for namespace changes 2020-08-24 12:07:03 -07:00
plugin-withpatchversion-plugin Update plugin btests for namespace changes 2020-08-24 12:07:03 -07:00
protocol-plugin Let our TCP-based application analyzers operate without any TCP parent analyzer. 2022-01-28 16:25:27 +01:00
reader-plugin Remove all of the random single-file deprecations 2021-01-27 10:52:40 -07:00
reporter-hook-plugin Update plugin btests for namespace changes 2020-08-24 12:07:03 -07:00
unprocessed-packet-hook-plugin Added plugin.unprocessed_packet_hook btest 2021-11-12 09:30:26 -07:00
writer-plugin Update minimum required CMake to 3.5 2020-12-01 22:13:52 -08:00
.clang-format Disable formatting for files in testing/btest/plugins 2021-11-09 07:20:18 +01:00
bifs-and-scripts-install.sh Remove all fully-deprecated files 2021-01-27 10:52:40 -07:00
bifs-and-scripts.sh Format shell scripts with shfmt. 2021-11-24 23:13:02 +01:00
binpac-flowbuffer-frame-length.zeek Rename aux/ to auxil/ 2020-06-04 15:18:44 -07:00
doctest-disabled.zeek Add testcases for plugin with doctest usage 2021-12-06 12:17:22 -08:00
doctest-supported.zeek Add testcases for plugin with doctest usage 2021-12-06 12:17:22 -08:00
doctest-unsupported.zeek Add testcases for plugin with doctest usage 2021-12-06 12:17:22 -08:00
file.zeek Rename aux/ to auxil/ 2020-06-04 15:18:44 -07:00
func-hook.zeek updates to test suite tests for compatibility with upcoming ZAM functionality 2021-06-01 09:25:30 -07:00
hooks.zeek updates to ZAM to track recent changes in script semantics 2021-12-04 20:24:39 -05:00
init-plugin.zeek Rename aux/ to auxil/ 2020-06-04 15:18:44 -07:00
logging-hooks.zeek Rename aux/ to auxil/ 2020-06-04 15:18:44 -07:00
packet-protocol.zeek GH-1221: Add unknown_protocols.log for logging packet analyzer lookup failures 2020-11-09 20:37:26 -07:00
pktdumper.zeek Rename aux/ to auxil/ 2020-06-04 15:18:44 -07:00
pktsrc.zeek Rename aux/ to auxil/ 2020-06-04 15:18:44 -07:00
plugin-load-dependency.zeek Add test creating multiple plugins with load dependencies. 2020-11-24 16:59:11 +00:00
plugin-load-file-extended.zeek Add new hook HookLoadFileExtended that allows plugins to supply Zeek script code to parse. 2021-11-05 13:01:19 +01:00
plugin-nopatchversion.zeek Rename aux/ to auxil/ 2020-06-04 15:18:44 -07:00
plugin-withpatchversion.zeek General btest cleanup 2020-08-11 11:26:22 -07:00
protocol.zeek Fix registration of protocol analyzers from inside plugins. 2021-07-18 10:00:49 +02:00
reader.zeek Increase timeout of plugins.reader btest 2021-04-03 09:40:45 -07:00
reporter-hook.zeek Rename aux/ to auxil/ 2020-06-04 15:18:44 -07:00
unprocessed-packet-hook.zeek Added plugin.unprocessed_packet_hook btest 2021-11-12 09:30:26 -07:00
writer.zeek Rename aux/ to auxil/ 2020-06-04 15:18:44 -07:00