Commit graph

609 commits

Author SHA1 Message Date
Tim Wojtulewicz
765a8535e0 Remove deprecated DESC_PORTABLE ODesc mode and ODesc::IsPortable() 2022-06-30 19:11:59 +00:00
Tim Wojtulewicz
70e63d4749 Remove deprecated MemoryAllocation() methods and related code 2022-06-30 18:56:52 +00:00
Tim Wojtulewicz
7c4fd382d9 Code modernization: Convert from deprecated C standard library headers 2022-06-27 09:47:31 -07:00
Tim Wojtulewicz
b8ca68f548 GH-1672: Keep a reference to a table being expired, just in case 2022-05-16 15:33:54 -07:00
Tim Wojtulewicz
cf51931615 Merge remote-tracking branch 'origin/topic/vern/footprint'
* origin/topic/vern/footprint:
  new environment variable to enable BTests to skip ASAN checks
  skip new BiF test for ASAN CI runs
  btest update to include recursive value that doesn't require a record
  to avoid recursion, track all aggregates, not just records isolate the internal methods
  simpler public calling interface for computing footprint
  use stack-based set to prevent infinite recursion rather than a static one
  change value_footprint() to val_footprint() to be more similar to val_size()
  make including count of container elements non-optional
  btest for mutually-recursive case
  fix for tracking footprints of mutually-recursive records
  added value_footprint() and global_container_footprints() BiFs
2022-05-06 11:32:49 -07:00
Vern Paxson
58cdc0be09 to avoid recursion, track all aggregates, not just records
isolate the internal methods
2022-05-05 16:51:59 -07:00
Vern Paxson
15123b6768 use stack-based set to prevent infinite recursion rather than a static one 2022-05-02 14:16:20 -07:00
Vern Paxson
f7581437d9 fix for sets containing recursive records 2022-05-02 13:19:58 -07:00
Vern Paxson
edf276520a make including count of container elements non-optional 2022-04-29 09:03:35 -07:00
Vern Paxson
5a1c33ed4a fix for tracking footprints of mutually-recursive records 2022-04-29 08:44:34 -07:00
Vern Paxson
16c37034de added value_footprint() and global_container_footprints() BiFs 2022-04-28 16:42:14 -07:00
Christian Kreibich
76ff976e83 Avoid whitespace around function type strings in JSON rendering
Callable types were rendered with a trailing "\n" in to_json() output. Tweaking
the Describe() calls to stop producing the newline is prone to test failures, so
this focuses on the JSON string production to suppress it, which doesn't affect
any tests.
2022-04-15 18:51:56 -07:00
Vern Paxson
18fe9d84f6 bug fix for empty table constructors with &default attributes (plus a typo) 2022-03-31 19:28:23 -07:00
Vern Paxson
c3e2871a5e simplification of Val classes now that they don't have to support initialization 2022-03-23 15:36:35 -07:00
Robin Sommer
5f1f005142
Merge remote-tracking branch 'origin/topic/neverlord/hide-caf'
* origin/topic/neverlord/hide-caf:
  Fix GCC builds and string output for Broker errors
  Update to latest Broker without public CAF dep
2022-02-07 16:25:22 +01:00
Tim Wojtulewicz
4f470c24ed String/StringVal: Replace char*/string constructors with string_view 2022-02-04 13:52:04 -07:00
Tim Wojtulewicz
0793a38cc5 Merge remote-tracking branch 'origin/topic/vern/vec-slice-bug'
* origin/topic/vern/vec-slice-bug:
  btest to catch vector slice assignment issues
  bug fix for vector slice assignment
2022-01-25 13:52:19 -07:00
Vern Paxson
63bfae180a bug fix for vector slice assignment 2022-01-25 10:47:15 -08:00
Johanna Amann
becc966106 Merge remote-tracking branch 'origin/topic/vern/vec-del-bug'
* origin/topic/vern/vec-del-bug:
  new btest to catch regressions to previous behavior/crash
  fix for adding a non-managed type to an empty vector
