• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NB. libssh and libopenbsd-compat should be built with the same sanitizer opts.
2CXX=clang++-6.0
3FUZZ_FLAGS=-fsanitize=address,undefined -fsanitize-coverage=edge,trace-pc
4FUZZ_LIBS=-lFuzzer
5
6CXXFLAGS=-O2 -g -Wall -Wextra -Wno-unused-parameter -I ../../.. $(FUZZ_FLAGS)
7LDFLAGS=-L ../../.. -L ../../../openbsd-compat -g $(FUZZ_FLAGS)
8LIBS=-lssh -lopenbsd-compat -lcrypto -lfido2 -lcbor $(FUZZ_LIBS)
9COMMON_OBJS=ssh-sk-null.o
10
11TARGETS=pubkey_fuzz sig_fuzz authopt_fuzz sshsig_fuzz \
12	sshsigopt_fuzz privkey_fuzz
13
14all: $(TARGETS)
15
16.cc.o:
17	$(CXX) $(CXXFLAGS) -c $< -o $@
18
19pubkey_fuzz: pubkey_fuzz.o $(COMMON_OBJS)
20	$(CXX) -o $@ pubkey_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS)
21
22sig_fuzz: sig_fuzz.o $(COMMON_OBJS)
23	$(CXX) -o $@ sig_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS)
24
25authopt_fuzz: authopt_fuzz.o $(COMMON_OBJS)
26	$(CXX) -o $@ authopt_fuzz.o $(COMMON_OBJS) ../../../auth-options.o $(LDFLAGS) $(LIBS)
27
28sshsig_fuzz: sshsig_fuzz.o $(COMMON_OBJS)
29	$(CXX) -o $@ sshsig_fuzz.o $(COMMON_OBJS) ../../../sshsig.o $(LDFLAGS) $(LIBS)
30
31sshsigopt_fuzz: sshsigopt_fuzz.o $(COMMON_OBJS)
32	$(CXX) -o $@ sshsigopt_fuzz.o $(COMMON_OBJS) ../../../sshsig.o $(LDFLAGS) $(LIBS)
33
34privkey_fuzz: privkey_fuzz.o $(COMMON_OBJS)
35	$(CXX) -o $@ privkey_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS)
36
37clean:
38	-rm -f *.o $(TARGETS)
39