Commit graph

17064 commits

Author SHA1 Message Date
Vern Paxson
3f52cbcbc7 fix for script optimization of nested switch statements 2024-08-16 11:19:02 +02:00
Vern Paxson
a947d96160 script optimization fix for complex "in" expressions in conditionals 2024-08-16 11:19:02 +02:00
Vern Paxson
42bf164dc4 updates to typos allow-list reflecting ZAM regularization changes 2024-08-16 11:19:02 +02:00
Vern Paxson
bf3cf9da48 BTest updates for ZAM regularization changes 2024-08-16 11:18:58 +02:00
Vern Paxson
3b6df1ab7f convert new ZAM operations to use typed operands 2024-08-16 11:18:58 +02:00
Vern Paxson
3e1b536810 complete migration of ZAM to use only public ZVal methods 2024-08-16 11:18:58 +02:00
Vern Paxson
1457099df3 "-O validate-ZAM" option to validate generated ZAM instructions 2024-08-16 11:18:58 +02:00
Vern Paxson
db22448270 internal option to suppress control-flow optimization 2024-08-16 11:18:58 +02:00
Vern Paxson
63f76c7f84 exposing some functionality for greater flexibility in structuring run-time execution 2024-08-16 11:18:58 +02:00
Vern Paxson
65e713e6ea rework ZAM compilation of type switches to leverage value switches 2024-08-16 11:18:58 +02:00
Vern Paxson
a1185ee6bb add tracking of control flow information 2024-08-16 11:18:58 +02:00
Vern Paxson
e94764982d factoring of ZAM operation specifications into separate files 2024-08-16 11:18:58 +02:00
Vern Paxson
5fc2c601b4 updates to ZAM operations / gen-zam regularization, other than the operations themselves 2024-08-16 11:18:58 +02:00
Vern Paxson
1d7e71b499 type-checking fix for vector-of-string operations 2024-08-16 11:18:57 +02:00
Vern Paxson
3cf3cc3c5e ZVal constructor for booleans 2024-08-16 11:18:57 +02:00
Vern Paxson
88740acffe fix for nit in base/protocols/krb/main.zeek 2024-08-16 11:18:57 +02:00
Vern Paxson
1253af42f9 mark functions skipped by ZAM compilation as such 2024-08-16 11:18:57 +02:00
Vern Paxson
11e9135f80 fix for avoiding inadvertent interpreter errors in CallExpr::IsPure() 2024-08-16 11:18:57 +02:00
Vern Paxson
37fcb231fa support for traversing ZAM code similar to AST traversal 2024-08-16 11:18:57 +02:00
Vern Paxson
85a8f0739c run-time warnings for scripts compiled to C++ 2024-08-16 11:18:57 +02:00
Vern Paxson
b333d24e0e allow C++ script compiler access to type internals 2024-08-16 11:18:57 +02:00
Vern Paxson
e93db75f78 fixes for script optimization of coerce-to-any expressions 2024-08-16 11:18:57 +02:00
Vern Paxson
cfb068a922 fix to correctly track whether a capture needs deep-copying 2024-08-16 11:18:57 +02:00
Vern Paxson
e6fe20f140 fix for -O report-C++ 2024-08-16 11:18:57 +02:00
Vern Paxson
857df9f063 support for more in-depth AST profiling 2024-08-16 11:18:57 +02:00
Vern Paxson
d2c6208421 allow profiling without updating of hash values 2024-08-16 11:18:57 +02:00
Vern Paxson
3962810e4b ListVal method to clear the list to allow reusing w/o new construction 2024-08-16 11:18:54 +02:00
Arne Welzel
ed0ba237a1 broker: Deprecate MakeEvent(ValPList*)
The variadic broker messaging BIFs currently convert @ARGS@ into a
ValPList before passing it on to MakeEvent(). This appears historic
plumbing. Implement the same functionality using Span<const ValPtr>
and do the extra copying in the now deprecated MakeEvent().

Further, make passing a frame optional as not all callers may
have one available.
2024-08-16 10:48:02 +02:00
Arne Welzel
8553fb96bd Span: Remove deduction guideline for Iter, Iter, include cleanup
We don't have a constructor for that, so that's confusing, also
<array> isn't used.
2024-08-16 10:47:45 +02:00
Arne Welzel
ac5cbcc43e Merge remote-tracking branch 'origin/topic/vern/cpp-init'
* origin/topic/vern/cpp-init:
  Func: Add SetCapturesVec()
  marked some recently added BTests as not suitable for -O gen-C++ testing
  robustness improvements for -O gen-C++ generation of lambdas / "when"s
  speedups for compilation of initializers in -O gen-C++ generated code
  fixes for -O gen-C++ generation of floating point constants
  -O gen-C++ fix for dealing with use of more than one module qualifier
  header tweaks to provide gen-C++ script optimization with more flexibility
  fix for script optimization of constants of type "opaque"
  fix for script optimization of "in" operations
  some minor tidying of -O gen-C++ sources
2024-08-15 10:30:48 +02:00
Arne Welzel
5e36709905 Func: Add SetCapturesVec()
Add an API to directly set captures_vec for use by C++ compilation. The
current code keys off or asserts on ZAM stmts, making it difficult to
leverage captures_vec in other contexts.
2024-08-15 10:10:00 +02:00
zeek-bot
0a495c996c Update doc submodule [nomail] [skip ci] 2024-08-15 00:11:45 +00:00
Arne Welzel
52d51f2c63 Merge remote-tracking branch 'origin/topic/awelzel/3880-mysql-caching-sha2-password-successful'
* origin/topic/awelzel/3880-mysql-caching-sha2-password-successful:
  mysql: Implement and test COM_CHANGE_USER
  mysql: Remove auth plugin state
  mysql: Handle server connection phase separately from command phase
