comparison Makefile.in @ 1370:dd5d7b7141b9 fuzz

create fuzzer .options files
author Matt Johnston <matt@ucc.asn.au>
date Tue, 23 May 2017 22:43:52 +0800
parents ddfcadca3c4c
children d201105df2ed
comparison
equal deleted inserted replaced
1369:ddfcadca3c4c 1370:dd5d7b7141b9
245 ## Fuzzing targets 245 ## Fuzzing targets
246 246
247 # list of fuzz targets 247 # list of fuzz targets
248 FUZZ_TARGETS=fuzzer-preauth fuzzer-pubkey 248 FUZZ_TARGETS=fuzzer-preauth fuzzer-pubkey
249 249
250 FUZZER_OPTIONS = $(addsuffix .options, $(FUZZ_TARGETS))
251
250 list-fuzz-targets: 252 list-fuzz-targets:
251 @echo $(FUZZ_TARGETS) 253 @echo $(FUZZ_TARGETS)
252 254
253 # fuzzers that don't use libfuzzer, just a standalone harness that feeds inputs 255 # fuzzers that don't use libfuzzer, just a standalone harness that feeds inputs
254 fuzzstandalone: FUZZLIB=fuzz-harness.o 256 fuzzstandalone: FUZZLIB=fuzz-harness.o
258 svrfuzzobjs=$(subst svr-main.o, ,$(dropbearobjs)) 260 svrfuzzobjs=$(subst svr-main.o, ,$(dropbearobjs))
259 261
260 # build all the fuzzers. This will require fail to link unless built with 262 # build all the fuzzers. This will require fail to link unless built with
261 # make fuzzers LIBS=-lFuzzer.a 263 # make fuzzers LIBS=-lFuzzer.a
262 # or similar - the library provides main(). 264 # or similar - the library provides main().
263 fuzz-targets: $(FUZZ_TARGETS) 265 fuzz-targets: $(FUZZ_TARGETS) $(FUZZER_OPTIONS)
264 266
265 fuzzer-preauth: fuzzer-preauth.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs) 267 fuzzer-preauth: fuzzer-preauth.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs)
266 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@ 268 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@
267 269
268 fuzzer-pubkey: fuzzer-pubkey.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs) 270 fuzzer-pubkey: fuzzer-pubkey.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs)
269 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@ 271 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@
272
273 fuzzer-%.options: Makefile
274 echo "[libfuzzer]" > $@
275 echo "max_len = 50000" >> $@
270 276
271 # run this to update hardcoded hostkeys for for fuzzing. 277 # run this to update hardcoded hostkeys for for fuzzing.
272 # hostkeys.c is checked in to hg. 278 # hostkeys.c is checked in to hg.
273 fuzz-hostkeys: 279 fuzz-hostkeys:
274 dropbearkey -t rsa -f keyr 280 dropbearkey -t rsa -f keyr