]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4272] Remove fuzz_agent; CA was removed
authorAndrei Pavel <andrei@isc.org>
Wed, 22 Apr 2026 09:12:31 +0000 (11:12 +0200)
committerAndrei Pavel <andrei@isc.org>
Thu, 6 Aug 2026 07:34:25 +0000 (10:34 +0300)
src/fuzz/build.sh
src/fuzz/fuzz_agent.cc [deleted file]
src/fuzz/fuzz_agent.dict [deleted file]
src/fuzz/meson.build

index 49860e6ec65c45cbd96d23ac5d7a4b565458abf2..a5198db9b4fcef4018286100c02cbd0f5f14017d 100755 (executable)
@@ -62,7 +62,7 @@ LIBS="-lpthread -ldl -lm -lc++ -lc++abi -lssl -lcrypto -lkrb5 -lgssapi_krb5"
 export CXXFLAGS="${CXXFLAGS} -std=c++17 -stdlib=libc++ -Wno-unused-parameter -Wno-unused-value"
 
 # Build non-dhcp specific fuzzers
-for fuzzer in fuzz_cc fuzz_d2 fuzz_agent fuzz_util fuzz_dhcpsrv fuzz_dhcpsrv_csv_lease fuzz_dns fuzz_encode fuzz_cryptolink
+for fuzzer in fuzz_cc fuzz_d2 fuzz_util fuzz_dhcpsrv fuzz_dhcpsrv_csv_lease fuzz_dns fuzz_encode fuzz_cryptolink
 do
   extra_lib=""
   case "$fuzzer" in fuzz_hook_tsig)
@@ -182,7 +182,7 @@ done
 
 # Prepare maximum size option for configuration parsing related fuzzers
 for fuzzer in fuzz_eval4 fuzz_eval6 fuzz_dhcp_parser4 fuzz_dhcp_parser6 \
-              fuzz_dhcp_pkt4 fuzz_dhcp_pkt6 fuzz_cc fuzz_d2 fuzz_agent \
+              fuzz_dhcp_pkt4 fuzz_dhcp_pkt6 fuzz_cc fuzz_d2 \
               fuzz_config_kea_dhcp4 fuzz_config_kea_dhcp6
 do
     printf '[libfuzzer]\nmax_len=25600\n' > "${OUT}/${fuzzer}.options"
