2004-07-27 13:32:54 +00:00
# This Makefile is for Dropbear SSH Server and Client
2005-01-02 17:08:27 +00:00
# @configure_input@
2004-07-27 13:32:54 +00:00
# invocation:
2017-06-27 14:42:32 +00:00
# make PROGRAMS="dropbear dbclient scp" MULTI=1 SCPPROGRESS=1
2004-07-27 13:32:54 +00:00
#
2017-06-27 14:42:32 +00:00
# to make a multiple-program binary "dropbearmulti".
2004-08-17 04:35:01 +00:00
# This example will include dropbear, scp, dropbearkey, dropbearconvert, and
# dbclient functionality, and includes the progress-bar functionality in scp.
2004-07-27 13:32:54 +00:00
i f n d e f P R O G R A M S
2004-08-14 17:35:28 +00:00
PROGRAMS = dropbear dbclient dropbearkey dropbearconvert
2004-07-27 13:32:54 +00:00
e n d i f
2024-07-24 00:31:27 +00:00
srcdir = @srcdir@/src
VPATH = @srcdir@/src
2014-02-18 13:03:27 +00:00
STATIC_LTC = libtomcrypt/libtomcrypt.a
STATIC_LTM = libtommath/libtommath.a
LIBTOM_LIBS = @LIBTOM_LIBS@
2004-06-01 02:46:09 +00:00
2010-07-21 12:38:46 +00:00
i f e q ( @ B U N D L E D _ L I B T O M @ , 1 )
2024-07-24 00:31:27 +00:00
LIBTOM_DEPS = $( STATIC_LTC) $( STATIC_LTM)
LIBTOM_CLEAN = ltc-clean ltm-clean
CPPFLAGS += -I$( srcdir) /../libtomcrypt/src/headers/
LIBTOM_LIBS = $( STATIC_LTC) $( STATIC_LTM)
2010-07-21 12:38:46 +00:00
e n d i f
2024-07-24 00:31:27 +00:00
i f n e q ( $( wildcard ./localoptions .h ) , )
CPPFLAGS += -DLOCALOPTIONS_H_EXISTS
e n d i f
i f n e q ( $( wildcard $ ( srcdir ) /distrooptions .h ) , )
CPPFLAGS += -DDISTROOPTIONS_H_EXISTS
2016-05-04 13:33:40 +00:00
e n d i f
2024-07-24 00:31:27 +00:00
OBJ_DIR = ./obj
MAN_DIR = @srcdir@/manpages
_COMMONOBJS = dbutil.o buffer.o dbhelpers.o \
2004-07-27 14:44:43 +00:00
dss.o bignum.o \
2013-11-14 14:05:47 +00:00
signkey.o rsa.o dbrandom.o \
2004-07-27 14:44:43 +00:00
queue.o \
2013-04-08 16:36:04 +00:00
atomicio.o compat.o fake-rfc2553.o \
2022-01-22 13:53:04 +00:00
ltc_prng.o ecc.o ecdsa.o sk-ecdsa.o crypto_desc.o \
curve25519.o ed25519.o sk-ed25519.o \
2017-05-21 02:54:11 +00:00
dbmalloc.o \
2020-03-11 16:09:45 +00:00
gensignkey.o gendss.o genrsa.o gened25519.o
2024-07-24 00:31:27 +00:00
COMMONOBJS = $( patsubst %,$( OBJ_DIR) /%,$( _COMMONOBJS) )
2004-06-01 02:46:09 +00:00
2024-07-24 00:31:27 +00:00
_SVROBJS = svr-kex.o svr-auth.o sshpty.o \
2008-09-08 15:14:02 +00:00
svr-authpasswd.o svr-authpubkey.o svr-authpubkeyoptions.o svr-session.o svr-service.o \
2004-08-10 17:09:52 +00:00
svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o\
2011-02-25 12:14:33 +00:00
svr-tcpfwd.o svr-authpam.o
2024-07-24 00:31:27 +00:00
SVROBJS = $( patsubst %,$( OBJ_DIR) /%,$( _SVROBJS) )
2004-06-01 02:46:09 +00:00
2024-07-24 00:31:27 +00:00
_CLIOBJS = cli-main.o cli-auth.o cli-authpasswd.o cli-kex.o \
2013-03-31 13:38:17 +00:00
cli-session.o cli-runopts.o cli-chansession.o \
2009-07-01 04:53:17 +00:00
cli-authpubkey.o cli-tcpfwd.o cli-channel.o cli-authinteract.o \
2024-07-24 00:31:27 +00:00
cli-agentfwd.o cli-readconf.o
CLIOBJS = $( patsubst %,$( OBJ_DIR) /%,$( _CLIOBJS) )
2004-06-01 02:46:09 +00:00
2024-07-24 00:31:27 +00:00
_CLISVROBJS = common-session.o packet.o common-algo.o common-kex.o \
common-channel.o common-chansession.o termcodes.o loginrec.o \
tcp-accept.o listener.o process-packet.o dh_groups.o \
common-runopts.o circbuffer.o list.o netio.o chachapoly.o gcm.o
CLISVROBJS = $( patsubst %,$( OBJ_DIR) /%,$( _CLISVROBJS) )
2004-06-01 02:46:09 +00:00
2024-07-24 00:31:27 +00:00
_KEYOBJS = dropbearkey.o
KEYOBJS = $( patsubst %,$( OBJ_DIR) /%,$( _KEYOBJS) )
2004-06-01 02:46:09 +00:00
2024-07-24 00:31:27 +00:00
_CONVERTOBJS = dropbearconvert.o keyimport.o signkey_ossh.o
CONVERTOBJS = $( patsubst %,$( OBJ_DIR) /%,$( _CONVERTOBJS) )
2004-06-01 02:46:09 +00:00
2024-07-24 00:31:27 +00:00
_SCPOBJS = scp.o progressmeter.o atomicio.o scpmisc.o compat.o
SCPOBJS = $( patsubst %,$( OBJ_DIR) /%,$( _SCPOBJS) )
2004-06-01 02:46:09 +00:00
2017-05-18 16:48:46 +00:00
i f e q ( @ D R O P B E A R _ F U Z Z @ , 1 )
2020-10-23 15:10:20 +00:00
allobjs = $( COMMONOBJS) fuzz/fuzz-common.o fuzz/fuzz-wrapfd.o $( CLISVROBJS) $( CLIOBJS) $( SVROBJS) @CRYPTLIB@
2024-07-24 00:31:27 +00:00
allobjs:= $( subst $( OBJ_DIR) /svr-main.o, ,$( allobjs) )
allobjs:= $( subst $( OBJ_DIR) /cli-main.o, ,$( allobjs) )
2018-02-28 14:02:12 +00:00
2024-07-24 00:31:27 +00:00
dropbearobjs = $( allobjs) $( OBJ_DIR) /svr-main.o
dbclientobjs = $( allobjs) $( OBJ_DIR) /cli-main.o
2018-02-28 14:02:12 +00:00
dropbearkeyobjs = $( allobjs) $( KEYOBJS)
dropbearconvertobjs = $( allobjs) $( CONVERTOBJS)
2018-03-04 09:08:21 +00:00
# CXX only set when fuzzing
CXX = @CXX@
2020-10-23 15:10:20 +00:00
FUZZ_CLEAN = fuzz-clean
2018-02-28 14:02:12 +00:00
e l s e
dropbearobjs = $( COMMONOBJS) $( CLISVROBJS) $( SVROBJS)
dbclientobjs = $( COMMONOBJS) $( CLISVROBJS) $( CLIOBJS)
dropbearkeyobjs = $( COMMONOBJS) $( KEYOBJS)
dropbearconvertobjs = $( COMMONOBJS) $( CONVERTOBJS)
scpobjs = $( SCPOBJS)
2017-05-18 16:48:46 +00:00
e n d i f
2019-05-15 13:59:45 +00:00
i f e q ( @ D R O P B E A R _ P L U G I N @ , 1 )
2024-07-24 00:31:27 +00:00
# rdynamic makes all the global symbols of dropbear available to all the loaded shared libraries
# this allow a plugin to reuse existing crypto/utilities like base64_decode/base64_encode without
# the need to rewrite them.
PLUGIN_LIBS = -ldl -rdynamic
2019-05-15 13:43:57 +00:00
e l s e
2024-07-24 00:31:27 +00:00
PLUGIN_LIBS =
2019-05-15 13:43:57 +00:00
e n d i f
2004-06-01 02:46:09 +00:00
prefix = @prefix@
2013-10-09 13:58:07 +00:00
exec_prefix = @exec_prefix@
2013-10-03 15:45:25 +00:00
datarootdir = @datarootdir@
bindir = @bindir@
sbindir = @sbindir@
mandir = @mandir@
2004-06-01 02:46:09 +00:00
2016-05-04 13:33:40 +00:00
.DELETE_ON_ERROR :
2004-06-01 02:46:09 +00:00
CC = @CC@
AR = @AR@
RANLIB = @RANLIB@
STRIP = @STRIP@
INSTALL = @INSTALL@
2022-03-22 08:17:05 +00:00
CPPFLAGS += @CPPFLAGS@ -I. -I$( srcdir)
CFLAGS += @CFLAGS@
2010-07-21 12:38:46 +00:00
LIBS += @LIBS@
2004-06-01 02:46:09 +00:00
LDFLAGS = @LDFLAGS@
2004-07-27 13:32:54 +00:00
EXEEXT = @EXEEXT@
2017-06-27 14:37:46 +00:00
STATIC = @STATIC@
2004-07-27 13:32:54 +00:00
# whether we're building client, server, or both for the common objects.
# evilness so we detect 'dropbear' by itself as a word
2004-07-27 14:44:43 +00:00
i f n e q ( , $( strip $ ( foreach prog , $ ( PROGRAMS ) , $ ( findstring ZdropbearZ , Z $ ( prog ) Z ) ) ) )
2022-03-22 08:17:05 +00:00
CPPFLAGS += -DDROPBEAR_SERVER
2004-07-27 13:32:54 +00:00
e n d i f
2004-07-27 14:44:43 +00:00
i f n e q ( , $( strip $ ( foreach prog , $ ( PROGRAMS ) , $ ( findstring ZdbclientZ , Z $ ( prog ) Z ) ) ) )
2022-03-22 08:17:05 +00:00
CPPFLAGS += -DDROPBEAR_CLIENT
2004-07-27 13:32:54 +00:00
e n d i f
2004-06-01 02:46:09 +00:00
# these are exported so that libtomcrypt's makefile will use them
export CC
export CFLAGS
2022-03-22 08:17:05 +00:00
export CPPFLAGS
2004-06-01 02:46:09 +00:00
export RANLIB AR STRIP
2004-07-27 13:32:54 +00:00
i f e q ( $( STATIC ) , 1 )
LDFLAGS += -static
e n d i f
2004-06-01 02:46:09 +00:00
2004-07-27 13:32:54 +00:00
i f e q ( $( MULTI ) , 1 )
2017-06-27 15:02:05 +00:00
TARGETS = dropbearmulti$( EXEEXT)
2004-07-27 13:32:54 +00:00
e l s e
TARGETS = $( PROGRAMS)
e n d i f
2004-06-01 02:46:09 +00:00
2004-07-27 13:32:54 +00:00
# for the scp progress meter. The -D doesn't affect anything else.
i f e q ( $( SCPPROGRESS ) , 1 )
2022-03-22 08:17:05 +00:00
CPPFLAGS += -DPROGRESS_METER
2004-07-27 13:32:54 +00:00
e n d i f
2004-06-01 02:46:09 +00:00
2004-07-27 14:44:43 +00:00
all : $( TARGETS )
2004-06-01 02:46:09 +00:00
2018-02-19 14:16:50 +00:00
# for simplicity assume all source depends on all headers
2024-07-24 00:31:27 +00:00
HEADERS = $( wildcard $( srcdir) /*.h *.h) default_options_guard.h
$(OBJ_DIR) :
mkdir -p $@
$(OBJ_DIR)/%.o : $( srcdir ) /%.c $( HEADERS ) | $( OBJ_DIR )
$( CC) $( CFLAGS) $( CPPFLAGS) $< -o $@ -c
fuzz/%.o : $( srcdir ) /../fuzz /%.c $( HEADERS )
$( CC) $( CFLAGS) $( CPPFLAGS) $< -o $@ -c
2018-02-19 14:16:50 +00:00
2024-07-24 00:31:27 +00:00
default_options_guard.h : $( srcdir ) /default_options .h
2018-02-19 14:16:50 +00:00
@echo Creating $@
@printf "/*\n > > > Do not edit this file (default_options_guard.h) < < <\nGenerated from " $^"\nLocal customisation goes in localoptions.h\n*/\n\n" > $@ .tmp
@$( srcdir) /ifndef_wrapper.sh < $^ >> $@ .tmp
2024-07-24 00:31:27 +00:00
mv -v $@ .tmp $@
pwd
ls -l $@
2018-02-13 16:17:30 +00:00
2004-07-27 14:44:43 +00:00
strip : $( TARGETS )
2005-03-02 04:13:01 +00:00
$( STRIP) $( addsuffix $( EXEEXT) , $( TARGETS) )
2004-06-01 02:46:09 +00:00
2004-09-21 12:14:20 +00:00
install : $( addprefix inst_ , $ ( TARGETS ) )
2004-08-17 04:35:01 +00:00
2017-06-27 15:02:05 +00:00
insmultidropbear : dropbearmulti $( EXEEXT )
2013-10-03 15:45:25 +00:00
$( INSTALL) -d $( DESTDIR) $( sbindir)
2005-03-02 04:13:01 +00:00
-rm -f $( DESTDIR) $( sbindir) /dropbear$( EXEEXT)
2024-07-24 00:31:27 +00:00
-ln -s $( bindir) /dropbearmulti$( EXEEXT) $( DESTDIR) $( sbindir) /dropbear$( EXEEXT)
2013-10-09 14:24:39 +00:00
$( INSTALL) -d $( DESTDIR) $( mandir) /man8
2024-07-24 00:31:27 +00:00
$( INSTALL) -m 644 $( MAN_DIR) /dropbear.8 $( DESTDIR) $( mandir) /man8/dropbear.8
2004-08-17 04:35:01 +00:00
2017-06-27 15:02:05 +00:00
insmulti% : dropbearmulti $( EXEEXT )
2013-10-03 15:45:25 +00:00
$( INSTALL) -d $( DESTDIR) $( bindir)
2024-07-24 00:31:27 +00:00
-rm -f $( DESTDIR) $( bindir) /$* $( EXEEXT)
-ln -s $( bindir) /dropbearmulti$( EXEEXT) $( DESTDIR) $( bindir) /$* $( EXEEXT)
2013-10-09 14:24:39 +00:00
$( INSTALL) -d $( DESTDIR) $( mandir) /man1
2024-07-24 00:31:27 +00:00
if test -e $( MAN_DIR) /$* .1; then $( INSTALL) -m 644 $( MAN_DIR) /$* .1 $( DESTDIR) $( mandir) /man1/$* .1; fi
2004-06-01 02:46:09 +00:00
2015-02-24 12:45:07 +00:00
# dropbear should go in sbin, so it needs a separate rule
2004-09-21 12:14:20 +00:00
inst_dropbear : dropbear
2013-10-03 15:45:25 +00:00
$( INSTALL) -d $( DESTDIR) $( sbindir)
$( INSTALL) dropbear$( EXEEXT) $( DESTDIR) $( sbindir)
$( INSTALL) -d $( DESTDIR) $( mandir) /man8
2024-07-24 00:31:27 +00:00
$( INSTALL) -m 644 $( MAN_DIR) /dropbear.8 $( DESTDIR) $( mandir) /man8/dropbear.8
2004-06-01 02:46:09 +00:00
2014-03-07 13:30:20 +00:00
inst_% : %
2013-10-03 15:45:25 +00:00
$( INSTALL) -d $( DESTDIR) $( bindir)
$( INSTALL) $* $( EXEEXT) $( DESTDIR) $( bindir)
$( INSTALL) -d $( DESTDIR) $( mandir) /man1
2024-07-24 00:31:27 +00:00
if test -e $( MAN_DIR) /$* .1; then $( INSTALL) -m 644 $( MAN_DIR) /$* .1 $( DESTDIR) $( mandir) /man1/$* .1; fi
2013-10-09 14:24:39 +00:00
2024-07-24 00:31:27 +00:00
inst_dropbearmulti : $( addprefix insmulti , $ ( PROGRAMS ) )
2004-06-01 02:46:09 +00:00
2004-07-27 14:44:43 +00:00
# for some reason the rule further down doesn't like $($@objs) as a prereq.
2004-07-27 13:32:54 +00:00
dropbear : $( dropbearobjs )
2004-07-27 14:44:43 +00:00
dbclient : $( dbclientobjs )
dropbearkey : $( dropbearkeyobjs )
dropbearconvert : $( dropbearconvertobjs )
2004-06-01 02:46:09 +00:00
2014-02-06 23:57:45 +00:00
dropbear : $( HEADERS ) $( LIBTOM_DEPS ) Makefile
2019-05-15 13:59:45 +00:00
$( CC) $( LDFLAGS) -o $@ $( EXEEXT) $( $@ objs) $( LIBTOM_LIBS) $( LIBS) @CRYPTLIB@ $( PLUGIN_LIBS)
2014-02-06 23:57:45 +00:00
dbclient : $( HEADERS ) $( LIBTOM_DEPS ) Makefile
2014-02-06 23:53:32 +00:00
$( CC) $( LDFLAGS) -o $@ $( EXEEXT) $( $@ objs) $( LIBTOM_LIBS) $( LIBS)
dropbearkey dropbearconvert : $( HEADERS ) $( LIBTOM_DEPS ) Makefile
2018-02-28 14:02:12 +00:00
$( CC) $( LDFLAGS) -o $@ $( EXEEXT) $( $@ objs) $( LIBTOM_LIBS) $( LIBS)
2004-06-01 02:46:09 +00:00
2004-07-27 13:32:54 +00:00
# scp doesn't use the libs so is special.
2004-07-27 16:30:46 +00:00
scp : $( SCPOBJS ) $( HEADERS ) Makefile
2006-10-11 16:00:50 +00:00
$( CC) $( LDFLAGS) -o $@ $( EXEEXT) $( SCPOBJS)
2004-06-01 02:46:09 +00:00
2004-07-27 14:44:43 +00:00
# multi-binary compilation.
MULTIOBJS =
2004-07-27 13:32:54 +00:00
i f e q ( $( MULTI ) , 1 )
2024-07-24 00:31:27 +00:00
MULTIOBJS = $( OBJ_DIR) /dbmulti.o $( sort $( foreach prog, $( PROGRAMS) , $( $( prog) objs) ) )
2022-03-22 08:17:05 +00:00
CPPFLAGS += $( addprefix -DDBMULTI_, $( PROGRAMS) ) -DDROPBEAR_MULTI
2004-07-27 13:32:54 +00:00
e n d i f
2004-06-01 02:46:09 +00:00
2013-12-11 13:48:02 +00:00
dropbearmulti$(EXEEXT) : $( HEADERS ) $( MULTIOBJS ) $( LIBTOM_DEPS ) Makefile
2014-02-06 23:57:45 +00:00
$( CC) $( LDFLAGS) -o $@ $( MULTIOBJS) $( LIBTOM_LIBS) $( LIBS) @CRYPTLIB@
2004-08-17 04:35:01 +00:00
2013-12-11 13:48:02 +00:00
multibinary : dropbearmulti $( EXEEXT )
2004-08-17 04:35:01 +00:00
multilink : multibinary $( addprefix link , $ ( PROGRAMS ) )
link% :
2005-03-02 04:13:01 +00:00
-rm -f $* $( EXEEXT)
-ln -s dropbearmulti$( EXEEXT) $* $( EXEEXT)
2004-06-01 02:46:09 +00:00
2024-07-24 00:31:27 +00:00
$(STATIC_LTC) : $( HEADERS )
2016-05-04 15:59:34 +00:00
$( MAKE) -C libtomcrypt
2004-06-01 02:46:09 +00:00
2024-07-24 00:31:27 +00:00
$(STATIC_LTM) : $( HEADERS )
2016-05-04 15:59:34 +00:00
$( MAKE) -C libtommath
2004-06-01 02:46:09 +00:00
2021-10-18 07:17:14 +00:00
.PHONY : clean sizes thisclean distclean tidy ltc -clean ltm -clean lint check
2006-10-11 16:00:50 +00:00
2004-06-01 02:46:09 +00:00
ltc-clean :
2016-05-04 15:59:34 +00:00
$( MAKE) -C libtomcrypt clean
2004-06-01 02:46:09 +00:00
ltm-clean :
2016-05-04 15:59:34 +00:00
$( MAKE) -C libtommath clean
2004-06-01 02:46:09 +00:00
sizes : dropbear
objdump -t dropbear| grep ".text" | cut -d "." -f 2| sort -rn
2020-10-23 15:10:20 +00:00
clean : $( LIBTOM_CLEAN ) $( FUZZ_CLEAN ) thisclean
2004-08-17 10:40:31 +00:00
thisclean :
2017-06-27 15:02:05 +00:00
-rm -f dropbear$( EXEEXT) dbclient$( EXEEXT) dropbearkey$( EXEEXT) \
dropbearconvert$( EXEEXT) scp$( EXEEXT) scp-progress$( EXEEXT) \
2024-07-24 00:31:27 +00:00
dropbearmulti$( EXEEXT) *.o *.da *.bb *.bbg *.prof \
$( OBJ_DIR) /*
2004-06-01 02:46:09 +00:00
distclean : clean tidy
2024-07-24 00:31:27 +00:00
-rm -f src/config.h config.status config.log
-rm -f Makefile test/Makefile
2018-02-19 14:16:50 +00:00
-rm -f default_options_guard.h
2004-06-01 02:46:09 +00:00
tidy :
-rm -f *~ *.gcov */*~
2017-05-12 15:14:54 +00:00
2020-05-24 05:15:24 +00:00
lint :
cd $( srcdir) ; ./dropbear_lint.sh
2021-10-18 07:17:14 +00:00
check : lint
2021-10-18 06:24:32 +00:00
make -C test
2017-05-13 14:50:54 +00:00
## Fuzzing targets
2017-05-13 16:00:21 +00:00
# list of fuzz targets
2020-10-18 04:17:39 +00:00
FUZZ_TARGETS = fuzzer-preauth fuzzer-pubkey fuzzer-verify fuzzer-preauth_nomaths \
2020-11-13 15:18:05 +00:00
fuzzer-kexdh fuzzer-kexecdh fuzzer-kexcurve25519 fuzzer-client fuzzer-client_nomaths \
2024-07-24 00:31:27 +00:00
fuzzer-postauth_nomaths fuzzer-cliconf
2017-05-13 16:00:21 +00:00
2017-05-23 14:43:52 +00:00
FUZZER_OPTIONS = $( addsuffix .options, $( FUZZ_TARGETS) )
2020-10-26 14:52:07 +00:00
FUZZ_OBJS = $( addprefix fuzz/,$( addsuffix .o,$( FUZZ_TARGETS) ) ) \
fuzz/fuzz-sshpacketmutator.o
2017-05-23 14:43:52 +00:00
2017-05-13 16:00:21 +00:00
list-fuzz-targets :
@echo $( FUZZ_TARGETS)
2017-05-13 14:50:54 +00:00
# fuzzers that don't use libfuzzer, just a standalone harness that feeds inputs
2020-10-23 15:10:20 +00:00
fuzzstandalone : FUZZLIB =fuzz /fuzz -harness .o
fuzzstandalone : fuzz /fuzz -harness .o fuzz -targets
# Build all the fuzzers. Usually like
2024-07-24 00:31:27 +00:00
# make fuzz-targets FUZZLIB=-lFuzzer.a
2020-10-23 15:10:20 +00:00
# the library provides main(). Otherwise
# make fuzzstandalone
# provides a main in fuzz-harness.c
2017-05-23 14:43:52 +00:00
fuzz-targets : $( FUZZ_TARGETS ) $( FUZZER_OPTIONS )
2017-05-13 14:50:54 +00:00
2024-07-24 00:31:27 +00:00
$(FUZZ_TARGETS) : $( LIBTOM_DEPS ) $( allobjs ) $( FUZZ_OBJS )
2020-11-02 12:33:48 +00:00
$( CXX) $( CXXFLAGS) fuzz/$@ .o $( LDFLAGS) $( allobjs) -o $@ $( EXEEXT) $( LIBTOM_LIBS) $( LIBS) $( FUZZLIB) @CRYPTLIB@
2020-10-18 07:08:54 +00:00
2020-10-29 14:41:37 +00:00
# fuzzers that use the custom mutator - these expect a SSH network stream
MUTATOR_FUZZERS = fuzzer-client fuzzer-client_nomaths \
2020-11-13 15:18:05 +00:00
fuzzer-preauth fuzzer-preauth_nomaths fuzzer-postauth_nomaths
2020-12-05 03:54:53 +00:00
# Skip custom mutators for -fsanitize-memory since libfuzzer doesn't initialise memory
# Pending fix for it https://github.com/google/oss-fuzz/issues/4605
i f e q ( , $( findstring fsanitize =memory , $ ( CFLAGS ) ) )
2020-10-29 14:41:37 +00:00
$(MUTATOR_FUZZERS) : allobjs += fuzz /fuzz -sshpacketmutator .o
2020-12-05 03:54:53 +00:00
e n d i f
2020-10-26 14:52:07 +00:00
2017-05-23 14:43:52 +00:00
fuzzer-%.options : Makefile
echo "[libfuzzer]" > $@
echo "max_len = 50000" >> $@
2024-07-24 00:31:27 +00:00
# run this to update hardcoded hostkeys for for fuzzing.
2017-05-13 14:50:54 +00:00
# hostkeys.c is checked in to hg.
fuzz-hostkeys :
2017-05-12 15:14:54 +00:00
dropbearkey -t rsa -f keyr
dropbearkey -t dss -f keyd
dropbearkey -t ecdsa -size 256 -f keye
2020-03-11 16:09:45 +00:00
dropbearkey -t ed25519 -f keyed25519
2017-05-12 15:14:54 +00:00
echo > hostkeys.c
/usr/bin/xxd -i -a keyr >> hostkeys.c
/usr/bin/xxd -i -a keye >> hostkeys.c
/usr/bin/xxd -i -a keyd >> hostkeys.c
2020-03-11 16:09:45 +00:00
/usr/bin/xxd -i -a keyed25519 >> hostkeys.c
2020-10-23 15:10:20 +00:00
fuzz-clean :
-rm -f fuzz/*.o $( FUZZ_TARGETS) $( FUZZER_OPTIONS)