2017-09-08 04:44:13 +02:00
|
|
|
# NB. libssh and libopenbsd-compat should be built with the same sanitizer opts.
|
2019-09-05 07:46:39 +02:00
|
|
|
CXX=clang++-6.0
|
|
|
|
FUZZ_FLAGS=-fsanitize=address,undefined -fsanitize-coverage=edge,trace-pc
|
2017-09-08 04:44:13 +02:00
|
|
|
FUZZ_LIBS=-lFuzzer
|
|
|
|
|
|
|
|
CXXFLAGS=-O2 -g -Wall -Wextra -I ../../.. $(FUZZ_FLAGS)
|
|
|
|
LDFLAGS=-L ../../.. -L ../../../openbsd-compat -g $(FUZZ_FLAGS)
|
2019-11-25 11:47:49 +01:00
|
|
|
LIBS=-lssh -lopenbsd-compat -lcrypto -lfido2 -lcbor $(FUZZ_LIBS)
|
2017-09-08 04:44:13 +02:00
|
|
|
|
2019-10-09 04:49:35 +02:00
|
|
|
TARGETS=pubkey_fuzz sig_fuzz authopt_fuzz sshsig_fuzz \
|
|
|
|
sshsigopt_fuzz privkey_fuzz
|
2019-09-05 07:45:32 +02:00
|
|
|
|
|
|
|
all: $(TARGETS)
|
2017-09-08 04:44:13 +02:00
|
|
|
|
|
|
|
.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)
|
|
|
|
|
2018-09-14 07:16:34 +02:00
|
|
|
authopt_fuzz: authopt_fuzz.o
|
|
|
|
$(CXX) -o $@ authopt_fuzz.o ../../../auth-options.o $(LDFLAGS) $(LIBS)
|
|
|
|
|
2019-09-05 03:09:28 +02:00
|
|
|
sshsig_fuzz: sshsig_fuzz.o
|
|
|
|
$(CXX) -o $@ sshsig_fuzz.o ../../../sshsig.o $(LDFLAGS) $(LIBS)
|
|
|
|
|
2019-09-05 07:45:32 +02:00
|
|
|
sshsigopt_fuzz: sshsigopt_fuzz.o
|
|
|
|
$(CXX) -o $@ sshsigopt_fuzz.o ../../../sshsig.o $(LDFLAGS) $(LIBS)
|
|
|
|
|
2019-10-09 04:49:35 +02:00
|
|
|
privkey_fuzz: privkey_fuzz.o
|
|
|
|
$(CXX) -o $@ privkey_fuzz.o $(LDFLAGS) $(LIBS)
|
|
|
|
|
2017-09-08 04:44:13 +02:00
|
|
|
clean:
|
2019-09-05 07:45:32 +02:00
|
|
|
-rm -f *.o $(TARGETS)
|