@@ -151,7 +151,7 @@ $(SSHOBJS): Makefile.in config.h
151
151
$(SSHDOBJS ) : Makefile.in config.h
152
152
153
153
.c.o :
154
- $(CC ) $(CFLAGS ) $(CPPFLAGS ) -c $<
154
+ $(CC ) $(CFLAGS ) $(CPPFLAGS ) -c $< -o $@
155
155
156
156
LIBWIN32COMPAT =contrib/win32/win32compat/@LIBWIN32COMPAT@
157
157
$(LIBWIN32COMPAT ) : always
@@ -207,9 +207,10 @@ $(MANPAGES): $(MANPAGES_IN)
207
207
manpage=$(srcdir ) /` echo $@ | sed ' s/\.out$$//' ` ; \
208
208
fi ; \
209
209
if test " $( MANTYPE) " = " man" ; then \
210
- $(FIXPATHSCMD ) $$ {manpage} | $(AWK ) -f $(srcdir ) /mdoc2man.awk > $@ ; \
210
+ $(FIXPATHSCMD ) $$ {manpage} | $(FIXALGORITHMSCMD ) | \
211
+ $(AWK ) -f $(srcdir ) /mdoc2man.awk > $@ ; \
211
212
else \
212
- $(FIXPATHSCMD ) $$ {manpage} > $@ ; \
213
+ $(FIXPATHSCMD ) $$ {manpage} | $( FIXALGORITHMSCMD ) > $@ ; \
213
214
fi
214
215
215
216
$(CONFIGFILES ) : $(CONFIGFILES_IN )
@@ -230,6 +231,18 @@ umac128.o: umac.c
230
231
clean : regressclean
231
232
rm -f * .o * .a $(TARGETS ) logintest config.cache config.log
232
233
rm -f * .out core survey
234
+ rm -f regress/unittests/test_helper/* .a
235
+ rm -f regress/unittests/test_helper/* .o
236
+ rm -f regress/unittests/sshbuf/* .o
237
+ rm -f regress/unittests/sshbuf/test_sshbuf
238
+ rm -f regress/unittests/sshkey/* .o
239
+ rm -f regress/unittests/sshkey/test_sshkey
240
+ rm -f regress/unittests/bitmap/* .o
241
+ rm -f regress/unittests/bitmap/test_bitmap
242
+ rm -f regress/unittests/hostkeys/* .o
243
+ rm -f regress/unittests/hostkeys/test_hostkeys
244
+ rm -f regress/unittests/kex/* .o
245
+ rm -f regress/unittests/kex/test_kex
233
246
(cd openbsd-compat && $( MAKE) clean)
234
247
if test -f contrib/win32/win32compat/Makefile ; then \
235
248
(cd contrib/win32/win32compat && $( MAKE) clean) \
@@ -239,8 +252,20 @@ distclean: regressclean
239
252
rm -f * .o * .a $(TARGETS ) logintest config.cache config.log
240
253
rm -f * .out core opensshd.init openssh.xml
241
254
rm -f Makefile buildpkg.sh config.h config.status
242
- rm -f survey.sh openbsd-compat/regress/Makefile * ~
255
+ rm -f survey.sh openbsd-compat/regress/Makefile * ~
243
256
rm -rf autom4te.cache
257
+ rm -f regress/unittests/test_helper/* .a
258
+ rm -f regress/unittests/test_helper/* .o
259
+ rm -f regress/unittests/sshbuf/* .o
260
+ rm -f regress/unittests/sshbuf/test_sshbuf
261
+ rm -f regress/unittests/sshkey/* .o
262
+ rm -f regress/unittests/sshkey/test_sshkey
263
+ rm -f regress/unittests/bitmap/* .o
264
+ rm -f regress/unittests/bitmap/test_bitmap
265
+ rm -f regress/unittests/hostkeys/* .o
266
+ rm -f regress/unittests/hostkeys/test_hostkeys
267
+ rm -f regress/unittests/kex/* .o
268
+ rm -f regress/unittests/kex/test_kex
244
269
(cd openbsd-compat && $( MAKE) distclean)
245
270
if test -f contrib/win32/win32compat/Makefile ; then \
246
271
(cd contrib/win32/win32compat && $( MAKE) distclean) \
@@ -416,12 +441,117 @@ uninstall:
416
441
-rm -f $(DESTDIR )$(mandir ) /$(mansubdir ) 8/ssh-pkcs11-helper.8
417
442
-rm -f $(DESTDIR )$(mandir ) /$(mansubdir ) 1/slogin.1
418
443
419
- tests interop-tests : $(TARGETS )
444
+ regress-prep :
445
+ [ -d ` pwd` /regress ] || mkdir -p ` pwd` /regress
446
+ [ -d ` pwd` /regress/unittests ] || mkdir -p ` pwd` /regress/unittests
447
+ [ -d ` pwd` /regress/unittests/test_helper ] || \
448
+ mkdir -p ` pwd` /regress/unittests/test_helper
449
+ [ -d ` pwd` /regress/unittests/sshbuf ] || \
450
+ mkdir -p ` pwd` /regress/unittests/sshbuf
451
+ [ -d ` pwd` /regress/unittests/sshkey ] || \
452
+ mkdir -p ` pwd` /regress/unittests/sshkey
453
+ [ -d ` pwd` /regress/unittests/bitmap ] || \
454
+ mkdir -p ` pwd` /regress/unittests/bitmap
455
+ [ -d ` pwd` /regress/unittests/hostkeys ] || \
456
+ mkdir -p ` pwd` /regress/unittests/hostkeys
457
+ [ -d ` pwd` /regress/unittests/kex ] || \
458
+ mkdir -p ` pwd` /regress/unittests/kex
459
+ [ -f ` pwd` /regress/Makefile ] || \
460
+ ln -s ` cd $( srcdir) && pwd` /regress/Makefile ` pwd` /regress/Makefile
461
+
462
+ regress/modpipe$(EXEEXT ) : $(srcdir ) /regress/modpipe.c
463
+ $(CC ) $(CFLAGS ) $(CPPFLAGS ) -o $@ $? \
464
+ $(LDFLAGS ) ./libssh.a -lopenbsd-compat @LINKWIN32COMPAT@ $(LIBS )
465
+
466
+ regress/setuid-allowed$(EXEEXT ) : $(srcdir ) /regress/setuid-allowed.c
467
+ $(CC ) $(CFLAGS ) $(CPPFLAGS ) -o $@ $? \
468
+ $(LDFLAGS ) ./libssh.a -lopenbsd-compat @LINKWIN32COMPAT@ $(LIBS )
469
+
470
+ regress/netcat$(EXEEXT ) : $(srcdir ) /regress/netcat.c
471
+ $(CC ) $(CFLAGS ) $(CPPFLAGS ) -o $@ $? \
472
+ $(LDFLAGS ) ./libssh.a -lopenbsd-compat @LINKWIN32COMPAT@ $(LIBS )
473
+
474
+ UNITTESTS_TEST_HELPER_OBJS =\
475
+ regress/unittests/test_helper/test_helper.o \
476
+ regress/unittests/test_helper/fuzz.o
477
+
478
+ regress/unittests/test_helper/libtest_helper.a : ${UNITTESTS_TEST_HELPER_OBJS}
479
+ $(AR ) rv $@ $(UNITTESTS_TEST_HELPER_OBJS )
480
+ $(RANLIB ) $@
481
+
482
+ UNITTESTS_TEST_SSHBUF_OBJS =\
483
+ regress/unittests/sshbuf/tests.o \
484
+ regress/unittests/sshbuf/test_sshbuf.o \
485
+ regress/unittests/sshbuf/test_sshbuf_getput_basic.o \
486
+ regress/unittests/sshbuf/test_sshbuf_getput_crypto.o \
487
+ regress/unittests/sshbuf/test_sshbuf_misc.o \
488
+ regress/unittests/sshbuf/test_sshbuf_fuzz.o \
489
+ regress/unittests/sshbuf/test_sshbuf_getput_fuzz.o \
490
+ regress/unittests/sshbuf/test_sshbuf_fixed.o
491
+
492
+ regress/unittests/sshbuf/test_sshbuf$(EXEEXT ) : ${UNITTESTS_TEST_SSHBUF_OBJS} \
493
+ regress/unittests/test_helper/libtest_helper.a libssh.a
494
+ $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_SSHBUF_OBJS) \
495
+ regress/unittests/test_helper/libtest_helper.a \
496
+ ./libssh.a -lopenbsd-compat -lwin32compat $(LIBS)
497
+
498
+ UNITTESTS_TEST_SSHKEY_OBJS =\
499
+ regress/unittests/sshkey/test_fuzz.o \
500
+ regress/unittests/sshkey/tests.o \
501
+ regress/unittests/sshkey/common.o \
502
+ regress/unittests/sshkey/test_file.o \
503
+ regress/unittests/sshkey/test_sshkey.o
504
+
505
+ regress/unittests/sshkey/test_sshkey$(EXEEXT ) : ${UNITTESTS_TEST_SSHKEY_OBJS} \
506
+ regress/unittests/test_helper/libtest_helper.a libssh.a
507
+ $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_SSHKEY_OBJS) \
508
+ regress/unittests/test_helper/libtest_helper.a \
509
+ ./libssh.a -lopenbsd-compat -lwin32compat $(LIBS)
510
+
511
+ UNITTESTS_TEST_BITMAP_OBJS =\
512
+ regress/unittests/bitmap/tests.o
513
+
514
+ regress/unittests/bitmap/test_bitmap$(EXEEXT ) : ${UNITTESTS_TEST_BITMAP_OBJS} \
515
+ regress/unittests/test_helper/libtest_helper.a libssh.a
516
+ $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_BITMAP_OBJS) \
517
+ regress/unittests/test_helper/libtest_helper.a \
518
+ ./libssh.a -lopenbsd-compat -lwin32compat $(LIBS)
519
+
520
+ UNITTESTS_TEST_KEX_OBJS =\
521
+ regress/unittests/kex/tests.o \
522
+ regress/unittests/kex/test_kex.o \
523
+ roaming_dummy.o
524
+
525
+ regress/unittests/kex/test_kex$(EXEEXT ) : ${UNITTESTS_TEST_KEX_OBJS} \
526
+ regress/unittests/test_helper/libtest_helper.a libssh.a
527
+ $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_KEX_OBJS) \
528
+ regress/unittests/test_helper/libtest_helper.a \
529
+ ./libssh.a -lopenbsd-compat -lwin32compat $(LIBS)
530
+
531
+ UNITTESTS_TEST_HOSTKEYS_OBJS =\
532
+ regress/unittests/hostkeys/tests.o \
533
+ regress/unittests/hostkeys/test_iterate.o
534
+
535
+ regress/unittests/hostkeys/test_hostkeys$(EXEEXT ) : \
536
+ ${UNITTESTS_TEST_HOSTKEYS_OBJS} \
537
+ regress/unittests/test_helper/libtest_helper.a libssh.a
538
+ $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_HOSTKEYS_OBJS) \
539
+ regress/unittests/test_helper/libtest_helper.a \
540
+ ./libssh.a -lopenbsd-compat -lwin32compat $(LIBS)
541
+
542
+ REGRESS_BINARIES =\
543
+ regress/modpipe$(EXEEXT ) \
544
+ regress/setuid-allowed$(EXEEXT ) \
545
+ regress/netcat$(EXEEXT ) \
546
+ regress/unittests/sshbuf/test_sshbuf$(EXEEXT ) \
547
+ regress/unittests/sshkey/test_sshkey$(EXEEXT ) \
548
+ regress/unittests/bitmap/test_bitmap$(EXEEXT ) \
549
+ regress/unittests/hostkeys/test_hostkeys$(EXEEXT ) \
550
+ regress/unittests/kex/test_kex$(EXEEXT )
551
+
552
+ tests interop-tests t-exec : regress-prep $(TARGETS ) $(REGRESS_BINARIES )
420
553
BUILDDIR=` pwd` ; \
421
- [ -d ` pwd` /regress ] || mkdir -p ` pwd` /regress; \
422
- [ -f ` pwd` /regress/Makefile ] || \
423
- ln -s ` cd $( srcdir) && pwd` /regress/Makefile ` pwd` /regress/Makefile ; \
424
- TEST_SHELL=" @TEST_SHELL@" ; \
554
+ TEST_SSH_SCP=" $$ {BUILDDIR}/scp" ; \
425
555
TEST_SSH_SSH=" $$ {BUILDDIR}/ssh" ; \
426
556
TEST_SSH_SSHD=" $$ {BUILDDIR}/sshd" ; \
427
557
TEST_SSH_SSHAGENT=" $$ {BUILDDIR}/ssh-agent" ; \
@@ -436,15 +566,15 @@ tests interop-tests: $(TARGETS)
436
566
TEST_SSH_CONCH=" conch" ; \
437
567
TEST_SSH_IPV6=" @TEST_SSH_IPV6@" ; \
438
568
TEST_SSH_ECC=" @TEST_SSH_ECC@" ; \
439
- TEST_SSH_SHA256=" @TEST_SSH_SHA256@" ; \
440
569
cd $(srcdir ) /regress || exit $$? ; \
441
570
$(MAKE ) \
442
571
.OBJDIR=" $$ {BUILDDIR}/regress" \
443
572
.CURDIR=" ` pwd` " \
444
573
BUILDDIR=" $$ {BUILDDIR}" \
445
574
OBJ=" $$ {BUILDDIR}/regress/" \
446
575
PATH=" $$ {BUILDDIR}:$$ {PATH}" \
447
- TEST_SHELL=" $$ {TEST_SHELL}" \
576
+ TEST_ENV=MALLOC_OPTIONS=" @TEST_MALLOC_OPTIONS@" \
577
+ TEST_SSH_SCP=" $$ {TEST_SSH_SCP}" \
448
578
TEST_SSH_SSH=" $$ {TEST_SSH_SSH}" \
449
579
TEST_SSH_SSHD=" $$ {TEST_SSH_SSHD}" \
450
580
TEST_SSH_SSHAGENT=" $$ {TEST_SSH_SSHAGENT}" \
@@ -459,7 +589,7 @@ tests interop-tests: $(TARGETS)
459
589
TEST_SSH_CONCH=" $$ {TEST_SSH_CONCH}" \
460
590
TEST_SSH_IPV6=" $$ {TEST_SSH_IPV6}" \
461
591
TEST_SSH_ECC=" $$ {TEST_SSH_ECC}" \
462
- TEST_SSH_SHA256 =" $$ {TEST_SSH_SHA256 }" \
592
+ TEST_SHELL =" ${TEST_SHELL } " \
463
593
EXEEXT=" $( EXEEXT) " \
464
594
$@ && echo all tests passed
465
595
0 commit comments