From 9f7d0a93ebf0e9af28c951c2abadb6b6da902070 Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Wed, 23 Oct 2024 16:40:32 +0300 Subject: [#3605] Specialize HTTP fuzzers into v4 and v6 --- fuzz/.gitignore | 3 +- fuzz/Makefile.am | 13 +- fuzz/fuzz_http_endpoint.cc | 175 ----------------- fuzz/fuzz_http_endpoint_kea_dhcp4.cc | 212 ++++++++++++++++++++ fuzz/fuzz_http_endpoint_kea_dhcp6.cc | 218 +++++++++++++++++++++ fuzz/input/Makefile.am | 70 ++++--- fuzz/input/fuzz-config-kea-dhcp4/doc-examples | 1 - fuzz/input/fuzz-config-kea-dhcp4/empty | 0 fuzz/input/fuzz-config-kea-dhcp4/one-byte | 1 - fuzz/input/fuzz-config-kea-dhcp6/doc-examples | 1 - fuzz/input/fuzz-config-kea-dhcp6/empty | 0 fuzz/input/fuzz-config-kea-dhcp6/one-byte | 1 - fuzz/input/fuzz-http-endpoint/config-get | 3 - .../fuzz-http-endpoint/config-get-with-service | 4 - fuzz/input/fuzz-http-endpoint/empty | 0 fuzz/input/fuzz-http-endpoint/empty-json-map | 1 - fuzz/input/fuzz-http-endpoint/one-byte | 1 - fuzz/input/fuzz-http-endpoint/one-entry-json-map | 3 - .../input/fuzz-packets-kea-dhcp4/dhcp-payload-only | 1 - fuzz/input/fuzz-packets-kea-dhcp4/empty | 0 fuzz/input/fuzz-packets-kea-dhcp4/full-dhcp-packet | 1 - fuzz/input/fuzz-packets-kea-dhcp4/one-byte | 1 - fuzz/input/fuzz-packets-kea-dhcp4/udp-header | 1 - .../input/fuzz-packets-kea-dhcp6/dhcp-payload-only | 1 - fuzz/input/fuzz-packets-kea-dhcp6/empty | 0 fuzz/input/fuzz-packets-kea-dhcp6/full-dhcp-packet | 1 - fuzz/input/fuzz-packets-kea-dhcp6/one-byte | 1 - fuzz/input/fuzz-packets-kea-dhcp6/udp-header | 1 - fuzz/input/fuzz-unix-socket-kea-dhcp4/config-get | 3 - .../config-get-with-service | 4 - fuzz/input/fuzz-unix-socket-kea-dhcp4/empty | 0 .../fuzz-unix-socket-kea-dhcp4/empty-json-map | 1 - fuzz/input/fuzz-unix-socket-kea-dhcp4/one-byte | 1 - .../fuzz-unix-socket-kea-dhcp4/one-entry-json-map | 3 - fuzz/input/fuzz-unix-socket-kea-dhcp6/config-get | 3 - .../config-get-with-service | 4 - fuzz/input/fuzz-unix-socket-kea-dhcp6/empty | 0 .../fuzz-unix-socket-kea-dhcp6/empty-json-map | 1 - fuzz/input/fuzz-unix-socket-kea-dhcp6/one-byte | 1 - .../fuzz-unix-socket-kea-dhcp6/one-entry-json-map | 3 - fuzz/input/fuzz_config_kea_dhcp4/doc-examples | 1 + fuzz/input/fuzz_config_kea_dhcp4/empty | 0 fuzz/input/fuzz_config_kea_dhcp4/one-byte | 1 + fuzz/input/fuzz_config_kea_dhcp6/doc-examples | 1 + fuzz/input/fuzz_config_kea_dhcp6/empty | 0 fuzz/input/fuzz_config_kea_dhcp6/one-byte | 1 + fuzz/input/fuzz_http_endpoint_kea_dhcp4/config-get | 3 + .../config-get-with-service | 4 + fuzz/input/fuzz_http_endpoint_kea_dhcp4/empty | 0 .../fuzz_http_endpoint_kea_dhcp4/empty-json-map | 1 + fuzz/input/fuzz_http_endpoint_kea_dhcp4/one-byte | 1 + .../one-entry-json-map | 3 + fuzz/input/fuzz_http_endpoint_kea_dhcp6/config-get | 3 + .../config-get-with-service | 4 + fuzz/input/fuzz_http_endpoint_kea_dhcp6/empty | 0 .../fuzz_http_endpoint_kea_dhcp6/empty-json-map | 1 + fuzz/input/fuzz_http_endpoint_kea_dhcp6/one-byte | 1 + .../one-entry-json-map | 3 + .../input/fuzz_packets_kea_dhcp4/dhcp-payload-only | 1 + fuzz/input/fuzz_packets_kea_dhcp4/empty | 0 fuzz/input/fuzz_packets_kea_dhcp4/full-dhcp-packet | 1 + fuzz/input/fuzz_packets_kea_dhcp4/one-byte | 1 + fuzz/input/fuzz_packets_kea_dhcp4/udp-header | 1 + .../input/fuzz_packets_kea_dhcp6/dhcp-payload-only | 1 + fuzz/input/fuzz_packets_kea_dhcp6/empty | 0 fuzz/input/fuzz_packets_kea_dhcp6/full-dhcp-packet | 1 + fuzz/input/fuzz_packets_kea_dhcp6/one-byte | 1 + fuzz/input/fuzz_packets_kea_dhcp6/udp-header | 1 + fuzz/input/fuzz_unix_socket_kea_dhcp4/config-get | 3 + .../config-get-with-service | 4 + fuzz/input/fuzz_unix_socket_kea_dhcp4/empty | 0 .../fuzz_unix_socket_kea_dhcp4/empty-json-map | 1 + fuzz/input/fuzz_unix_socket_kea_dhcp4/one-byte | 1 + .../fuzz_unix_socket_kea_dhcp4/one-entry-json-map | 3 + fuzz/input/fuzz_unix_socket_kea_dhcp6/config-get | 3 + .../config-get-with-service | 4 + fuzz/input/fuzz_unix_socket_kea_dhcp6/empty | 0 .../fuzz_unix_socket_kea_dhcp6/empty-json-map | 1 + fuzz/input/fuzz_unix_socket_kea_dhcp6/one-byte | 1 + .../fuzz_unix_socket_kea_dhcp6/one-entry-json-map | 3 + fuzz/tests/Makefile.am | 15 +- fuzz/tests/setup.sh | 1 - fuzz/tests/test-fuzz-config-kea-dhcp4.sh | 11 -- fuzz/tests/test-fuzz-config-kea-dhcp6.sh | 11 -- fuzz/tests/test-fuzz-http-endpoint.sh | 11 -- fuzz/tests/test-fuzz-packets-kea-dhcp4.sh | 11 -- fuzz/tests/test-fuzz-packets-kea-dhcp6.sh | 11 -- fuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh | 11 -- fuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh | 11 -- fuzz/tests/test_fuzz_config_kea_dhcp4.sh | 11 ++ fuzz/tests/test_fuzz_config_kea_dhcp6.sh | 11 ++ fuzz/tests/test_fuzz_http_endpoint_kea_dhcp4.sh | 11 ++ fuzz/tests/test_fuzz_http_endpoint_kea_dhcp6.sh | 11 ++ fuzz/tests/test_fuzz_packets_kea_dhcp4.sh | 11 ++ fuzz/tests/test_fuzz_packets_kea_dhcp6.sh | 11 ++ fuzz/tests/test_fuzz_unix_socket_kea_dhcp4.sh | 11 ++ fuzz/tests/test_fuzz_unix_socket_kea_dhcp6.sh | 11 ++ 97 files changed, 635 insertions(+), 345 deletions(-) delete mode 100644 fuzz/fuzz_http_endpoint.cc create mode 100644 fuzz/fuzz_http_endpoint_kea_dhcp4.cc create mode 100644 fuzz/fuzz_http_endpoint_kea_dhcp6.cc delete mode 120000 fuzz/input/fuzz-config-kea-dhcp4/doc-examples delete mode 100644 fuzz/input/fuzz-config-kea-dhcp4/empty delete mode 100644 fuzz/input/fuzz-config-kea-dhcp4/one-byte delete mode 120000 fuzz/input/fuzz-config-kea-dhcp6/doc-examples delete mode 100644 fuzz/input/fuzz-config-kea-dhcp6/empty delete mode 100644 fuzz/input/fuzz-config-kea-dhcp6/one-byte delete mode 100644 fuzz/input/fuzz-http-endpoint/config-get delete mode 100644 fuzz/input/fuzz-http-endpoint/config-get-with-service delete mode 100644 fuzz/input/fuzz-http-endpoint/empty delete mode 100644 fuzz/input/fuzz-http-endpoint/empty-json-map delete mode 100644 fuzz/input/fuzz-http-endpoint/one-byte delete mode 100644 fuzz/input/fuzz-http-endpoint/one-entry-json-map delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp4/dhcp-payload-only delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp4/empty delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp4/full-dhcp-packet delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp4/one-byte delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp4/udp-header delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp6/dhcp-payload-only delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp6/empty delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp6/full-dhcp-packet delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp6/one-byte delete mode 100644 fuzz/input/fuzz-packets-kea-dhcp6/udp-header delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp4/config-get delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp4/config-get-with-service delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp4/empty delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp4/empty-json-map delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp4/one-byte delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp4/one-entry-json-map delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp6/config-get delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp6/config-get-with-service delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp6/empty delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp6/empty-json-map delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp6/one-byte delete mode 100644 fuzz/input/fuzz-unix-socket-kea-dhcp6/one-entry-json-map create mode 120000 fuzz/input/fuzz_config_kea_dhcp4/doc-examples create mode 100644 fuzz/input/fuzz_config_kea_dhcp4/empty create mode 100644 fuzz/input/fuzz_config_kea_dhcp4/one-byte create mode 120000 fuzz/input/fuzz_config_kea_dhcp6/doc-examples create mode 100644 fuzz/input/fuzz_config_kea_dhcp6/empty create mode 100644 fuzz/input/fuzz_config_kea_dhcp6/one-byte create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp4/config-get create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp4/config-get-with-service create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp4/empty create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp4/empty-json-map create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp4/one-byte create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp4/one-entry-json-map create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp6/config-get create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp6/config-get-with-service create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp6/empty create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp6/empty-json-map create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp6/one-byte create mode 100644 fuzz/input/fuzz_http_endpoint_kea_dhcp6/one-entry-json-map create mode 100644 fuzz/input/fuzz_packets_kea_dhcp4/dhcp-payload-only create mode 100644 fuzz/input/fuzz_packets_kea_dhcp4/empty create mode 100644 fuzz/input/fuzz_packets_kea_dhcp4/full-dhcp-packet create mode 100644 fuzz/input/fuzz_packets_kea_dhcp4/one-byte create mode 100644 fuzz/input/fuzz_packets_kea_dhcp4/udp-header create mode 100644 fuzz/input/fuzz_packets_kea_dhcp6/dhcp-payload-only create mode 100644 fuzz/input/fuzz_packets_kea_dhcp6/empty create mode 100644 fuzz/input/fuzz_packets_kea_dhcp6/full-dhcp-packet create mode 100644 fuzz/input/fuzz_packets_kea_dhcp6/one-byte create mode 100644 fuzz/input/fuzz_packets_kea_dhcp6/udp-header create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp4/config-get create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp4/config-get-with-service create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp4/empty create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp4/empty-json-map create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp4/one-byte create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp4/one-entry-json-map create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp6/config-get create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp6/config-get-with-service create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp6/empty create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp6/empty-json-map create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp6/one-byte create mode 100644 fuzz/input/fuzz_unix_socket_kea_dhcp6/one-entry-json-map delete mode 120000 fuzz/tests/setup.sh delete mode 100755 fuzz/tests/test-fuzz-config-kea-dhcp4.sh delete mode 100755 fuzz/tests/test-fuzz-config-kea-dhcp6.sh delete mode 100755 fuzz/tests/test-fuzz-http-endpoint.sh delete mode 100755 fuzz/tests/test-fuzz-packets-kea-dhcp4.sh delete mode 100755 fuzz/tests/test-fuzz-packets-kea-dhcp6.sh delete mode 100755 fuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh delete mode 100755 fuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh create mode 100755 fuzz/tests/test_fuzz_config_kea_dhcp4.sh create mode 100755 fuzz/tests/test_fuzz_config_kea_dhcp6.sh create mode 100755 fuzz/tests/test_fuzz_http_endpoint_kea_dhcp4.sh create mode 100755 fuzz/tests/test_fuzz_http_endpoint_kea_dhcp6.sh create mode 100755 fuzz/tests/test_fuzz_packets_kea_dhcp4.sh create mode 100755 fuzz/tests/test_fuzz_packets_kea_dhcp6.sh create mode 100755 fuzz/tests/test_fuzz_unix_socket_kea_dhcp4.sh create mode 100755 fuzz/tests/test_fuzz_unix_socket_kea_dhcp6.sh (limited to 'fuzz') diff --git a/fuzz/.gitignore b/fuzz/.gitignore index 49369083ff..ecbfbbdc91 100644 --- a/fuzz/.gitignore +++ b/fuzz/.gitignore @@ -1,6 +1,7 @@ /fuzz_config_kea_dhcp4 /fuzz_config_kea_dhcp6 -/fuzz_http_endpoint +/fuzz_http_endpoint_kea_dhcp4 +/fuzz_http_endpoint_kea_dhcp6 /fuzz_packets_kea_dhcp4 /fuzz_packets_kea_dhcp6 /fuzz_unix_socket_kea_dhcp4 diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am index 16da3af0b7..81d864559a 100644 --- a/fuzz/Makefile.am +++ b/fuzz/Makefile.am @@ -20,7 +20,8 @@ CLEANFILES = *.gcno *.gcda sbin_PROGRAMS = sbin_PROGRAMS += fuzz_config_kea_dhcp4 sbin_PROGRAMS += fuzz_config_kea_dhcp6 -sbin_PROGRAMS += fuzz_http_endpoint +sbin_PROGRAMS += fuzz_http_endpoint_kea_dhcp4 +sbin_PROGRAMS += fuzz_http_endpoint_kea_dhcp6 sbin_PROGRAMS += fuzz_packets_kea_dhcp4 sbin_PROGRAMS += fuzz_packets_kea_dhcp6 sbin_PROGRAMS += fuzz_unix_socket_kea_dhcp4 @@ -65,9 +66,13 @@ fuzz_config_kea_dhcp6_SOURCES = $(common_sources) fuzz_config_kea_dhcp6_SOURCES += fuzz_config_kea_dhcp6.cc fuzz_config_kea_dhcp6_LDADD = $(V6_LDADD) $(LDADD) -fuzz_http_endpoint_SOURCES = $(common_sources) -fuzz_http_endpoint_SOURCES += fuzz_http_endpoint.cc -fuzz_http_endpoint_LDADD = $(LDADD) +fuzz_http_endpoint_kea_dhcp4_SOURCES = $(common_sources) +fuzz_http_endpoint_kea_dhcp4_SOURCES += fuzz_http_endpoint_kea_dhcp4.cc +fuzz_http_endpoint_kea_dhcp4_LDADD = $(V4_LDADD) $(LDADD) + +fuzz_http_endpoint_kea_dhcp6_SOURCES = $(common_sources) +fuzz_http_endpoint_kea_dhcp6_SOURCES += fuzz_http_endpoint_kea_dhcp6.cc +fuzz_http_endpoint_kea_dhcp6_LDADD = $(V6_LDADD) $(LDADD) fuzz_packets_kea_dhcp4_SOURCES = $(common_sources) fuzz_packets_kea_dhcp4_SOURCES += fuzz_packets_kea_dhcp4.cc diff --git a/fuzz/fuzz_http_endpoint.cc b/fuzz/fuzz_http_endpoint.cc deleted file mode 100644 index ddddd77f8d..0000000000 --- a/fuzz/fuzz_http_endpoint.cc +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (C) 2024 Internet Systems Consortium, Inc. ("ISC") -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace isc::asiolink; -using namespace isc::config; -using namespace isc::data; -using namespace isc::process; -using namespace isc::http; -using namespace isc::http::test; -using namespace isc::util; -using namespace std; - -namespace { - -void timeoutHandler() { - cerr << "Timeout occurred while fuzzing!" << endl; - abort(); -} - -/// @brief Represents HTTP POST request with JSON body. -/// -/// In addition to the requirements specified by the @ref PostHttpRequest -/// this class requires that the "Content-Type" is "application/json". -/// -/// This class provides methods to parse and retrieve JSON data structures. -struct PostHttpRequestBytes : PostHttpRequest { - /// @brief Constructor for inbound HTTP request. - explicit PostHttpRequestBytes() : PostHttpRequest() { - requireHeaderValue("Content-Type", "application/json"); - } - - /// @brief Constructor for outbound HTTP request. - /// - /// This constructor adds "Content-Type" header with the value of - /// "application/json" to the context. - /// - /// @param method HTTP method, e.g. POST. - /// @param uri URI. - /// @param version HTTP version. - /// @param host_header Host header to be included in the request. The default - /// is the empty Host header. - /// @param basic_auth Basic HTTP authentication credential. The default - /// is no authentication. - explicit PostHttpRequestBytes(const Method& method, - const string& uri, - const HttpVersion& version, - const HostHttpHeader& host_header = HostHttpHeader(), - const BasicHttpAuthPtr& basic_auth = BasicHttpAuthPtr()) - : PostHttpRequest(method, uri, version, host_header, basic_auth) { - requireHeaderValue("Content-Type", "application/json"); - context()->headers_.push_back(HttpHeaderContext("Content-Type", "application/json")); - } - - /// @brief Sets JSON body for an outbound message. - /// - /// @param body JSON structure to be used as a body. - void setBodyAsBytes(vector const& input) { - context_->body_ = string(input.begin(), input.end()); - } -}; - -using PostHttpRequestBytesPtr = boost::shared_ptr; - -ThreadPool> THREAD_POOL; - -static pid_t const PID(getpid()); -static string const PID_STR(to_string(PID)); - -} // namespace - -extern "C" { - -int -LLVMFuzzerInitialize() { - static bool initialized(DoInitialization()); - assert(initialized); - - return 0; -} - -int -LLVMFuzzerTearDown() { - return 0; -} - -int -LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) { - string const address("127.0.0.1"); - int const port(18000); - int const timeout(100000); - - CmdHttpListener listener(IOAddress(address), port); - MultiThreadingMgr::instance().setMode(true); - - // Start the server. - listener.start(); - - // Create a client and specify the URL on which the server can be reached. - IOServicePtr io_service(new IOService()); - IntervalTimer run_io_service_timer(io_service); - HttpClient client(io_service, false); - stringstream ss; - ss << "http://" << address << ":" << port; - Url url(ss.str()); - - // Initiate request to the server. - PostHttpRequestBytesPtr request(new PostHttpRequestBytes( - HttpRequest::Method::HTTP_POST, "/", HttpVersion(1, 1))); - - // Body is a map with a specified parameter included. - vector const body(data, data + size); - request->setBodyAsBytes(body); - request->finalize(); - HttpResponseJsonPtr response(new HttpResponseJson()); - client.asyncSendRequest( - url, TlsContextPtr(), request, response, - [](boost::system::error_code const&, - HttpResponsePtr const&, - string const&) { - }); - - // Actually trigger the requests. The requests should be handlded by the - // server one after another. While the first request is being processed - // the server should queue another one. - io_service->getInternalIOService().reset(); - run_io_service_timer.setup(&timeoutHandler, timeout, IntervalTimer::ONE_SHOT); - io_service->runOne(); - io_service->getInternalIOService().reset(); - io_service->poll(); - - // Make sure that the received responses are different. We check that by - // comparing value of the sequence parameters. - if (getenv("DEBUG")) { - if (response) { - cout << response->getBody() << endl; - } else { - cout << "no response" << endl; - } - } - listener.stop(); - client.stop(); - run_io_service_timer.cancel(); - io_service->poll(); - MultiThreadingMgr::instance().setMode(false); - - return 0; -} - -} // extern "C" diff --git a/fuzz/fuzz_http_endpoint_kea_dhcp4.cc b/fuzz/fuzz_http_endpoint_kea_dhcp4.cc new file mode 100644 index 0000000000..5fae753fd8 --- /dev/null +++ b/fuzz/fuzz_http_endpoint_kea_dhcp4.cc @@ -0,0 +1,212 @@ +// Copyright (C) 2024 Internet Systems Consortium, Inc. ("ISC") +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace isc::asiolink; +using namespace isc::config; +using namespace isc::data; +using namespace isc::dhcp; +using namespace isc::process; +using namespace isc::http; +using namespace isc::http::test; +using namespace isc::util; +using namespace std; + +namespace { + +static pid_t const PID(getpid()); +static int const PORT(getpid() % 1000 + 2000); +static string const PID_STR(to_string(PID)); +static string const PORT_STR(to_string(PORT)); +static string const KEA_DHCP4_CONF(KEA_FUZZ_DIR + "/kea-dhcp4-" + PID_STR + ".conf"); +static string const KEA_DHCP4_CSV(KEA_FUZZ_DIR + "/kea-dhcp4-" + PID_STR + ".csv"); + +void timeoutHandler() { + cerr << "Timeout occurred while fuzzing!" << endl; + abort(); +} + +/// @brief Represents HTTP POST request with JSON body. +/// +/// In addition to the requirements specified by the @ref PostHttpRequest +/// this class requires that the "Content-Type" is "application/json". +/// +/// This class provides methods to parse and retrieve JSON data structures. +struct PostHttpRequestBytes : PostHttpRequest { + /// @brief Constructor for inbound HTTP request. + explicit PostHttpRequestBytes() : PostHttpRequest() { + requireHeaderValue("Content-Type", "application/json"); + } + + /// @brief Constructor for outbound HTTP request. + /// + /// This constructor adds "Content-Type" header with the value of + /// "application/json" to the context. + /// + /// @param method HTTP method, e.g. POST. + /// @param uri URI. + /// @param version HTTP version. + /// @param host_header Host header to be included in the request. The default + /// is the empty Host header. + /// @param basic_auth Basic HTTP authentication credential. The default + /// is no authentication. + explicit PostHttpRequestBytes(const Method& method, + const string& uri, + const HttpVersion& version, + const HostHttpHeader& host_header = HostHttpHeader(), + const BasicHttpAuthPtr& basic_auth = BasicHttpAuthPtr()) + : PostHttpRequest(method, uri, version, host_header, basic_auth) { + requireHeaderValue("Content-Type", "application/json"); + context()->headers_.push_back(HttpHeaderContext("Content-Type", "application/json")); + } + + /// @brief Sets JSON body for an outbound message. + /// + /// @param body JSON structure to be used as a body. + void setBodyAsBytes(vector const& input) { + context_->body_ = string(input.begin(), input.end()); + } +}; + +using PostHttpRequestBytesPtr = boost::shared_ptr; + +ThreadPool> THREAD_POOL; + +} // namespace + +extern "C" { + +int +LLVMFuzzerInitialize() { + static bool initialized(DoInitialization()); + assert(initialized); + + writeToFile(KEA_DHCP4_CONF, R"( + { + "Dhcp4": { + "control-sockets": [ + { + "socket-address": "0.0.0.0", + "socket-port": )" + PORT_STR + R"(, + "socket-type": "http" + } + ], + "lease-database": { + "name": ")" + KEA_DHCP4_CSV + R"(", + "type": "memfile" + } + } + } + )"); + + return 0; +} + +int +LLVMFuzzerTearDown() { + try { + remove(KEA_DHCP4_CONF.c_str()); + } catch (...) { + } + try { + remove(KEA_DHCP4_CSV.c_str()); + } catch (...) { + } + return 0; +} + +int +LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) { + CfgMgr::instance().clear(); + ControlledDhcpv4Srv server; + server.init(KEA_DHCP4_CONF); + + string const address("127.0.0.1"); + int const port(18000); + int const timeout(100000); + + CmdHttpListener listener(IOAddress(address), port); + MultiThreadingMgr::instance().setMode(true); + + // Start the server. + listener.start(); + + // Create a client and specify the URL on which the server can be reached. + IOServicePtr io_service(new IOService()); + IntervalTimer run_io_service_timer(io_service); + HttpClient client(io_service, false); + stringstream ss; + ss << "http://" << address << ":" << port; + Url url(ss.str()); + + // Initiate request to the server. + PostHttpRequestBytesPtr request(new PostHttpRequestBytes( + HttpRequest::Method::HTTP_POST, "/", HttpVersion(1, 1))); + + // Body is a map with a specified parameter included. + vector const body(data, data + size); + request->setBodyAsBytes(body); + request->finalize(); + HttpResponseJsonPtr response(new HttpResponseJson()); + client.asyncSendRequest( + url, TlsContextPtr(), request, response, + [](boost::system::error_code const&, + HttpResponsePtr const&, + string const&) { + }); + + // Actually trigger the requests. The requests should be handlded by the + // server one after another. While the first request is being processed + // the server should queue another one. + io_service->getInternalIOService().reset(); + run_io_service_timer.setup(&timeoutHandler, timeout, IntervalTimer::ONE_SHOT); + io_service->runOne(); + io_service->getInternalIOService().reset(); + io_service->poll(); + + // Make sure that the received responses are different. We check that by + // comparing value of the sequence parameters. + if (getenv("DEBUG")) { + if (response) { + cout << response->getBody() << endl; + } else { + cout << "no response" << endl; + } + } + listener.stop(); + client.stop(); + run_io_service_timer.cancel(); + io_service->poll(); + MultiThreadingMgr::instance().setMode(false); + + return 0; +} + +} // extern "C" diff --git a/fuzz/fuzz_http_endpoint_kea_dhcp6.cc b/fuzz/fuzz_http_endpoint_kea_dhcp6.cc new file mode 100644 index 0000000000..be2c78dbb1 --- /dev/null +++ b/fuzz/fuzz_http_endpoint_kea_dhcp6.cc @@ -0,0 +1,218 @@ +// Copyright (C) 2024 Internet Systems Consortium, Inc. ("ISC") +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace isc::asiolink; +using namespace isc::config; +using namespace isc::data; +using namespace isc::dhcp; +using namespace isc::process; +using namespace isc::http; +using namespace isc::http::test; +using namespace isc::util; +using namespace std; + +namespace { + +static pid_t const PID(getpid()); +static int const PORT(getpid() % 1000 + 2000); +static string const PID_STR(to_string(PID)); +static string const PORT_STR(to_string(PORT)); +static string const KEA_DHCP6_CONF(KEA_FUZZ_DIR + "/kea-dhcp6-" + PID_STR + ".conf"); +static string const KEA_DHCP6_CSV(KEA_FUZZ_DIR + "/kea-dhcp6-" + PID_STR + ".csv"); + +void timeoutHandler() { + cerr << "Timeout occurred while fuzzing!" << endl; + abort(); +} + +/// @brief Represents HTTP POST request with JSON body. +/// +/// In addition to the requirements specified by the @ref PostHttpRequest +/// this class requires that the "Content-Type" is "application/json". +/// +/// This class provides methods to parse and retrieve JSON data structures. +struct PostHttpRequestBytes : PostHttpRequest { + /// @brief Constructor for inbound HTTP request. + explicit PostHttpRequestBytes() : PostHttpRequest() { + requireHeaderValue("Content-Type", "application/json"); + } + + /// @brief Constructor for outbound HTTP request. + /// + /// This constructor adds "Content-Type" header with the value of + /// "application/json" to the context. + /// + /// @param method HTTP method, e.g. POST. + /// @param uri URI. + /// @param version HTTP version. + /// @param host_header Host header to be included in the request. The default + /// is the empty Host header. + /// @param basic_auth Basic HTTP authentication credential. The default + /// is no authentication. + explicit PostHttpRequestBytes(const Method& method, + const string& uri, + const HttpVersion& version, + const HostHttpHeader& host_header = HostHttpHeader(), + const BasicHttpAuthPtr& basic_auth = BasicHttpAuthPtr()) + : PostHttpRequest(method, uri, version, host_header, basic_auth) { + requireHeaderValue("Content-Type", "application/json"); + context()->headers_.push_back(HttpHeaderContext("Content-Type", "application/json")); + } + + /// @brief Sets JSON body for an outbound message. + /// + /// @param body JSON structure to be used as a body. + void setBodyAsBytes(vector const& input) { + context_->body_ = string(input.begin(), input.end()); + } +}; + +using PostHttpRequestBytesPtr = boost::shared_ptr; + +ThreadPool> THREAD_POOL; + +} // namespace + +extern "C" { + +int +LLVMFuzzerInitialize() { + static bool initialized(DoInitialization()); + assert(initialized); + + writeToFile(KEA_DHCP6_CONF, R"( + { + "Dhcp6": { + "control-sockets": [ + { + "socket-address": "0.0.0.0", + "socket-port": )" + PORT_STR + R"(, + "socket-type": "http" + } + ], + "lease-database": { + "name": ")" + KEA_DHCP6_CSV + R"(", + "type": "memfile" + }, + "server-id": { + "type": "EN", + "enterprise-id": 2495, + "identifier": "0123456789", + "persist": false + } + } + } + )"); + + return 0; +} + +int +LLVMFuzzerTearDown() { + try { + remove(KEA_DHCP6_CONF.c_str()); + } catch (...) { + } + try { + remove(KEA_DHCP6_CSV.c_str()); + } catch (...) { + } + return 0; +} + +int +LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) { + CfgMgr::instance().clear(); + ControlledDhcpv6Srv server; + server.init(KEA_DHCP6_CONF); + + string const address("127.0.0.1"); + int const port(18000); + int const timeout(100000); + + CmdHttpListener listener(IOAddress(address), port); + MultiThreadingMgr::instance().setMode(true); + + // Start the server. + listener.start(); + + // Create a client and specify the URL on which the server can be reached. + IOServicePtr io_service(new IOService()); + IntervalTimer run_io_service_timer(io_service); + HttpClient client(io_service, false); + stringstream ss; + ss << "http://" << address << ":" << port; + Url url(ss.str()); + + // Initiate request to the server. + PostHttpRequestBytesPtr request(new PostHttpRequestBytes( + HttpRequest::Method::HTTP_POST, "/", HttpVersion(1, 1))); + + // Body is a map with a specified parameter included. + vector const body(data, data + size); + request->setBodyAsBytes(body); + request->finalize(); + HttpResponseJsonPtr response(new HttpResponseJson()); + client.asyncSendRequest( + url, TlsContextPtr(), request, response, + [](boost::system::error_code const&, + HttpResponsePtr const&, + string const&) { + }); + + // Actually trigger the requests. The requests should be handlded by the + // server one after another. While the first request is being processed + // the server should queue another one. + io_service->getInternalIOService().reset(); + run_io_service_timer.setup(&timeoutHandler, timeout, IntervalTimer::ONE_SHOT); + io_service->runOne(); + io_service->getInternalIOService().reset(); + io_service->poll(); + + // Make sure that the received responses are different. We check that by + // comparing value of the sequence parameters. + if (getenv("DEBUG")) { + if (response) { + cout << response->getBody() << endl; + } else { + cout << "no response" << endl; + } + } + listener.stop(); + client.stop(); + run_io_service_timer.cancel(); + io_service->poll(); + MultiThreadingMgr::instance().setMode(false); + + return 0; +} + +} // extern "C" diff --git a/fuzz/input/Makefile.am b/fuzz/input/Makefile.am index f1c9e11a64..00de13c91e 100644 --- a/fuzz/input/Makefile.am +++ b/fuzz/input/Makefile.am @@ -5,38 +5,44 @@ if FUZZING fuzzdir = "${datarootdir}/${PACKAGE_NAME}/fuzz" nobase_dist_fuzz_DATA = -nobase_dist_fuzz_DATA += fuzz-config-kea-dhcp4/empty -nobase_dist_fuzz_DATA += fuzz-config-kea-dhcp4/one-byte -nobase_dist_fuzz_DATA += fuzz-config-kea-dhcp6/empty -nobase_dist_fuzz_DATA += fuzz-config-kea-dhcp6/one-byte -nobase_dist_fuzz_DATA += fuzz-http-endpoint/config-get -nobase_dist_fuzz_DATA += fuzz-http-endpoint/config-get-with-service -nobase_dist_fuzz_DATA += fuzz-http-endpoint/empty -nobase_dist_fuzz_DATA += fuzz-http-endpoint/empty-json-map -nobase_dist_fuzz_DATA += fuzz-http-endpoint/one-byte -nobase_dist_fuzz_DATA += fuzz-http-endpoint/one-entry-json-map -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp4/dhcp-payload-only -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp4/empty -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp4/full-dhcp-packet -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp4/one-byte -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp4/udp-header -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp6/dhcp-payload-only -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp6/empty -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp6/full-dhcp-packet -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp6/one-byte -nobase_dist_fuzz_DATA += fuzz-packets-kea-dhcp6/udp-header -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp4/config-get -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp4/config-get-with-service -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp4/empty -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp4/empty-json-map -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp4/one-byte -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp4/one-entry-json-map -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp6/config-get -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp6/config-get-with-service -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp6/empty -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp6/empty-json-map -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp6/one-byte -nobase_dist_fuzz_DATA += fuzz-unix-socket-kea-dhcp6/one-entry-json-map +nobase_dist_fuzz_DATA += fuzz_config_kea_dhcp4/empty +nobase_dist_fuzz_DATA += fuzz_config_kea_dhcp4/one-byte +nobase_dist_fuzz_DATA += fuzz_config_kea_dhcp6/empty +nobase_dist_fuzz_DATA += fuzz_config_kea_dhcp6/one-byte +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp4/config-get +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp4/config-get-with-service +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp4/empty +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp4/empty-json-map +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp4/one-byte +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp4/one-entry-json-map +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp6/config-get +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp6/config-get-with-service +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp6/empty +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp6/empty-json-map +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp6/one-byte +nobase_dist_fuzz_DATA += fuzz_http_endpoint_kea_dhcp6/one-entry-json-map +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp4/dhcp-payload-only +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp4/empty +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp4/full-dhcp-packet +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp4/one-byte +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp4/udp-header +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp6/dhcp-payload-only +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp6/empty +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp6/full-dhcp-packet +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp6/one-byte +nobase_dist_fuzz_DATA += fuzz_packets_kea_dhcp6/udp-header +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp4/config-get +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp4/config-get-with-service +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp4/empty +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp4/empty-json-map +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp4/one-byte +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp4/one-entry-json-map +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp6/config-get +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp6/config-get-with-service +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp6/empty +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp6/empty-json-map +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp6/one-byte +nobase_dist_fuzz_DATA += fuzz_unix_socket_kea_dhcp6/one-entry-json-map nobase_dist_fuzz_DATA += kea-dhcp4.conf nobase_dist_fuzz_DATA += kea-dhcp6.conf diff --git a/fuzz/input/fuzz-config-kea-dhcp4/doc-examples b/fuzz/input/fuzz-config-kea-dhcp4/doc-examples deleted file mode 120000 index 0b5652bef7..0000000000 --- a/fuzz/input/fuzz-config-kea-dhcp4/doc-examples +++ /dev/null @@ -1 +0,0 @@ -../../../doc/examples/kea4 \ No newline at end of file diff --git a/fuzz/input/fuzz-config-kea-dhcp4/empty b/fuzz/input/fuzz-config-kea-dhcp4/empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fuzz/input/fuzz-config-kea-dhcp4/one-byte b/fuzz/input/fuzz-config-kea-dhcp4/one-byte deleted file mode 100644 index 47d26df80d..0000000000 --- a/fuzz/input/fuzz-config-kea-dhcp4/one-byte +++ /dev/null @@ -1 +0,0 @@ -0a \ No newline at end of file diff --git a/fuzz/input/fuzz-config-kea-dhcp6/doc-examples b/fuzz/input/fuzz-config-kea-dhcp6/doc-examples deleted file mode 120000 index 05f98b3048..0000000000 --- a/fuzz/input/fuzz-config-kea-dhcp6/doc-examples +++ /dev/null @@ -1 +0,0 @@ -../../../doc/examples/kea6 \ No newline at end of file diff --git a/fuzz/input/fuzz-config-kea-dhcp6/empty b/fuzz/input/fuzz-config-kea-dhcp6/empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fuzz/input/fuzz-config-kea-dhcp6/one-byte b/fuzz/input/fuzz-config-kea-dhcp6/one-byte deleted file mode 100644 index 47d26df80d..0000000000 --- a/fuzz/input/fuzz-config-kea-dhcp6/one-byte +++ /dev/null @@ -1 +0,0 @@ -0a \ No newline at end of file diff --git a/fuzz/input/fuzz-http-endpoint/config-get b/fuzz/input/fuzz-http-endpoint/config-get deleted file mode 100644 index 7ce1bfffff..0000000000 --- a/fuzz/input/fuzz-http-endpoint/config-get +++ /dev/null @@ -1,3 +0,0 @@ -{ - "command": "config-get" -} diff --git a/fuzz/input/fuzz-http-endpoint/config-get-with-service b/fuzz/input/fuzz-http-endpoint/config-get-with-service deleted file mode 100644 index df926792e3..0000000000 --- a/fuzz/input/fuzz-http-endpoint/config-get-with-service +++ /dev/null @@ -1,4 +0,0 @@ -{ - "command": "config-get", - "service": [ "dhcp6" ] -} diff --git a/fuzz/input/fuzz-http-endpoint/empty b/fuzz/input/fuzz-http-endpoint/empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fuzz/input/fuzz-http-endpoint/empty-json-map b/fuzz/input/fuzz-http-endpoint/empty-json-map deleted file mode 100644 index 0967ef424b..0000000000 --- a/fuzz/input/fuzz-http-endpoint/empty-json-map +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fuzz/input/fuzz-http-endpoint/one-byte b/fuzz/input/fuzz-http-endpoint/one-byte deleted file mode 100644 index 47d26df80d..0000000000 --- a/fuzz/input/fuzz-http-endpoint/one-byte +++ /dev/null @@ -1 +0,0 @@ -0a \ No newline at end of file diff --git a/fuzz/input/fuzz-http-endpoint/one-entry-json-map b/fuzz/input/fuzz-http-endpoint/one-entry-json-map deleted file mode 100644 index 8d6b85c7b3..0000000000 --- a/fuzz/input/fuzz-http-endpoint/one-entry-json-map +++ /dev/null @@ -1,3 +0,0 @@ -{ - "a": 1 -} diff --git a/fuzz/input/fuzz-packets-kea-dhcp4/dhcp-payload-only b/fuzz/input/fuzz-packets-kea-dhcp4/dhcp-payload-only deleted file mode 100644 index 153050e658..0000000000 --- a/fuzz/input/fuzz-packets-kea-dhcp4/dhcp-payload-only +++ /dev/null @@ -1 +0,0 @@ -210101060100000000000000000000000000000000000000000a010001000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501013707011c02030f060c3d0701000c01020304ff diff --git a/fuzz/input/fuzz-packets-kea-dhcp4/empty b/fuzz/input/fuzz-packets-kea-dhcp4/empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fuzz/input/fuzz-packets-kea-dhcp4/full-dhcp-packet b/fuzz/input/fuzz-packets-kea-dhcp4/full-dhcp-packet deleted file mode 100644 index 802b1e369f..0000000000 --- a/fuzz/input/fuzz-packets-kea-dhcp4/full-dhcp-packet +++ /dev/null @@ -1 +0,0 @@ -000400010006d6b6574a0cce713b0800450001229b384000401194910a010001ffffffff00430043010e0b210101060100000000000000000000000000000000000000000a010001000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501013707011c02030f060c3d0701000c01020304ff diff --git a/fuzz/input/fuzz-packets-kea-dhcp4/one-byte b/fuzz/input/fuzz-packets-kea-dhcp4/one-byte deleted file mode 100644 index 47d26df80d..0000000000 --- a/fuzz/input/fuzz-packets-kea-dhcp4/one-byte +++ /dev/null @@ -1 +0,0 @@ -0a \ No newline at end of file diff --git a/fuzz/input/fuzz-packets-kea-dhcp4/udp-header b/fuzz/input/fuzz-packets-kea-dhcp4/udp-header deleted file mode 100644 index fdcab50643..0000000000 --- a/fuzz/input/fuzz-packets-kea-dhcp4/udp-header +++ /dev/null @@ -1 +0,0 @@ -000400010006d6b6574a0cce713b0800450001229b384000401194910a010001ffffffff00430043010e0b diff --git a/fuzz/input/fuzz-packets-kea-dhcp6/dhcp-payload-only b/fuzz/input/fuzz-packets-kea-dhcp6/dhcp-payload-only deleted file mode 100644 index 6058a7390e..0000000000 --- a/fuzz/input/fuzz-packets-kea-dhcp6/dhcp-payload-only +++ /dev/null @@ -1 +0,0 @@ -010000000001000e000100012b8b4659000c010203040003000c0000000100000e10000015180006000400170018000800020000 diff --git a/fuzz/input/fuzz-packets-kea-dhcp6/empty b/fuzz/input/fuzz-packets-kea-dhcp6/empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fuzz/input/fuzz-packets-kea-dhcp6/full-dhcp-packet b/fuzz/input/fuzz-packets-kea-dhcp6/full-dhcp-packet deleted file mode 100644 index efcaf6c700..0000000000 --- a/fuzz/input/fuzz-packets-kea-dhcp6/full-dhcp-packet +++ /dev/null @@ -1 +0,0 @@ -000400010006d6b6574a0cce000086dd6001d3f9003c110120010db8000100000000000000000001ff02000000000000000000000001000202220223003c2d0e010000000001000e000100012b8b4659000c010203040003000c0000000100000e10000015180006000400170018000800020000 diff --git a/fuzz/input/fuzz-packets-kea-dhcp6/one-byte b/fuzz/input/fuzz-packets-kea-dhcp6/one-byte deleted file mode 100644 index 47d26df80d..0000000000 --- a/fuzz/input/fuzz-packets-kea-dhcp6/one-byte +++ /dev/null @@ -1 +0,0 @@ -0a \ No newline at end of file diff --git a/fuzz/input/fuzz-packets-kea-dhcp6/udp-header b/fuzz/input/fuzz-packets-kea-dhcp6/udp-header deleted file mode 100644 index 95864fd7fb..0000000000 --- a/fuzz/input/fuzz-packets-kea-dhcp6/udp-header +++ /dev/null @@ -1 +0,0 @@ -000400010006d6b6574a0cce000086dd6001d3f9003c110120010db8000100000000000000000001ff02000000000000000000000001000202220223003c2d0e diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp4/config-get b/fuzz/input/fuzz-unix-socket-kea-dhcp4/config-get deleted file mode 100644 index 7ce1bfffff..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp4/config-get +++ /dev/null @@ -1,3 +0,0 @@ -{ - "command": "config-get" -} diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp4/config-get-with-service b/fuzz/input/fuzz-unix-socket-kea-dhcp4/config-get-with-service deleted file mode 100644 index 11ed27a1c2..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp4/config-get-with-service +++ /dev/null @@ -1,4 +0,0 @@ -{ - "command": "config-get", - "service": [ "dhcp4" ] -} diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp4/empty b/fuzz/input/fuzz-unix-socket-kea-dhcp4/empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp4/empty-json-map b/fuzz/input/fuzz-unix-socket-kea-dhcp4/empty-json-map deleted file mode 100644 index 0967ef424b..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp4/empty-json-map +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp4/one-byte b/fuzz/input/fuzz-unix-socket-kea-dhcp4/one-byte deleted file mode 100644 index 47d26df80d..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp4/one-byte +++ /dev/null @@ -1 +0,0 @@ -0a \ No newline at end of file diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp4/one-entry-json-map b/fuzz/input/fuzz-unix-socket-kea-dhcp4/one-entry-json-map deleted file mode 100644 index 8d6b85c7b3..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp4/one-entry-json-map +++ /dev/null @@ -1,3 +0,0 @@ -{ - "a": 1 -} diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp6/config-get b/fuzz/input/fuzz-unix-socket-kea-dhcp6/config-get deleted file mode 100644 index 7ce1bfffff..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp6/config-get +++ /dev/null @@ -1,3 +0,0 @@ -{ - "command": "config-get" -} diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp6/config-get-with-service b/fuzz/input/fuzz-unix-socket-kea-dhcp6/config-get-with-service deleted file mode 100644 index df926792e3..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp6/config-get-with-service +++ /dev/null @@ -1,4 +0,0 @@ -{ - "command": "config-get", - "service": [ "dhcp6" ] -} diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp6/empty b/fuzz/input/fuzz-unix-socket-kea-dhcp6/empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp6/empty-json-map b/fuzz/input/fuzz-unix-socket-kea-dhcp6/empty-json-map deleted file mode 100644 index 0967ef424b..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp6/empty-json-map +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp6/one-byte b/fuzz/input/fuzz-unix-socket-kea-dhcp6/one-byte deleted file mode 100644 index 47d26df80d..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp6/one-byte +++ /dev/null @@ -1 +0,0 @@ -0a \ No newline at end of file diff --git a/fuzz/input/fuzz-unix-socket-kea-dhcp6/one-entry-json-map b/fuzz/input/fuzz-unix-socket-kea-dhcp6/one-entry-json-map deleted file mode 100644 index 8d6b85c7b3..0000000000 --- a/fuzz/input/fuzz-unix-socket-kea-dhcp6/one-entry-json-map +++ /dev/null @@ -1,3 +0,0 @@ -{ - "a": 1 -} diff --git a/fuzz/input/fuzz_config_kea_dhcp4/doc-examples b/fuzz/input/fuzz_config_kea_dhcp4/doc-examples new file mode 120000 index 0000000000..0b5652bef7 --- /dev/null +++ b/fuzz/input/fuzz_config_kea_dhcp4/doc-examples @@ -0,0 +1 @@ +../../../doc/examples/kea4 \ No newline at end of file diff --git a/fuzz/input/fuzz_config_kea_dhcp4/empty b/fuzz/input/fuzz_config_kea_dhcp4/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fuzz/input/fuzz_config_kea_dhcp4/one-byte b/fuzz/input/fuzz_config_kea_dhcp4/one-byte new file mode 100644 index 0000000000..47d26df80d --- /dev/null +++ b/fuzz/input/fuzz_config_kea_dhcp4/one-byte @@ -0,0 +1 @@ +0a \ No newline at end of file diff --git a/fuzz/input/fuzz_config_kea_dhcp6/doc-examples b/fuzz/input/fuzz_config_kea_dhcp6/doc-examples new file mode 120000 index 0000000000..05f98b3048 --- /dev/null +++ b/fuzz/input/fuzz_config_kea_dhcp6/doc-examples @@ -0,0 +1 @@ +../../../doc/examples/kea6 \ No newline at end of file diff --git a/fuzz/input/fuzz_config_kea_dhcp6/empty b/fuzz/input/fuzz_config_kea_dhcp6/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fuzz/input/fuzz_config_kea_dhcp6/one-byte b/fuzz/input/fuzz_config_kea_dhcp6/one-byte new file mode 100644 index 0000000000..47d26df80d --- /dev/null +++ b/fuzz/input/fuzz_config_kea_dhcp6/one-byte @@ -0,0 +1 @@ +0a \ No newline at end of file diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp4/config-get b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/config-get new file mode 100644 index 0000000000..7ce1bfffff --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/config-get @@ -0,0 +1,3 @@ +{ + "command": "config-get" +} diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp4/config-get-with-service b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/config-get-with-service new file mode 100644 index 0000000000..11ed27a1c2 --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/config-get-with-service @@ -0,0 +1,4 @@ +{ + "command": "config-get", + "service": [ "dhcp4" ] +} diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp4/empty b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp4/empty-json-map b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/empty-json-map new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/empty-json-map @@ -0,0 +1 @@ +{} diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp4/one-byte b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/one-byte new file mode 100644 index 0000000000..47d26df80d --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/one-byte @@ -0,0 +1 @@ +0a \ No newline at end of file diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp4/one-entry-json-map b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/one-entry-json-map new file mode 100644 index 0000000000..8d6b85c7b3 --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp4/one-entry-json-map @@ -0,0 +1,3 @@ +{ + "a": 1 +} diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp6/config-get b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/config-get new file mode 100644 index 0000000000..7ce1bfffff --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/config-get @@ -0,0 +1,3 @@ +{ + "command": "config-get" +} diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp6/config-get-with-service b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/config-get-with-service new file mode 100644 index 0000000000..df926792e3 --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/config-get-with-service @@ -0,0 +1,4 @@ +{ + "command": "config-get", + "service": [ "dhcp6" ] +} diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp6/empty b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp6/empty-json-map b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/empty-json-map new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/empty-json-map @@ -0,0 +1 @@ +{} diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp6/one-byte b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/one-byte new file mode 100644 index 0000000000..47d26df80d --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/one-byte @@ -0,0 +1 @@ +0a \ No newline at end of file diff --git a/fuzz/input/fuzz_http_endpoint_kea_dhcp6/one-entry-json-map b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/one-entry-json-map new file mode 100644 index 0000000000..8d6b85c7b3 --- /dev/null +++ b/fuzz/input/fuzz_http_endpoint_kea_dhcp6/one-entry-json-map @@ -0,0 +1,3 @@ +{ + "a": 1 +} diff --git a/fuzz/input/fuzz_packets_kea_dhcp4/dhcp-payload-only b/fuzz/input/fuzz_packets_kea_dhcp4/dhcp-payload-only new file mode 100644 index 0000000000..153050e658 --- /dev/null +++ b/fuzz/input/fuzz_packets_kea_dhcp4/dhcp-payload-only @@ -0,0 +1 @@ +210101060100000000000000000000000000000000000000000a010001000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501013707011c02030f060c3d0701000c01020304ff diff --git a/fuzz/input/fuzz_packets_kea_dhcp4/empty b/fuzz/input/fuzz_packets_kea_dhcp4/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fuzz/input/fuzz_packets_kea_dhcp4/full-dhcp-packet b/fuzz/input/fuzz_packets_kea_dhcp4/full-dhcp-packet new file mode 100644 index 0000000000..802b1e369f --- /dev/null +++ b/fuzz/input/fuzz_packets_kea_dhcp4/full-dhcp-packet @@ -0,0 +1 @@ +000400010006d6b6574a0cce713b0800450001229b384000401194910a010001ffffffff00430043010e0b210101060100000000000000000000000000000000000000000a010001000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501013707011c02030f060c3d0701000c01020304ff diff --git a/fuzz/input/fuzz_packets_kea_dhcp4/one-byte b/fuzz/input/fuzz_packets_kea_dhcp4/one-byte new file mode 100644 index 0000000000..47d26df80d --- /dev/null +++ b/fuzz/input/fuzz_packets_kea_dhcp4/one-byte @@ -0,0 +1 @@ +0a \ No newline at end of file diff --git a/fuzz/input/fuzz_packets_kea_dhcp4/udp-header b/fuzz/input/fuzz_packets_kea_dhcp4/udp-header new file mode 100644 index 0000000000..fdcab50643 --- /dev/null +++ b/fuzz/input/fuzz_packets_kea_dhcp4/udp-header @@ -0,0 +1 @@ +000400010006d6b6574a0cce713b0800450001229b384000401194910a010001ffffffff00430043010e0b diff --git a/fuzz/input/fuzz_packets_kea_dhcp6/dhcp-payload-only b/fuzz/input/fuzz_packets_kea_dhcp6/dhcp-payload-only new file mode 100644 index 0000000000..6058a7390e --- /dev/null +++ b/fuzz/input/fuzz_packets_kea_dhcp6/dhcp-payload-only @@ -0,0 +1 @@ +010000000001000e000100012b8b4659000c010203040003000c0000000100000e10000015180006000400170018000800020000 diff --git a/fuzz/input/fuzz_packets_kea_dhcp6/empty b/fuzz/input/fuzz_packets_kea_dhcp6/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fuzz/input/fuzz_packets_kea_dhcp6/full-dhcp-packet b/fuzz/input/fuzz_packets_kea_dhcp6/full-dhcp-packet new file mode 100644 index 0000000000..efcaf6c700 --- /dev/null +++ b/fuzz/input/fuzz_packets_kea_dhcp6/full-dhcp-packet @@ -0,0 +1 @@ +000400010006d6b6574a0cce000086dd6001d3f9003c110120010db8000100000000000000000001ff02000000000000000000000001000202220223003c2d0e010000000001000e000100012b8b4659000c010203040003000c0000000100000e10000015180006000400170018000800020000 diff --git a/fuzz/input/fuzz_packets_kea_dhcp6/one-byte b/fuzz/input/fuzz_packets_kea_dhcp6/one-byte new file mode 100644 index 0000000000..47d26df80d --- /dev/null +++ b/fuzz/input/fuzz_packets_kea_dhcp6/one-byte @@ -0,0 +1 @@ +0a \ No newline at end of file diff --git a/fuzz/input/fuzz_packets_kea_dhcp6/udp-header b/fuzz/input/fuzz_packets_kea_dhcp6/udp-header new file mode 100644 index 0000000000..95864fd7fb --- /dev/null +++ b/fuzz/input/fuzz_packets_kea_dhcp6/udp-header @@ -0,0 +1 @@ +000400010006d6b6574a0cce000086dd6001d3f9003c110120010db8000100000000000000000001ff02000000000000000000000001000202220223003c2d0e diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp4/config-get b/fuzz/input/fuzz_unix_socket_kea_dhcp4/config-get new file mode 100644 index 0000000000..7ce1bfffff --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp4/config-get @@ -0,0 +1,3 @@ +{ + "command": "config-get" +} diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp4/config-get-with-service b/fuzz/input/fuzz_unix_socket_kea_dhcp4/config-get-with-service new file mode 100644 index 0000000000..11ed27a1c2 --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp4/config-get-with-service @@ -0,0 +1,4 @@ +{ + "command": "config-get", + "service": [ "dhcp4" ] +} diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp4/empty b/fuzz/input/fuzz_unix_socket_kea_dhcp4/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp4/empty-json-map b/fuzz/input/fuzz_unix_socket_kea_dhcp4/empty-json-map new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp4/empty-json-map @@ -0,0 +1 @@ +{} diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp4/one-byte b/fuzz/input/fuzz_unix_socket_kea_dhcp4/one-byte new file mode 100644 index 0000000000..47d26df80d --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp4/one-byte @@ -0,0 +1 @@ +0a \ No newline at end of file diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp4/one-entry-json-map b/fuzz/input/fuzz_unix_socket_kea_dhcp4/one-entry-json-map new file mode 100644 index 0000000000..8d6b85c7b3 --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp4/one-entry-json-map @@ -0,0 +1,3 @@ +{ + "a": 1 +} diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp6/config-get b/fuzz/input/fuzz_unix_socket_kea_dhcp6/config-get new file mode 100644 index 0000000000..7ce1bfffff --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp6/config-get @@ -0,0 +1,3 @@ +{ + "command": "config-get" +} diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp6/config-get-with-service b/fuzz/input/fuzz_unix_socket_kea_dhcp6/config-get-with-service new file mode 100644 index 0000000000..df926792e3 --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp6/config-get-with-service @@ -0,0 +1,4 @@ +{ + "command": "config-get", + "service": [ "dhcp6" ] +} diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp6/empty b/fuzz/input/fuzz_unix_socket_kea_dhcp6/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp6/empty-json-map b/fuzz/input/fuzz_unix_socket_kea_dhcp6/empty-json-map new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp6/empty-json-map @@ -0,0 +1 @@ +{} diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp6/one-byte b/fuzz/input/fuzz_unix_socket_kea_dhcp6/one-byte new file mode 100644 index 0000000000..47d26df80d --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp6/one-byte @@ -0,0 +1 @@ +0a \ No newline at end of file diff --git a/fuzz/input/fuzz_unix_socket_kea_dhcp6/one-entry-json-map b/fuzz/input/fuzz_unix_socket_kea_dhcp6/one-entry-json-map new file mode 100644 index 0000000000..8d6b85c7b3 --- /dev/null +++ b/fuzz/input/fuzz_unix_socket_kea_dhcp6/one-entry-json-map @@ -0,0 +1,3 @@ +{ + "a": 1 +} diff --git a/fuzz/tests/Makefile.am b/fuzz/tests/Makefile.am index 3727d137db..ac2ba0d353 100644 --- a/fuzz/tests/Makefile.am +++ b/fuzz/tests/Makefile.am @@ -3,13 +3,14 @@ SUBDIRS = . if FUZZING check_SCRIPTS = -check_SCRIPTS += test-fuzz-config-kea-dhcp4.sh -check_SCRIPTS += test-fuzz-config-kea-dhcp6.sh -check_SCRIPTS += test-fuzz-http-endpoint.sh -check_SCRIPTS += test-fuzz-packets-kea-dhcp4.sh -check_SCRIPTS += test-fuzz-packets-kea-dhcp6.sh -check_SCRIPTS += test-fuzz-unix-socket-kea-dhcp4.sh -check_SCRIPTS += test-fuzz-unix-socket-kea-dhcp6.sh +check_SCRIPTS += test_fuzz_config_kea_dhcp4.sh +check_SCRIPTS += test_fuzz_config_kea_dhcp6.sh +check_SCRIPTS += test_fuzz_http_endpoint_kea_dhcp4.sh +check_SCRIPTS += test_fuzz_http_endpoint_kea_dhcp6.sh +check_SCRIPTS += test_fuzz_packets_kea_dhcp4.sh +check_SCRIPTS += test_fuzz_packets_kea_dhcp6.sh +check_SCRIPTS += test_fuzz_unix_socket_kea_dhcp4.sh +check_SCRIPTS += test_fuzz_unix_socket_kea_dhcp6.sh TESTS = $(check_SCRIPTS) diff --git a/fuzz/tests/setup.sh b/fuzz/tests/setup.sh deleted file mode 120000 index 1664189fbb..0000000000 --- a/fuzz/tests/setup.sh +++ /dev/null @@ -1 +0,0 @@ -../setup.sh \ No newline at end of file diff --git a/fuzz/tests/test-fuzz-config-kea-dhcp4.sh b/fuzz/tests/test-fuzz-config-kea-dhcp4.sh deleted file mode 100755 index fcbebc1fe8..0000000000 --- a/fuzz/tests/test-fuzz-config-kea-dhcp4.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi - -script_path=$(cd "$(dirname "${0}")" && pwd) - -script_basename=$(basename "${0}") - -tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') - -"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-config-kea-dhcp6.sh b/fuzz/tests/test-fuzz-config-kea-dhcp6.sh deleted file mode 100755 index fcbebc1fe8..0000000000 --- a/fuzz/tests/test-fuzz-config-kea-dhcp6.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi - -script_path=$(cd "$(dirname "${0}")" && pwd) - -script_basename=$(basename "${0}") - -tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') - -"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-http-endpoint.sh b/fuzz/tests/test-fuzz-http-endpoint.sh deleted file mode 100755 index fcbebc1fe8..0000000000 --- a/fuzz/tests/test-fuzz-http-endpoint.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi - -script_path=$(cd "$(dirname "${0}")" && pwd) - -script_basename=$(basename "${0}") - -tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') - -"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-packets-kea-dhcp4.sh b/fuzz/tests/test-fuzz-packets-kea-dhcp4.sh deleted file mode 100755 index fcbebc1fe8..0000000000 --- a/fuzz/tests/test-fuzz-packets-kea-dhcp4.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi - -script_path=$(cd "$(dirname "${0}")" && pwd) - -script_basename=$(basename "${0}") - -tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') - -"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-packets-kea-dhcp6.sh b/fuzz/tests/test-fuzz-packets-kea-dhcp6.sh deleted file mode 100755 index fcbebc1fe8..0000000000 --- a/fuzz/tests/test-fuzz-packets-kea-dhcp6.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi - -script_path=$(cd "$(dirname "${0}")" && pwd) - -script_basename=$(basename "${0}") - -tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') - -"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh b/fuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh deleted file mode 100755 index fcbebc1fe8..0000000000 --- a/fuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi - -script_path=$(cd "$(dirname "${0}")" && pwd) - -script_basename=$(basename "${0}") - -tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') - -"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh b/fuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh deleted file mode 100755 index fcbebc1fe8..0000000000 --- a/fuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi - -script_path=$(cd "$(dirname "${0}")" && pwd) - -script_basename=$(basename "${0}") - -tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') - -"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test_fuzz_config_kea_dhcp4.sh b/fuzz/tests/test_fuzz_config_kea_dhcp4.sh new file mode 100755 index 0000000000..416b72a656 --- /dev/null +++ b/fuzz/tests/test_fuzz_config_kea_dhcp4.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test_//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test_fuzz_config_kea_dhcp6.sh b/fuzz/tests/test_fuzz_config_kea_dhcp6.sh new file mode 100755 index 0000000000..416b72a656 --- /dev/null +++ b/fuzz/tests/test_fuzz_config_kea_dhcp6.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test_//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test_fuzz_http_endpoint_kea_dhcp4.sh b/fuzz/tests/test_fuzz_http_endpoint_kea_dhcp4.sh new file mode 100755 index 0000000000..416b72a656 --- /dev/null +++ b/fuzz/tests/test_fuzz_http_endpoint_kea_dhcp4.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test_//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test_fuzz_http_endpoint_kea_dhcp6.sh b/fuzz/tests/test_fuzz_http_endpoint_kea_dhcp6.sh new file mode 100755 index 0000000000..416b72a656 --- /dev/null +++ b/fuzz/tests/test_fuzz_http_endpoint_kea_dhcp6.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test_//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test_fuzz_packets_kea_dhcp4.sh b/fuzz/tests/test_fuzz_packets_kea_dhcp4.sh new file mode 100755 index 0000000000..416b72a656 --- /dev/null +++ b/fuzz/tests/test_fuzz_packets_kea_dhcp4.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test_//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test_fuzz_packets_kea_dhcp6.sh b/fuzz/tests/test_fuzz_packets_kea_dhcp6.sh new file mode 100755 index 0000000000..416b72a656 --- /dev/null +++ b/fuzz/tests/test_fuzz_packets_kea_dhcp6.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test_//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test_fuzz_unix_socket_kea_dhcp4.sh b/fuzz/tests/test_fuzz_unix_socket_kea_dhcp4.sh new file mode 100755 index 0000000000..416b72a656 --- /dev/null +++ b/fuzz/tests/test_fuzz_unix_socket_kea_dhcp4.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test_//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test_fuzz_unix_socket_kea_dhcp6.sh b/fuzz/tests/test_fuzz_unix_socket_kea_dhcp6.sh new file mode 100755 index 0000000000..416b72a656 --- /dev/null +++ b/fuzz/tests/test_fuzz_unix_socket_kea_dhcp6.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test_//g;s/.sh//g') + +"${script_path}/../${tested_binary}" -- cgit v1.2.3