- the auth, dnsdist and rec packet caches (fuzz_target_packetcache and
fuzz_target_dnsdistcache) ;
- MOADNSParser (fuzz_target_moadnsparser) ;
+- the Proxy Protocol parser (fuzz_target_proxyprotocol) ;
- ZoneParserTNG (fuzz_target_zoneparsertng).
By default the targets are linked against a standalone target,
This directory contains a few files used for continuous fuzzing
of the PowerDNS products.
-The 'corpus' directory contains two sub-directories:
+The 'corpus' directory contains three sub-directories:
+- proxy-protocol-raw-packets/ contains DNS queries prefixed with a Proxy
+ Protocol v2 header, used by fuzz_target_proxyprotocol ;
- raw-dns-packets/ contains DNS queries and responses as captured on
the wire. These are used by the fuzz_target_dnsdistcache,
fuzz_target_moadnsparser and fuzz_target_packetcache targets ;
fuzz_target_dnsdistcache \
fuzz_target_moadnsparser \
fuzz_target_packetcache \
+ fuzz_target_proxyprotocol \
fuzz_target_zoneparsertng
fuzz_targets: $(fuzz_targets_programs)
fuzz_target_packetcache_LDFLAGS = $(fuzz_targets_ldflags)
fuzz_target_packetcache_LDADD = $(fuzz_targets_libs)
+fuzz_target_proxyprotocol_SOURCES = \
+ fuzz_proxyprotocol.cc \
+ iputils.hh \
+ proxy-protocol.cc \
+ proxy-protocol.hh
+
+fuzz_target_proxyprotocol_DEPENDENCIES = $(fuzz_targets_deps)
+fuzz_target_proxyprotocol_LDFLAGS = $(fuzz_targets_ldflags)
+fuzz_target_proxyprotocol_LDADD = $(fuzz_targets_libs)
+
fuzz_target_dnsdistcache_SOURCES = \
fuzz_dnsdistcache.cc \
dnsdist-cache.cc dnsdist-cache.hh \
--- /dev/null
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "proxy-protocol.hh"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+
+ std::vector<ProxyProtocolValue> values;
+ ComboAddress source;
+ ComboAddress destination;
+ bool proxy = false;
+ bool tcp = false;
+
+ try {
+ parseProxyHeader(std::string(reinterpret_cast<const char*>(data), size), proxy, source, destination, tcp, values);
+ }
+ catch(const std::exception& e) {
+ }
+ catch(const PDNSException& e) {
+ }
+
+ return 0;
+}