Merge remote-tracking branch 'origin/topic/jsiwek/fuzzing'

* origin/topic/jsiwek/fuzzing:
  Use zeek::detail namespace for fuzzer utils
  Set terminating flag during fuzzer cleanup
  Add missing include to standalone fuzzer driver
  Improve standalone fuzzer driver error messages
  Test fuzzers against seed corpus under CI ASan build
  Update fuzzing README with OSS-Fuzz integration notes
  Link fuzzers against shared library to reduce executable sizes
  Improve FuzzBuffer chunking
  Fix compiler warning in standalone fuzzer driver
  Adjust minor fuzzing documentation
  Exit immediately after running unit tests
  Add OSS-Fuzz Zeek script search path to fuzzers
  Assume libFuzzer when LIB_FUZZING_ENGINE file doesn't exist
  Change handling of LIB_FUZZING_ENGINE
  Change --enable-fuzzing to --enable-fuzzers
  Add standalone driver for fuzz targets
  Add basic structure for fuzzing targets
This commit is contained in:
Tim Wojtulewicz 2020-05-12 18:52:19 -07:00
commit 82978a8860
30 changed files with 1701 additions and 930 deletions

View file

@ -124,10 +124,10 @@ static std::string RenderMessage(const broker::error& e)
#endif
Manager::Manager(bool arg_reading_pcaps)
Manager::Manager(bool arg_use_real_time)
{
bound_port = 0;
reading_pcaps = arg_reading_pcaps;
use_real_time = arg_use_real_time;
after_zeek_init = false;
peer_count = 0;
log_batch_size = 0;
@ -166,7 +166,7 @@ void Manager::InitPostScript()
broker::broker_options options;
options.disable_ssl = get_option("Broker::disable_ssl")->AsBool();
options.forward = get_option("Broker::forward_messages")->AsBool();
options.use_real_time = ! reading_pcaps;
options.use_real_time = use_real_time;
BrokerConfig config{std::move(options)};
@ -283,6 +283,14 @@ void Manager::FlushPendingQueries()
}
}
void Manager::ClearStores()
{
FlushPendingQueries();
for ( const auto& [name, handle] : data_stores )
handle->store.clear();
}
uint16_t Manager::Listen(const string& addr, uint16_t port)
{
if ( bstate->endpoint.is_shutdown() )