2022-01-17 10:35:51 +00:00
Johanna Amann
3a3f9af40d Make some StringVal functions const
I noticed these while working on the TLS changes - I do not see a good
reason why they should not be const.
2022-01-14 11:04:11 +00:00
Vern Paxson
57f6487111 fix for adding a non-managed type to an empty vector 2022-01-12 09:39:02 -08:00
Tim Wojtulewicz
edf90a51e4 GH-1624: Migrate check_and_promote and a few Expr methods to IntrusivePtr 2022-01-07 12:33:54 -07:00
Dominik Charousset
56f30b500a Update to latest Broker without public CAF dep 2021-12-20 08:16:21 +01:00
Vern Paxson
06bbd167cd fixes for constructing and assigning records with fields that are empty vectors 2021-11-24 11:16:33 -08:00
Yacin Nadji
96c45a6c93 Remove unused tbl 2021-11-03 15:44:55 -04:00
Yacin Nadji
aacb812b9a Fix C++ Intersection code 2021-11-03 14:26:31 -04:00
Tim Wojtulewicz
9af6b2f48d clang-format: Set penalty for breaking after assignment operator 2021-09-27 10:49:48 -07:00
Tim Wojtulewicz
4423574d26 clang-format: Set IndentCaseBlocks to false 2021-09-27 10:49:48 -07:00
Tim Wojtulewicz
9cb54f5d44 clang-format: Force zeek-config.h to be earlier in the config ordering 2021-09-25 11:52:55 -07:00
Christian Kreibich
b6a11a69db Add debug string and ODesc support to HashKey class
This allows tracing of hash key buffer reservations, reads, and writes via a new
debug stream, and supports printing a summary of a HashKey object via
Describe(). The latter comes in handy e.g. in TableVal::Describe() (where
including the hash key is now available but commented out).
2021-09-20 17:51:43 -07:00
Tim Wojtulewicz
b2f171ec69 Reformat the world 2021-09-16 15:35:39 -07:00
Vern Paxson
a67897135e factoring out logic to check for overflows during coercions 2021-09-08 10:23:39 -07:00
Tim Wojtulewicz
802dfd80c1 Fix failing test due to patricia change 2021-07-23 12:26:09 -07:00
Johanna Amann
13cfa4c938 Fix handling of timers when cloning TableVals
When cloning TableVals, a new timer was created for the wrong object
(the existing TableVal, not the clone). This lead to the already
existing timer being no longer accessible. Which, in turn, leads to an
abandoned timer reading into no longer allocated data when the original
TableVal is deleted.

Fixes GH-1687
2021-07-21 12:52:22 +01:00
Johanna Amann
e4b2fa50a9 Merge remote-tracking branch 'origin/master' into topic/johanna/gh-859 2021-06-29 15:09:56 +01:00
Johanna Amann
833168090a Add ability to check if hostname is valid for a specific cert
This commit adds two new bifs, x509_check_hostname and
x509_check_cert_hostname. These bifs can be used to check if a given
hostname which can, e.g., be sent in a SNI is valid for a specific
certificate.

This PR furthermore modifies the ssl logs again, and adds information
about this to the log-file. Furthermore we now by default remove the
server certificate information from ssl.log - I doubt that this is often
looked at, it is not present in TLS 1.3, we do still have the SNI, and
if you need it you have the information in x509.log.

This also fixes a small potential problem in X509.cc assuming there
might be SAN-entries that contain null-bytes.

Baseline update will follow in another commit.
2021-06-29 15:00:48 +01:00
Tim Wojtulewicz
a7fd34375f GH-572: Mark MemoryAllocation() and related methods deprecated 2021-06-28 11:07:58 -07:00
Vern Paxson
099dc99d2b fix for cloning records with fields of type "any" 2021-06-01 08:52:24 -07:00
Vern Paxson
d524318154 faster construction of records by factoring static decisions into RecordType's 2021-05-30 18:25:15 -07:00
Vern Paxson
e06d988bfd support for constructing VectorVal's directly from underlying ZVal vectors 2021-05-30 17:58:53 -07:00
Vern Paxson
fb01f6fdef support for ensuring that a vector can be treated as having a homogeneous type 2021-05-30 17:55:03 -07:00
Vern Paxson
a16a25efbd fixed / removed out-of-date comments, tidied check_and_promote_args() interface 2021-05-30 17:25:40 -07:00
Vern Paxson
f2f041b63b various accessors used by ZAM compiler 2021-05-30 17:16:03 -07:00
Vern Paxson
09dc074a26 switched RecordVal's to use std::optional for tracking missing fields 2021-05-02 12:33:20 -07:00
Jon Siwek
d51bd4bc46 Fix using clear_table() within an &expire_func
This previously crashed since clear_table()/TableVal::RemoveAll() left
behind a stale iterator to the old table causing a heap-use-after-free
when resuming table expiry iteration in TableVal::DoExpire().
2021-04-26 22:49:44 -07:00
Jon Siwek
76483a9efa Remove saving/restoring of value pointer after calling expire_func
It's no longer used for anything.  Previously, it was used to detect
whether the expiry batch finished iterating the entire table or not, but
that's now determined by directly checking if the iterator itself
signifies the end of the table.
2021-04-26 22:31:24 -07:00
Jon Siwek
f28a648057 Avoid allocating a HashKey for no-op table expiry iterations 2021-04-26 22:07:13 -07:00
Jon Siwek
e8247c2472 Merge remote-tracking branch 'origin/topic/vern/vector-holes'
* origin/topic/vern/vector-holes:
  Remove NEWS entry regarding changed vector-holes functionality
  Fix potential segfaults in VectorVal Insert/Remove methods
  Fix copy() to work with a vector that has trailing holes
  update test suite for vector holes now being supported for numeric types
  add vector tests for creating holes, "in" operator, "?" operator, copying vectors with holes
  restore support for vectors with holes remove vestigial comment
  fix using ++/-- to vectors that contain holes
2021-04-20 14:43:01 -07:00
Jon Siwek
fd5cdbbe50 Fix potential segfaults in VectorVal Insert/Remove methods
The existence/hole check for managed types was needed to prevent
accessing a nil-optional value.
2021-04-19 19:29:37 -07:00
Jon Siwek
819fc1aac0 Fix copy() to work with a vector that has trailing holes
Previously, the trailing holes would not be preserved in the copy.
2021-04-19 19:23:04 -07:00