Commit graph

10798 commits

Author SHA1 Message Date
Tim Wojtulewicz
a5a08b3bf3 Remove unused ListExpr::AllConst method 2020-03-24 13:13:35 -07:00
Tim Wojtulewicz
0817b2d16a Constify a couple of method arguments 2020-03-24 13:00:14 -07:00
Tim Wojtulewicz
b51879da83 Mark RuntimeError methods in Reporter as noreturn since they throw exceptions 2020-03-24 12:58:41 -07:00
Jon Siwek
94656c2308 Fix memory leak in Zeek when-statement bodies with runtime errors 2020-03-23 22:01:03 -07:00
Jon Siwek
b045ce4bb3 Change TableVal::RecoverIndex() to return IntrusivePtr 2020-03-23 22:01:03 -07:00
Jon Siwek
0b5a18495d Use IntrusivePtr in TableVal::CallExpireFunc 2020-03-23 22:01:03 -07:00
Jon Siwek
7a4ce9fb51 Fix memory leak when runtime error occurs in a Zeek for-loop 2020-03-23 22:01:03 -07:00
Jon Siwek
98d94ec785 Enable leak checks for btests that produce runtime exceptions
These were previously reporting leaks due to various allocations not
getting cleaned up during the stack unwind, but at the current state of
the transition toward IntrusivePtr usage, theses tests no longer leak.
2020-03-23 21:51:12 -07:00
Jon Siwek
b0b1fffe3e Updating submodule(s).
[nomail]
2020-03-23 10:22:51 -07:00
Jon Siwek
427150b27a Merge remote-tracking branch 'origin/topic/jsiwek/gh-857-rebuild-tables-on-record-redef'
* origin/topic/jsiwek/gh-857-rebuild-tables-on-record-redef:
  Initialize RecordVal default fields when redef'd
  GH-857: fix redefining record types used to index tables
  Change RecordVals to get resized at time of RecordType redef
2020-03-20 11:31:11 -07:00
Tim Wojtulewicz
535c70b087 Merge remote-tracking branch 'origin/topic/jsiwek/gh-865-smb-negotiate-context-list'
* origin/topic/jsiwek/gh-865-smb-negotiate-context-list:
  GH-865: fix parsing of SMB NegotiateContextList
2020-03-20 10:05:34 -07:00
Jon Siwek
7e57f0788c Add test case for binpac flowbuffer frame length parsing bug 2020-03-19 22:09:23 -07:00
Jon Siwek
e2aeb70efc Merge branch 'master' of https://github.com/zeek/zeek 2020-03-17 22:57:23 -07:00
Jon Siwek
b62727a7fa Merge branch 'intrusive_ptr' of https://github.com/MaxKellermann/zeek
* 'intrusive_ptr' of https://github.com/MaxKellermann/zeek: (32 commits)
  Scope: store IntrusivePtr in `local`
  Scope: pass IntrusivePtr to AddInit()
  DNS_Mgr: use class IntrusivePtr
  Scope: use class IntrusivePtr
  Attr: use class IntrusivePtr
  Expr: check_and_promote_expr() returns IntrusivePtr
  Frame: use class IntrusivePtr
  Val: RecordVal::LookupWithDefault() returns IntrusivePtr
  Type: RecordType::FieldDefault() returns IntrusivePtr
  Val: TableVal::Delete() returns IntrusivePtr
  Type: base_type() returns IntrusivePtr
  Type: init_type() returns IntrusivePtr
  Type: merge_types() returns IntrusivePtr
  Type: use class IntrusivePtr in VectorType
  Type: use class IntrusivePtr in EnumType
  Type: use class IntrusivePtr in FileType
  Type: use class IntrusivePtr in TypeDecl
  Type: make TypeDecl `final` and the dtor non-`virtual`
  Type: use class IntrusivePtr in TypeType
  Type: use class IntrusivePtr in FuncType
  ...
2020-03-17 22:51:46 -07:00
Tim Wojtulewicz
e6cf7413f9 Merge remote-tracking branch 'origin/topic/timw/hardware-checksum'
* origin/topic/timw/hardware-checksum:
  Cleanup in iosource/Packet
  Add ability for packet sources to flag a packet's l2 or l3 checksum as valid.