2024-08-14 20:12:39 +02:00
Arne Welzel
02f4665e9b mysql: Implement and test COM_CHANGE_USER
This reworks the parser such that COM_CHANGE_USER switches the
connection back into the CONNECTION_PHASE so that we can remove the
EXPECT_AUTH_SWITCH special case in the COMMAND_PHASE. Adds two pcaps
produced with Python that actually do COM_CHANGE_USER as it seems
not possible from the MySQL CLI.
2024-08-14 10:20:01 +02:00
zeek-bot
6a997af9a1 Update doc submodule [nomail] [skip ci] 2024-08-14 00:16:13 +00:00
Vern Paxson
5e35334281 marked some recently added BTests as not suitable for -O gen-C++ testing 2024-08-13 14:46:08 -07:00
Vern Paxson
207b82ae4b robustness improvements for -O gen-C++ generation of lambdas / "when"s 2024-08-13 14:45:33 -07:00
Vern Paxson
0ca2f9a8b2 speedups for compilation of initializers in -O gen-C++ generated code 2024-08-13 14:43:17 -07:00
Vern Paxson
6daf9d5b88 fixes for -O gen-C++ generation of floating point constants 2024-08-13 14:42:25 -07:00
Vern Paxson
a93a69ba62 -O gen-C++ fix for dealing with use of more than one module qualifier 2024-08-13 14:41:51 -07:00
Vern Paxson
77c34787f3 header tweaks to provide gen-C++ script optimization with more flexibility 2024-08-13 14:37:06 -07:00
Vern Paxson
5a3b519fb4 fix for script optimization of constants of type "opaque" 2024-08-13 14:33:00 -07:00
Vern Paxson
03347e235b fix for script optimization of "in" operations 2024-08-13 14:32:23 -07:00
Vern Paxson
769a3d958a some minor tidying of -O gen-C++ sources 2024-08-13 14:29:26 -07:00
Arne Welzel
a4c79e7304 mysql: Remove auth plugin state
Now that we use CONNECTION_PHASE and interpret AuthSwitchRequest
correctly, we can remove reliance on the plugin discrepancy to
determine expectations.
2024-08-13 22:06:36 +02:00
Arne Welzel
b1c63ae4e0 mysql: Handle server connection phase separately from command phase
This avoids interpreting an AuthSwitchRequest (0xfe) during the command
phase as EOF_Packet.

Thanks @AmazingPP.

Closes #3880
2024-08-13 22:06:25 +02:00
Johanna Amann
1fe6a02169 Make ssl_history work for SSLv2 handshakes/connections
It turns out that the ssl_history field never was populated with C/S for
SSLv2 connections, or connections using the SSLv2 handshake. In our
testcases, the latter is especially common - with connections up to TLS1
using the old SSLv2 client hello for backwards compatibility.

This change resolves this issue. As the history is not by default
enabled in a lot of locations, baseline impact is minor.
2024-08-13 18:03:06 +01:00
Johanna Amann
84c4d53a4e Spicy TLS - full test suite pass
With this commit, the entire Zeek test suite passes using spicy TLS.
Tests that either use a SSLv2 handshake, or DTLS are skipped, as the
parser currently does not support either.

Similarly, tests that rely on behavior we cannot replicate (baseline,
hooks, exact error messages) are passed. Other than that, all the
TLS-based tests pass with 100% the exact same baseline results.

This necessitated a couple of small tweaks to the spicy file - the
testcases uncovered several small problems.

This commit also enables cirrus tests for Spicy SSL/TLS.
2024-08-13 14:41:37 +01:00
Arne Welzel
44a3ed676b Merge remote-tracking branch 'jgras/topic/jgras/packet-analyzer-history-rework'
* jgras/topic/jgras/packet-analyzer-history-rework:
  Deprecate old unknown_protocol event signature
  Use raw pointer for packet analyzer history
  Update external baselines for analyzer history
  Update btest baselines for analyzer history
  Add packet analyzer history
2024-08-13 12:37:41 +02:00
Johanna Amann
1e282989fe Merge remote-tracking branch 'origin/master' into topic/johanna/spicy-tls
* origin/master: (93 commits)
  spicyz: Add back message about removed support for port / ports in evt
  rule-parse: Remove id_to_str() lookup to squelch coverity warning
  Update doc submodule [nomail] [skip ci]
  Update zeekctl submodule [nomail]
  btest: Skip core.script-args under TSAN
  Update doc submodule [nomail] [skip ci]
  Update zeekctl submodule
  Add note to NEWS about the removal of OpaqueVal::DoSerialize and OpaqueVal::DoUnserialize
  Remove deprecated port/ports fields for spicy analyzers
  Remove deprecated Cluster::Node::interface field
  Remove deprecated signature definition format
  Return an error if GLOBAL:: prefix is used
  Remove deprecated BloomFilter serialization methods
  Remove deprecated OpaqueVal serialization methods
  Remove deprecated DECLARE_OPAQUE_VALUE macro
  Make TypePtr::Capture member variables private
  Remove deprecated Trigger constructor
  Remove deprecated Controller::auto_assign_ports and Controller::auto_assign_start_port
  Remove deprecated load-balacing policy script
  Remove deprecated prometheus telemetry policy script
  ...
2024-08-13 10:37:52 +01:00