summaryrefslogtreecommitdiffstats
path: root/regress/misc/fuzz-harness/Makefile
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2017-09-08 12:44:13 +1000
committerDamien Miller <djm@mindrot.org>2017-09-08 12:44:13 +1000
commitec9d22cc251cc5acfe7b2bcef9cc7a1fe0e949d8 (patch)
treed6dd817fd7bf3a02bbcb14e3d536590c0fcefac1 /regress/misc/fuzz-harness/Makefile
parentde35c382894964a896a63ecd5607d3a3b93af75d (diff)
Fuzzer harnesses for sig verify and pubkey parsing
These are some basic clang libfuzzer harnesses for signature verification and public key parsing. Some assembly (metaphorical) required.
Diffstat (limited to 'regress/misc/fuzz-harness/Makefile')
-rw-r--r--regress/misc/fuzz-harness/Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/regress/misc/fuzz-harness/Makefile b/regress/misc/fuzz-harness/Makefile
new file mode 100644
index 00000000..8fbfc20c
--- /dev/null
+++ b/regress/misc/fuzz-harness/Makefile
@@ -0,0 +1,22 @@
+# NB. libssh and libopenbsd-compat should be built with the same sanitizer opts.
+CXX=clang++-3.9
+FUZZ_FLAGS=-fsanitize=address,undefined -fsanitize-coverage=edge
+FUZZ_LIBS=-lFuzzer
+
+CXXFLAGS=-O2 -g -Wall -Wextra -I ../../.. $(FUZZ_FLAGS)
+LDFLAGS=-L ../../.. -L ../../../openbsd-compat -g $(FUZZ_FLAGS)
+LIBS=-lssh -lopenbsd-compat -lcrypto $(FUZZ_LIBS)
+
+all: pubkey_fuzz sig_fuzz
+
+.cc.o:
+ $(CXX) $(CXXFLAGS) -c $< -o $@
+
+pubkey_fuzz: pubkey_fuzz.o
+ $(CXX) -o $@ pubkey_fuzz.o $(LDFLAGS) $(LIBS)
+
+sig_fuzz: sig_fuzz.o
+ $(CXX) -o $@ sig_fuzz.o $(LDFLAGS) $(LIBS)
+
+clean:
+ -rm -f *.o pubkey_fuzz sig_fuzz