2020-03-17 16:55:19 -07:00
Jon Siwek
9c70bcecbc GH-865: fix parsing of SMB NegotiateContextList
* The compression capability was incorrectly set to 0x0004 instead of 0x0003

* The padding was 4-byte instead of 8-byte aligned and also the spec.
  does not strictly require the padding for the last item in the list.

* Add a default case to handle parsing of unknown context types.
2020-03-16 19:00:01 -07:00
Jon Siwek
acb3b27a2c Merge branch 'master' of https://github.com/shirkdog/zeek
* 'master' of https://github.com/shirkdog/zeek:
  Duplicate smb2_negotiate_response events defined.
2020-03-16 12:38:27 -07:00
M.Shirk
9cd914b5cf Duplicate smb2_negotiate_response events defined. 2020-03-16 11:47:39 -04:00
Jon Siwek
d560aceced Updating submodule(s).
[nomail]
2020-03-13 23:02:23 -07:00
Jon Siwek
e5e4fd6af6 Add branch whitelist for CI notifications 2020-03-13 13:41:46 -07:00
Jon Siwek
7a397d2746 Initialize RecordVal default fields when redef'd
If a RecordVal had been created, but later its RecordType redef'd to
contain fields with &default, those fields were incorrectly left
uninitialized.
2020-03-12 18:46:37 -07:00
Jon Siwek
71b82595ba GH-857: fix redefining record types used to index tables
This change tracks all TableVals created at parse-time whose index
depends on a given RecordType.  Should that RecordType be redef'd, those
TableVals are immediately rebuilt such that they are valid to
subsequently use in either parse-time initializations or eventually in
any arbitrary run-time expression.
2020-03-12 18:25:48 -07:00
Tim Wojtulewicz
ce17a1f38b Cleanup in iosource/Packet 2020-03-12 16:08:31 -07:00
Tim Wojtulewicz
c6f7665953 Add ability for packet sources to flag a packet's l2 or l3 checksum as valid.
This lets packet source plugins implement handling of hardware checksum offloading, if available. Setting the flags will skip the internal checksumming for either layer 2 and/or layer 3.
2020-03-12 16:08:22 -07:00
Jon Siwek
a61ad9ea5c Change RecordVals to get resized at time of RecordType redef
Opposed to unconditionally checking all RecordVals whether they need to
be resized after parsing ends.
2020-03-12 15:51:37 -07:00
Johanna Amann
da5fca7163 Merge branch 'topic/johanna/gh-744-cache-the-heck-out-of-these-certs'
* topic/johanna/gh-744-cache-the-heck-out-of-these-certs:
  X509 caching API change: callback gets entry directly
  Address feedback
  Small default updates & external baselines.
  X509 caching: small API changes, tests & test updates
  Certificate caching - now working in principle.
  First (sadly not completely working) approach at caching X509 certificates
2020-03-12 13:44:07 -07:00
Jon Siwek
860f851a66 Update pointer to external test repo 2020-03-12 12:04:24 -07:00
Johanna Amann
e228061f1d X509 caching API change: callback gets entry directly
Suggestion from Jon: now the callback is passed the table-entry
directly. This allows us to skip one lookup.
2020-03-12 11:31:13 -07:00
Johanna Amann
3ed9379b9e Address feedback
Smaller fixes. I split out the API change of the fallback function into
a separate commit.
2020-03-12 11:21:39 -07:00
Johanna Amann
0a7b358985 Small default updates & external baselines.
Update default caching time to be slightly more than a minute - to catch
cases that happen once a minute.

Also update external baselines.
2020-03-12 10:52:39 -07:00
Jon Siwek
b811f7cee3 Fix whitespace in connection record comments 2020-03-11 16:40:20 -07:00
Johanna Amann
4b09947f41 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.
2020-03-11 13:27:56 -07:00
Jon Siwek
26af1f55af Merge remote-tracking branch 'origin/topic/vladg/gh-843'
Added a comment to clarify comparison of EOF packet length to 13.

