2017-09-08 02:44:13 +00:00
|
|
|
# NB. libssh and libopenbsd-compat should be built with the same sanitizer opts.
|
2020-12-04 02:57:43 +00:00
|
|
|
CXX=clang++-9
|
|
|
|
FUZZ_FLAGS=-fsanitize=address,fuzzer
|
2017-09-08 02:44:13 +00:00
|
|
|
FUZZ_LIBS=-lFuzzer
|
|
|
|
|
2020-01-21 23:30:13 +00:00
|
|
|
CXXFLAGS=-O2 -g -Wall -Wextra -Wno-unused-parameter -I ../../.. $(FUZZ_FLAGS)
|
2017-09-08 02:44:13 +00:00
|
|
|
LDFLAGS=-L ../../.. -L ../../../openbsd-compat -g $(FUZZ_FLAGS)
|
2019-11-25 10:47:49 +00:00
|
|
|
LIBS=-lssh -lopenbsd-compat -lcrypto -lfido2 -lcbor $(FUZZ_LIBS)
|
2020-01-21 23:30:13 +00:00
|
|
|
COMMON_OBJS=ssh-sk-null.o
|
2017-09-08 02:44:13 +00:00
|
|
|
|
2019-10-09 02:49:35 +00:00
|
|
|
TARGETS=pubkey_fuzz sig_fuzz authopt_fuzz sshsig_fuzz \
|
2020-12-04 03:01:27 +00:00
|
|
|
sshsigopt_fuzz privkey_fuzz kex_fuzz
|
2019-09-05 05:45:32 +00:00
|
|
|
|
|
|
|
all: $(TARGETS)
|
2017-09-08 02:44:13 +00:00
|
|
|
|
|
|
|
.cc.o:
|
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
|
|
|
2020-01-21 23:30:13 +00:00
|
|
|
pubkey_fuzz: pubkey_fuzz.o $(COMMON_OBJS)
|
|
|
|
$(CXX) -o $@ pubkey_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS)
|
2017-09-08 02:44:13 +00:00
|
|
|
|
2020-01-21 23:30:13 +00:00
|
|
|
sig_fuzz: sig_fuzz.o $(COMMON_OBJS)
|
|
|
|
$(CXX) -o $@ sig_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS)
|
2017-09-08 02:44:13 +00:00
|
|
|
|
2020-01-21 23:30:13 +00:00
|
|
|
authopt_fuzz: authopt_fuzz.o $(COMMON_OBJS)
|
|
|
|
$(CXX) -o $@ authopt_fuzz.o $(COMMON_OBJS) ../../../auth-options.o $(LDFLAGS) $(LIBS)
|
2018-09-14 05:16:34 +00:00
|
|
|
|
2020-01-21 23:30:13 +00:00
|
|
|
sshsig_fuzz: sshsig_fuzz.o $(COMMON_OBJS)
|
|
|
|
$(CXX) -o $@ sshsig_fuzz.o $(COMMON_OBJS) ../../../sshsig.o $(LDFLAGS) $(LIBS)
|
2019-09-05 01:09:28 +00:00
|
|
|
|
2020-01-21 23:30:13 +00:00
|
|
|
sshsigopt_fuzz: sshsigopt_fuzz.o $(COMMON_OBJS)
|
|
|
|
$(CXX) -o $@ sshsigopt_fuzz.o $(COMMON_OBJS) ../../../sshsig.o $(LDFLAGS) $(LIBS)
|
2019-09-05 05:45:32 +00:00
|
|
|
|
2020-01-21 23:30:13 +00:00
|
|
|
privkey_fuzz: privkey_fuzz.o $(COMMON_OBJS)
|
|
|
|
$(CXX) -o $@ privkey_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS)
|
2019-10-09 02:49:35 +00:00
|
|
|
|
2020-12-04 03:01:27 +00:00
|
|
|
kex_fuzz: kex_fuzz.o $(COMMON_OBJS)
|
|
|
|
$(CXX) -o $@ kex_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS) -lz
|
|
|
|
|
2017-09-08 02:44:13 +00:00
|
|
|
clean:
|
2019-09-05 05:45:32 +00:00
|
|
|
-rm -f *.o $(TARGETS)
|