Mercurial > dropbear
comparison Makefile.in @ 1580:7f2be495dff6 coverity
merge coverity
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 04 Mar 2018 15:07:09 +0800 |
parents | b66fc351f7e8 |
children | 68abf717328d |
comparison
equal
deleted
inserted
replaced
1545:0b991dec7ab9 | 1580:7f2be495dff6 |
---|---|
17 | 17 |
18 LIBTOM_LIBS=@LIBTOM_LIBS@ | 18 LIBTOM_LIBS=@LIBTOM_LIBS@ |
19 | 19 |
20 ifeq (@BUNDLED_LIBTOM@, 1) | 20 ifeq (@BUNDLED_LIBTOM@, 1) |
21 LIBTOM_DEPS=$(STATIC_LTC) $(STATIC_LTM) | 21 LIBTOM_DEPS=$(STATIC_LTC) $(STATIC_LTM) |
22 LIBTOM_CLEAN=ltc-clean ltm-clean | |
22 CFLAGS+=-I$(srcdir)/libtomcrypt/src/headers/ | 23 CFLAGS+=-I$(srcdir)/libtomcrypt/src/headers/ |
23 LIBTOM_LIBS=$(STATIC_LTC) $(STATIC_LTM) | 24 LIBTOM_LIBS=$(STATIC_LTC) $(STATIC_LTM) |
24 endif | 25 endif |
25 | 26 |
26 OPTION_HEADERS = default_options_guard.h sysoptions.h | 27 OPTION_HEADERS = default_options_guard.h sysoptions.h |
33 dss.o bignum.o \ | 34 dss.o bignum.o \ |
34 signkey.o rsa.o dbrandom.o \ | 35 signkey.o rsa.o dbrandom.o \ |
35 queue.o \ | 36 queue.o \ |
36 atomicio.o compat.o fake-rfc2553.o \ | 37 atomicio.o compat.o fake-rfc2553.o \ |
37 ltc_prng.o ecc.o ecdsa.o crypto_desc.o \ | 38 ltc_prng.o ecc.o ecdsa.o crypto_desc.o \ |
39 dbmalloc.o \ | |
38 gensignkey.o gendss.o genrsa.o | 40 gensignkey.o gendss.o genrsa.o |
39 | 41 |
40 SVROBJS=svr-kex.o svr-auth.o sshpty.o \ | 42 SVROBJS=svr-kex.o svr-auth.o sshpty.o \ |
41 svr-authpasswd.o svr-authpubkey.o svr-authpubkeyoptions.o svr-session.o svr-service.o \ | 43 svr-authpasswd.o svr-authpubkey.o svr-authpubkeyoptions.o svr-session.o svr-service.o \ |
42 svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o\ | 44 svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o\ |
56 | 58 |
57 CONVERTOBJS=dropbearconvert.o keyimport.o | 59 CONVERTOBJS=dropbearconvert.o keyimport.o |
58 | 60 |
59 SCPOBJS=scp.o progressmeter.o atomicio.o scpmisc.o compat.o | 61 SCPOBJS=scp.o progressmeter.o atomicio.o scpmisc.o compat.o |
60 | 62 |
61 dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS) | 63 ifeq (@DROPBEAR_FUZZ@, 1) |
62 dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS) | 64 allobjs = $(COMMONOBJS) fuzz-common.o fuzz-wrapfd.o $(CLISVROBJS) $(CLIOBJS) $(SVROBJS) @CRYPTLIB@ |
63 dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS) | 65 allobjs:=$(subst svr-main.o, ,$(allobjs)) |
64 dropbearconvertobjs=$(COMMONOBJS) $(CONVERTOBJS) | 66 allobjs:=$(subst cli-main.o, ,$(allobjs)) |
65 scpobjs=$(SCPOBJS) | 67 allobjs:=$(sort $(allobjs)) |
68 | |
69 dropbearobjs=$(allobjs) svr-main.o | |
70 dbclientobjs=$(allobjs) cli-main.o | |
71 dropbearkeyobjs=$(allobjs) $(KEYOBJS) | |
72 dropbearconvertobjs=$(allobjs) $(CONVERTOBJS) | |
73 else | |
74 dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS) | |
75 dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS) | |
76 dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS) | |
77 dropbearconvertobjs=$(COMMONOBJS) $(CONVERTOBJS) | |
78 scpobjs=$(SCPOBJS) | |
79 endif | |
66 | 80 |
67 VPATH=@srcdir@ | 81 VPATH=@srcdir@ |
68 srcdir=@srcdir@ | 82 srcdir=@srcdir@ |
69 | 83 |
70 prefix=@prefix@ | 84 prefix=@prefix@ |
177 | 191 |
178 dbclient: $(HEADERS) $(LIBTOM_DEPS) Makefile | 192 dbclient: $(HEADERS) $(LIBTOM_DEPS) Makefile |
179 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) $(LIBS) | 193 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) $(LIBS) |
180 | 194 |
181 dropbearkey dropbearconvert: $(HEADERS) $(LIBTOM_DEPS) Makefile | 195 dropbearkey dropbearconvert: $(HEADERS) $(LIBTOM_DEPS) Makefile |
182 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) | 196 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) $(LIBS) |
183 | 197 |
184 # scp doesn't use the libs so is special. | 198 # scp doesn't use the libs so is special. |
185 scp: $(SCPOBJS) $(HEADERS) Makefile | 199 scp: $(SCPOBJS) $(HEADERS) Makefile |
186 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $(SCPOBJS) | 200 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $(SCPOBJS) |
187 | 201 |
219 $(MAKE) -C libtommath clean | 233 $(MAKE) -C libtommath clean |
220 | 234 |
221 sizes: dropbear | 235 sizes: dropbear |
222 objdump -t dropbear|grep ".text"|cut -d "." -f 2|sort -rn | 236 objdump -t dropbear|grep ".text"|cut -d "." -f 2|sort -rn |
223 | 237 |
224 clean: ltc-clean ltm-clean thisclean | 238 clean: $(LIBTOM_CLEAN) thisclean |
225 | 239 |
226 thisclean: | 240 thisclean: |
227 -rm -f dropbear$(EXEEXT) dbclient$(EXEEXT) dropbearkey$(EXEEXT) \ | 241 -rm -f dropbear$(EXEEXT) dbclient$(EXEEXT) dropbearkey$(EXEEXT) \ |
228 dropbearconvert$(EXEEXT) scp$(EXEEXT) scp-progress$(EXEEXT) \ | 242 dropbearconvert$(EXEEXT) scp$(EXEEXT) scp-progress$(EXEEXT) \ |
229 dropbearmulti$(EXEEXT) *.o *.da *.bb *.bbg *.prof | 243 dropbearmulti$(EXEEXT) *.o *.da *.bb *.bbg *.prof |
233 -rm -f Makefile | 247 -rm -f Makefile |
234 -rm -f default_options_guard.h | 248 -rm -f default_options_guard.h |
235 | 249 |
236 tidy: | 250 tidy: |
237 -rm -f *~ *.gcov */*~ | 251 -rm -f *~ *.gcov */*~ |
252 | |
253 ## Fuzzing targets | |
254 | |
255 # list of fuzz targets | |
256 FUZZ_TARGETS=fuzzer-preauth fuzzer-pubkey fuzzer-verify fuzzer-preauth_nomaths | |
257 | |
258 FUZZER_OPTIONS = $(addsuffix .options, $(FUZZ_TARGETS)) | |
259 | |
260 list-fuzz-targets: | |
261 @echo $(FUZZ_TARGETS) | |
262 | |
263 # fuzzers that don't use libfuzzer, just a standalone harness that feeds inputs | |
264 fuzzstandalone: FUZZLIB=fuzz-harness.o | |
265 fuzzstandalone: fuzz-harness.o fuzz-targets | |
266 | |
267 # exclude svr-main.o to avoid duplicate main | |
268 svrfuzzobjs=$(subst svr-main.o, ,$(dropbearobjs)) | |
269 | |
270 # build all the fuzzers. This will require fail to link unless built with | |
271 # make fuzz-targetsk FUZZLIB=-lFuzzer.a | |
272 # or similar - the library provides main(). | |
273 fuzz-targets: $(FUZZ_TARGETS) $(FUZZER_OPTIONS) | |
274 | |
275 fuzzer-preauth: fuzzer-preauth.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs) | |
276 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@ | |
277 | |
278 fuzzer-preauth_nomaths: fuzzer-preauth_nomaths.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs) | |
279 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@ | |
280 | |
281 | |
282 fuzzer-pubkey: fuzzer-pubkey.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs) | |
283 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@ | |
284 | |
285 fuzzer-verify: fuzzer-verify.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs) | |
286 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@ | |
287 | |
288 fuzzer-%.options: Makefile | |
289 echo "[libfuzzer]" > $@ | |
290 echo "max_len = 50000" >> $@ | |
291 | |
292 # run this to update hardcoded hostkeys for for fuzzing. | |
293 # hostkeys.c is checked in to hg. | |
294 fuzz-hostkeys: | |
295 dropbearkey -t rsa -f keyr | |
296 dropbearkey -t dss -f keyd | |
297 dropbearkey -t ecdsa -size 256 -f keye | |
298 echo > hostkeys.c | |
299 /usr/bin/xxd -i -a keyr >> hostkeys.c | |
300 /usr/bin/xxd -i -a keye >> hostkeys.c | |
301 /usr/bin/xxd -i -a keyd >> hostkeys.c |