diff options
Diffstat (limited to 'fuzz/input')
38 files changed, 164 insertions, 0 deletions
diff --git a/fuzz/input/Makefile.am b/fuzz/input/Makefile.am new file mode 100644 index 0000000000..f1c9e11a64 --- /dev/null +++ b/fuzz/input/Makefile.am @@ -0,0 +1,43 @@ +SUBDIRS = . + +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 += kea-dhcp4.conf +nobase_dist_fuzz_DATA += kea-dhcp6.conf + +endif # FUZZING 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 --- /dev/null +++ b/fuzz/input/fuzz-config-kea-dhcp4/empty 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 --- /dev/null +++ b/fuzz/input/fuzz-config-kea-dhcp6/empty 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/config-get b/fuzz/input/fuzz-http-endpoint/config-get new file mode 100644 index 0000000000..7ce1bfffff --- /dev/null +++ b/fuzz/input/fuzz-http-endpoint/config-get @@ -0,0 +1,3 @@ +{ + "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 new file mode 100644 index 0000000000..df926792e3 --- /dev/null +++ b/fuzz/input/fuzz-http-endpoint/config-get-with-service @@ -0,0 +1,4 @@ +{ + "command": "config-get", + "service": [ "dhcp6" ] +} diff --git a/fuzz/input/fuzz-http-endpoint/empty b/fuzz/input/fuzz-http-endpoint/empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/fuzz/input/fuzz-http-endpoint/empty diff --git a/fuzz/input/fuzz-http-endpoint/empty-json-map b/fuzz/input/fuzz-http-endpoint/empty-json-map new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/fuzz/input/fuzz-http-endpoint/empty-json-map @@ -0,0 +1 @@ +{} diff --git a/fuzz/input/fuzz-http-endpoint/one-byte b/fuzz/input/fuzz-http-endpoint/one-byte new file mode 100644 index 0000000000..47d26df80d --- /dev/null +++ b/fuzz/input/fuzz-http-endpoint/one-byte @@ -0,0 +1 @@ +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 new file mode 100644 index 0000000000..8d6b85c7b3 --- /dev/null +++ b/fuzz/input/fuzz-http-endpoint/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 --- /dev/null +++ b/fuzz/input/fuzz-packets-kea-dhcp4/empty 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 --- /dev/null +++ b/fuzz/input/fuzz-packets-kea-dhcp6/empty 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 --- /dev/null +++ b/fuzz/input/fuzz-unix-socket-kea-dhcp4/empty 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 --- /dev/null +++ b/fuzz/input/fuzz-unix-socket-kea-dhcp6/empty 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/input/kea-dhcp4.conf b/fuzz/input/kea-dhcp4.conf new file mode 100644 index 0000000000..7409a46b90 --- /dev/null +++ b/fuzz/input/kea-dhcp4.conf @@ -0,0 +1,20 @@ +{ + "Dhcp4": { + "interfaces-config": { + "interfaces": [ + "*" + ] + }, + "subnet4": [ + { + "id": 1, + "pools": [ + { + "pool": "127.0.0.0/8" + } + ], + "subnet": "127.0.0.0/8" + } + ] + } +} diff --git a/fuzz/input/kea-dhcp6.conf b/fuzz/input/kea-dhcp6.conf new file mode 100644 index 0000000000..868a40244f --- /dev/null +++ b/fuzz/input/kea-dhcp6.conf @@ -0,0 +1,27 @@ +{ + "Dhcp6": { + "interfaces-config": { + "interfaces": [ + "*" + ] + }, + "subnet6": [ + { + "id": 1, + "pd-pools": [ + { + "delegated-len": 120, + "prefix": "2001:db8:1:0:2::", + "prefix-len": 80 + } + ], + "pools": [ + { + "pool": "::/80" + } + ], + "subnet": "::/64" + } + ] + } +} diff --git a/fuzz/input/regenerate-cpp-sources.sh b/fuzz/input/regenerate-cpp-sources.sh new file mode 100755 index 0000000000..56af74827e --- /dev/null +++ b/fuzz/input/regenerate-cpp-sources.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -eu + +script_path=$(cd "$(dirname "${0}")" && pwd) + +cd "${script_path}" + +generate() { + source="${1}" + target="${2}" + + source_content=$(cat "${source}") + variable_name=$(echo "${source}" | tr '[:lower:]' '[:upper:]' | sed 's/\./_/' | sed 's/-/_/') + + cat > "${target}" <<HERE_DOCUMENT +#include <string> + +extern std::string ${variable_name} = R"( +${source_content} +)"; +HERE_DOCUMENT +} + +generate kea-dhcp4.conf ../kea-dhcp4.h +generate kea-dhcp6.conf ../kea-dhcp6.h |