* origin/topic/vladg/gh-843:
  Update baselines
  Made additional MySQL fixes.
  Add support to MySQL for deprecation of EOF packets.
  Whitespace cleanup & fixes
  Fix EOF detection in the MySQL protocol analyzer.
2020-03-11 11:25:00 -07:00
Jon Siwek
dc7c7d004b Updating submodule(s).
[nomail]
2020-03-11 10:21:43 -07:00
Johanna Amann
65e99bafed Certificate caching - now working in principle.
I moved the replay function to a callback - which now means that the replayed
functions are called before file_state remove. Which makes this virtually
identical with the events raised by the core.

Currently this is mostly missing tests, leak-testing and performance-tests.
2020-03-09 14:40:10 -07:00
Tim Wojtulewicz
b2a707a7bf Merge remote-tracking branch 'origin/topic/jsiwek/coverity-gh-action'
* origin/topic/jsiwek/coverity-gh-action:
  Stop running GitHub Actions in forked repos
  Remove Travis CI configuration
  Add GitHub Action for Coverity Scan
2020-03-09 13:36:08 -07:00
Jon Siwek
065d055700 Updating submodule(s).
[nomail]
2020-03-09 12:54:59 -07:00
Vlad Grigorescu
a362189856 Update baselines 2020-03-06 22:49:26 -06:00
Vlad Grigorescu
6667af85ca Made additional MySQL fixes.
1) There are a couple more places where the new protocol uses and OK
packet instead of the deprecated EOF.

2) With > 255 results, we could end up in an situation where the uint8
sequence number would wrap, and we'd naively think it'd be a new
handshake.

Now, we track the previous sequence number, and assume overflow if it
was 255 previously and 0 now.

We also reset the previous sequence number to 0 in various packets
that we'd expect at the end of other commands.
2020-03-06 22:41:36 -06:00
Jon Siwek
c5feccb8f6 Merge remote-tracking branch 'origin/topic/timw/urgent-flag'
* origin/topic/timw/urgent-flag:
  Add urgent flag to tcp_flags documentation
2020-03-06 16:33:24 -08:00
Tim Wojtulewicz
b1378c7e0c Add urgent flag to tcp_flags documentation 2020-03-06 16:38:46 -07:00
Johanna Amann
0829164a3e First (sadly not completely working) approach at caching X509 certificates
This approach mostly relies on script-level changes. In scriptland, we track
which certificates should be cached - and also perform the caching and the
replaying of events there.

This actually is probably nearly functional - the problem is the fact that now
the event ordering is wrong - and file_state_remove is called before the x509
events are thrown.

The fix probably is to move to a callback from the core - which can execute
things in the right order again. (Or just write the whole event-raising inside
the core - but that is both less flexible and a lot more cumbersome).
2020-03-06 15:21:45 -08:00
Jon Siwek
2c46be0d6e Updating submodule(s).
[nomail]
2020-03-06 11:58:19 -08:00
Jon Siwek
64855dfa0e Updating submodule(s).
[nomail]
2020-03-06 10:40:35 -08:00
Johanna Amann
0c44c3135c Merge remote-tracking branch 'origin/topic/jsiwek/gh-836-move-3rdparties-up'
* origin/topic/jsiwek/gh-836-move-3rdparties-up:
  Move libkqueue submodule to the aux directory
  Move rapidjson submodule to aux directory
2020-03-06 07:59:59 -08:00
Johanna Amann
ca6e6b2b75 Merge remote-tracking branch 'origin/topic/jsiwek/gh-831-binary-pkg-bro-symlink'
* origin/topic/jsiwek/gh-831-binary-pkg-bro-symlink:
  GH-831: Fix the "bro" symlink for binary packaging mode
2020-03-06 07:45:31 -08:00
Max Kellermann
785ff57d11 Scope: store IntrusivePtr in local 2020-03-06 13:03:41 +01:00
Max Kellermann
6e0d331267 Scope: pass IntrusivePtr to AddInit() 2020-03-06 13:02:15 +01:00
Max Kellermann
9e00c28e48 DNS_Mgr: use class IntrusivePtr 2020-03-06 13:00:45 +01:00
Max Kellermann
dc518c0fb4 Scope: use class IntrusivePtr 2020-03-06 13:00:45 +01:00