@@ -192,5 +192,4 @@ done
 zip -j "${OUT}/fuzz_dhcpsrv_seed_corpus.zip" "${SRC}/kea/src/fuzz/corp"/*.json
 zip -j "${OUT}/fuzz_dhcp_parser4_seed_corpus.zip" "${SRC}/kea/src/fuzz/corp"/*.json
 zip -j "${OUT}/fuzz_dhcp_parser6_seed_corpus.zip" "${SRC}/kea/src/fuzz/corp"/*.json
-zip -j "${OUT}/fuzz_agent_seed_corpus.zip" "${SRC}/kea/src/bin/agent/tests/testdata"/*.json
 zip -j "${OUT}/fuzz_d2_seed_corpus.zip" "${SRC}/kea/src/bin/d2/tests/testdata"/*.json
diff --git a/src/fuzz/fuzz_agent.cc b/src/fuzz/fuzz_agent.cc
deleted file mode 100644 (file)
index 1da4c28..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (C) 2026 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/.
-////////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 2025 Ada Logics Ltd.
-//
-// 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 "config.h"
-#include <fuzzer/FuzzedDataProvider.h>
-
-#include <agent/parser_context.h>
-#include <agent/simple_parser.h>
-#include <agent/ca_cfg_mgr.h>
-
-#include <cc/data.h>
-#include <exceptions/exceptions.h>
-
-#include <string>
-#include <memory>
-
-using namespace isc::agent;
-using namespace isc::data;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-    FuzzedDataProvider fdp(data, size);
-    bool checkOnly = fdp.ConsumeBool();
-
-    AgentSimpleParser simpleParser;
-    CtrlAgentCfgContextPtr ctxPtr(new CtrlAgentCfgContext());
-    ParserContext ctx;
-    ElementPtr elem;
-
-    // Generate random parsing mode
-    const uint8_t mode = fdp.ConsumeIntegralInRange<uint8_t>(0, 2);
-    ParserContext::ParserType type = ParserContext::PARSER_JSON;
-    if (mode == 1) {
-        type = ParserContext::PARSER_AGENT;
-    } else if (mode == 2) {
-        type = ParserContext::PARSER_SUB_AGENT;
-    }
-
-    const std::string payload = fdp.ConsumeRemainingBytesAsString();
-
-    // Target context parseString
-    try {
-        ctx.parseString(payload, type);
-    } catch (const isc::Exception&) {
-        // Silent exceptions
-    }
-
-    // Parse payload to JSON
-    try {
-        elem = Element::fromJSON(payload);
-    } catch (...) {
-        // If failed to parse the payload, early exit
-        return 0;
-    }
-
-    // Target SimpleParser
-    try {
-        AgentSimpleParser::setAllDefaults(elem);
-        simpleParser.checkTlsSetup(elem);
-        simpleParser.parse(ctxPtr, elem, checkOnly);
-    } catch (const isc::Exception&) {
-        // Silent exceptions
-    }
-
-    return 0;
-}
diff --git a/src/fuzz/fuzz_agent.dict b/src/fuzz/fuzz_agent.dict
deleted file mode 100644 (file)
index 2daa66a..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-"{"
-"}"
-"["
-"]"
-":"
-","
-"\""
-"\"\""
-"null"
-"true"
-"false"
-" "
-"\\n"
-"\\r\\n"
-"\"Control-agent\""
-"\"control-agent\""
-"\"http-host\""
-"\"http-port\""
-"\"http-ciphers\""
-"\"http-headers\""
-"\"http-max-body-size\""
-"\"http-status\""
-"\"http-response-headers\""
-"\"localhost\""
-"\"127.0.0.1\""
-"\"::1\""
-"\"0.0.0.0\""
-"0"
-"53"
-"67"
-"80"
-"443"
-"8080"
-"65535"
-"\"tls\""
-"\"enable-tls\""
-"\"cert-file\""
-"\"key-file\""
-"\"ca-file\""
-"\"trust-anchor\""
-"\"verify-peer\""
-"\"cipher-list\""
-"\"cipher-suite\""
-"\"protocols\""
-"\"min-tls-version\""
-"\"max-tls-version\""
-"\"/etc/kea/ctrl-agent.crt\""
-"\"/etc/kea/ctrl-agent.key\""
-"\"/etc/ssl/certs/ca-certificates.crt\""
-"\"/tmp/kea.crt\""
-"\"/tmp/kea.key\""
-"\"REQUIRED\""
-"\"OPTIONAL\""
-"\"NONE\""
-"\"TLSv1.2\""
-"\"TLSv1.3\""
-"\"control-sockets\""
-"\"dhcp4\""
-"\"dhcp6\""
-"\"d2\""
-"\"netconf\""
-"\"socket-type\""
-"\"socket-name\""
-"\"socket-url\""
-"\"unix\""
-"\"http\""
-"\"/tmp/kea4-ctrl.sock\""
-"\"/tmp/kea6-ctrl.sock\""
-"\"/tmp/kea-d2-ctrl.sock\""
-"\"http://127.0.0.1:8000/\""
-"\"http://[::1]:8000/\""
-"\"commands\""
-"\"command\""
-"\"arguments\""
-"\"access-list\""
-"\"whitelist\""
-"\"blacklist\""
-"\"allowed-clients\""
-"\"paths\""
-"\"path\""
-"\"GET\""
-"\"POST\""
-"\"Logging\""
-"\"name\""
-"\"output_options\""
-"\"output\""
-"\"flush\""
-"\"maxsize\""
-"\"maxver\""
-"\"file-name\""
-"\"severity\""
-"\"debuglevel\""
-"\"INFO\""
-"\"WARN\""
-"\"ERROR\""
-"\"DEBUG\""
-"\"kea-ctrl-agent\""
-"\"stdout\""
-"\"stderr\""
-"\"/var/log/kea-ctrl-agent.log\""
-"\"interfaces\""
-"\"hooks-libraries\""
-"\"library\""
-"\"parameters\""
-"\"user-context\""
-"\"comment\""
-"\"config-control\""
-"\"config-databases\""
-"\"database\""
-"\"type\""
-"\"host\""
-"\"port\""
-"\"user\""
-"\"password\""
-"\"name\""
-"\"Control-agent\":{"
-"\"http-host\":\""
-"\"http-port\":"
-"\"enable-tls\":"
-"\"cert-file\":\""
-"\"key-file\":\""
-"\"ca-file\":\""
-"\"verify-peer\":"
-"\"control-sockets\":{"
-"\"dhcp4\":{"
-"\"dhcp6\":{"
-"\"d2\":{"
-"\"netconf\":{"
-"\"socket-type\":\""
-"\"socket-name\":\""
-"\"Logging\":[{"
-"\"output_options\":[{"
-"\"severity\":\""
-"\"debuglevel\":"
-"}]"
-"}]"
-"}"
-"\"\""
-"\"   \""
-"\"\\u0000\""
-"\"\\uD800\""
-"\"\\x\""
-"-1"
-"2147483647"
-"4294967295"
-"9223372036854775807"
-"3.14159"
-"\"[],{}:\""
-"\":{"
-"\": ["
-"]}"
-"}]"
-"},"
-"],"
-"\" : "
-" , "
index a11d349c50a47d91dd0c503d223496a3684a535a..2e7f7a16ef5f0a208b6366a165c0bdd63e42cd64 100644 (file)
@@ -72,7 +72,6 @@ endforeach
 
 # From external contribution.
 foreach i : [
-    'fuzz_agent',
     'fuzz_cc',
     'fuzz_crypto',
     'fuzz_cryptolink',
@@ -122,7 +121,6 @@ foreach i : [
         dependencies: [MYSQL_DEP, POSTGRESQL_DEP, CRYPTO_DEP, GTEST_DEP, KRB5_DEP],
         include_directories: includes,
         link_with: [
-            agent_lib,
             d2_lib,
             ddns_gss_tsig_lib,
             dhcp_lease_query_lib,