From dc001a5ee3352b69d96a8970ec269df9df130fa3 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 8 Oct 2003 17:47:19 +1000 Subject: [PATCH] - dtucker@cvs.openbsd.org 2003/10/07 01:52:13 [regress/Makefile regress/banner.sh] Test SSH2 banner. ok markus@ --- ChangeLog | 5 ++++- regress/Makefile | 5 +++-- regress/banner.sh | 31 +++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 regress/banner.sh diff --git a/ChangeLog b/ChangeLog index 2ec3e8294..00a50c61a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ - deraadt@cvs.openbsd.org 2003/10/07 21:58:28 [sshconnect2.c] set ptr to NULL after free + - dtucker@cvs.openbsd.org 2003/10/07 01:52:13 + [regress/Makefile regress/banner.sh] + Test SSH2 banner. ok markus@ 20031007 - (djm) Delete autom4te.cache after autoreconf @@ -1305,4 +1308,4 @@ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. Report from murple@murple.net, diagnosis from dtucker@zip.com.au -$Id: ChangeLog,v 1.3066 2003/10/08 07:37:58 dtucker Exp $ +$Id: ChangeLog,v 1.3067 2003/10/08 07:47:19 dtucker Exp $ diff --git a/regress/Makefile b/regress/Makefile index 623be8d82..da4a6731c 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.24 2003/07/03 08:24:13 markus Exp $ +# $OpenBSD: Makefile,v 1.25 2003/10/07 01:52:13 dtucker Exp $ REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec tests: $(REGRESS_TARGETS) @@ -14,6 +14,7 @@ LTESTS= connect \ proto-mismatch \ exit-status \ transfer \ + banner \ rekey \ stderr-data \ stderr-after-eof \ @@ -40,7 +41,7 @@ CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ ssh_config ssh_proxy sshd_config sshd_proxy \ rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \ rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \ - ls.copy remote_pid + ls.copy banner.in banner.out remote_pid #LTESTS += ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp diff --git a/regress/banner.sh b/regress/banner.sh new file mode 100644 index 000000000..03e2fc8f1 --- /dev/null +++ b/regress/banner.sh @@ -0,0 +1,31 @@ +# $OpenBSD: banner.sh,v 1.1 2003/10/07 01:52:13 dtucker Exp $ +# Placed in the Public Domain. + +tid="banner" +echo "Banner $OBJ/banner.in" >> $OBJ/sshd_proxy + +for s in 0 10 100 1000 10000 100000 ; do + if [ "$s" = "0" ]; then + # create empty banner + rm -f $OBJ/banner.in + touch $OBJ/banner.in + elif [ "$s" = "10" ]; then + # create 10-byte banner file + echo "abcdefghi" >$OBJ/banner.in + else + # increase size 10x + cp $OBJ/banner.in $OBJ/banner.out + for i in 0 1 2 3 4 5 6 7 8 ; do + cat $OBJ/banner.out >> $OBJ/banner.in + done + fi + + trace "test banner size $s" + verbose "test $tid: size $s" + ${SSH} -2 -F $OBJ/ssh_proxy otherhost true 2>$OBJ/banner.out + if ! cmp $OBJ/banner.in $OBJ/banner.out ; then + fail "banner size $s mismatch" + fi +done + +rm -f $OBJ/banner.out $OBJ/banner.in