From 7d1750f1d6c24163bf22790f8527f1783315c5e7 Mon Sep 17 00:00:00 2001 From: des Date: Thu, 26 Feb 2004 10:38:49 +0000 Subject: Vendor import of OpenSSH 3.8p1. --- crypto/openssh/regress/Makefile | 5 ++-- crypto/openssh/regress/README.regress | 12 ++++++++-- crypto/openssh/regress/agent-ptrace.sh | 13 ++++++++-- crypto/openssh/regress/banner.sh | 44 ++++++++++++++++++++++++++++++++++ crypto/openssh/regress/sftp-badcmds.sh | 2 +- crypto/openssh/regress/sftp-batch.sh | 4 ++-- crypto/openssh/regress/sftp-cmds.sh | 16 ++++++++++++- crypto/openssh/regress/ssh-com.sh | 4 ++-- crypto/openssh/regress/test-exec.sh | 3 +-- 9 files changed, 89 insertions(+), 14 deletions(-) create mode 100644 crypto/openssh/regress/banner.sh (limited to 'crypto/openssh/regress') diff --git a/crypto/openssh/regress/Makefile b/crypto/openssh/regress/Makefile index 623be8d..76e28d3 100644 --- a/crypto/openssh/regress/Makefile +++ b/crypto/openssh/regress/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.24 2003/07/03 08:24:13 markus Exp $ +# $OpenBSD: Makefile,v 1.26 2003/10/11 11:49:49 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 empty.in remote_pid #LTESTS += ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp diff --git a/crypto/openssh/regress/README.regress b/crypto/openssh/regress/README.regress index 916894a..b479c6c 100644 --- a/crypto/openssh/regress/README.regress +++ b/crypto/openssh/regress/README.regress @@ -22,7 +22,7 @@ Environment variables. SUDO: path to sudo command, if desired. Note that some systems (notably systems using PAM) require sudo to execute some tests. -TEST_SSH_TRACE: set yo "yes" for verbose output from tests +TEST_SSH_TRACE: set to "yes" for verbose output from tests TEST_SSH_QUIET: set to "yes" to suppress non-fatal output. TEST_SSH_x: path to "ssh" command under test, where x=SSH,SSHD,SSHAGENT,SSHADD SSHKEYGEN,SSHKEYSCAN,SFTP,SFTPSERVER @@ -82,5 +82,13 @@ Failed tests can be difficult to diagnose. Suggestions: Known Issues. +- If you build with tcpwrappers and try to run the regression tests, + your hosts.allow must permit connections from localhost and from + "unknown". This is because some tests are performed via the loopback + interface, while others are done with "sshd -i" as a ProxyCommand. In + the latter case, when sshd calls getpeername() on the socket it will + fail (because it's not a tcp socket) and will be identified as + "unknown", which is then checked against tcpwrappers. -$Id: README.regress,v 1.1 2003/09/04 05:39:54 dtucker Exp $ + +$Id: README.regress,v 1.3 2004/01/28 01:26:14 dtucker Exp $ diff --git a/crypto/openssh/regress/agent-ptrace.sh b/crypto/openssh/regress/agent-ptrace.sh index cd9c002..bd79d7c 100644 --- a/crypto/openssh/regress/agent-ptrace.sh +++ b/crypto/openssh/regress/agent-ptrace.sh @@ -5,7 +5,7 @@ tid="disallow agent ptrace attach" if have_prog uname ; then case `uname` in - Linux|HP-UX|SunOS|NetBSD|AIX|CYGWIN*) + AIX|CYGWIN*) echo "skipped (not supported on this platform)" exit 0 ;; @@ -19,6 +19,15 @@ else exit 0 fi +if test -z "$SUDO" ; then + echo "skipped (SUDO not set)" + exit 0 +else + $SUDO chown 0 ${SSHAGENT} + $SUDO chgrp 0 ${SSHAGENT} + $SUDO chmod 2755 ${SSHAGENT} +fi + trace "start agent" eval `${SSHAGENT} -s` > /dev/null r=$? @@ -32,7 +41,7 @@ EOF if [ $? -ne 0 ]; then fail "gdb failed: exit code $?" fi - grep 'ptrace: Operation not permitted.' >/dev/null ${OBJ}/gdb.out + egrep 'ptrace: Operation not permitted.|procfs:.*Permission denied.|ttrace attach: Permission denied.' >/dev/null ${OBJ}/gdb.out r=$? rm -f ${OBJ}/gdb.out if [ $r -ne 0 ]; then diff --git a/crypto/openssh/regress/banner.sh b/crypto/openssh/regress/banner.sh new file mode 100644 index 0000000..0b9c950 --- /dev/null +++ b/crypto/openssh/regress/banner.sh @@ -0,0 +1,44 @@ +# $OpenBSD: banner.sh,v 1.2 2003/10/11 11:49:49 dtucker Exp $ +# Placed in the Public Domain. + +tid="banner" +echo "Banner $OBJ/banner.in" >> $OBJ/sshd_proxy + +rm -f $OBJ/banner.out $OBJ/banner.in $OBJ/empty.in +touch $OBJ/empty.in + +trace "test missing banner file" +verbose "test $tid: missing banner file" +( ${SSH} -2 -F $OBJ/ssh_proxy otherhost true 2>$OBJ/banner.out && \ + cmp $OBJ/empty.in $OBJ/banner.out ) || \ + fail "missing banner file" + +for s in 0 10 100 1000 10000 100000 ; do + if [ "$s" = "0" ]; then + # create empty banner + 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 && \ + cmp $OBJ/banner.in $OBJ/banner.out ) || \ + fail "banner size $s mismatch" +done + +trace "test suppress banner (-q)" +verbose "test $tid: suppress banner (-q)" +( ${SSH} -q -2 -F $OBJ/ssh_proxy otherhost true 2>$OBJ/banner.out && \ + cmp $OBJ/empty.in $OBJ/banner.out ) || \ + fail "suppress banner (-q)" + +rm -f $OBJ/banner.out $OBJ/banner.in $OBJ/empty.in diff --git a/crypto/openssh/regress/sftp-badcmds.sh b/crypto/openssh/regress/sftp-badcmds.sh index a6a1940..eac189a 100644 --- a/crypto/openssh/regress/sftp-badcmds.sh +++ b/crypto/openssh/regress/sftp-badcmds.sh @@ -4,7 +4,7 @@ tid="sftp invalid commands" DATA=/bin/ls${EXEEXT} -DATA2=/bin/cat${EXEEXT} +DATA2=/bin/sh${EXEEXT} NONEXIST=/NONEXIST.$$ COPY=${OBJ}/copy GLOBFILES=`(cd /bin;echo l*)` diff --git a/crypto/openssh/regress/sftp-batch.sh b/crypto/openssh/regress/sftp-batch.sh index f648eae..365c47c 100644 --- a/crypto/openssh/regress/sftp-batch.sh +++ b/crypto/openssh/regress/sftp-batch.sh @@ -1,11 +1,11 @@ -# $OpenBSD: sftp-batch.sh,v 1.2 2003/01/10 07:52:41 djm Exp $ +# $OpenBSD: sftp-batch.sh,v 1.3 2004/01/13 09:49:06 djm Exp $ # Placed in the Public Domain. tid="sftp batchfile" DATA=/bin/ls${EXEEXT} COPY=${OBJ}/copy -BATCH=${OBJ}/sftp-batch.tmp +BATCH=${OBJ}/sftp.bb rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* diff --git a/crypto/openssh/regress/sftp-cmds.sh b/crypto/openssh/regress/sftp-cmds.sh index 1256aeb..3669b19 100644 --- a/crypto/openssh/regress/sftp-cmds.sh +++ b/crypto/openssh/regress/sftp-cmds.sh @@ -1,4 +1,4 @@ -# $OpenBSD: sftp-cmds.sh,v 1.5 2003/07/19 00:46:31 djm Exp $ +# $OpenBSD: sftp-cmds.sh,v 1.6 2003/10/07 07:04:52 djm Exp $ # Placed in the Public Domain. # XXX - TODO: @@ -79,6 +79,20 @@ echo "get $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ || fail "get failed" cmp $DATA ${COPY} || fail "corrupted copy after get" +rm -f ${COPY} +verbose "$tid: get quoted" +echo "get \"$DATA\" $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ + || fail "get failed" +cmp $DATA ${COPY} || fail "corrupted copy after get" + +rm -f ${QUOTECOPY} +cp $DATA ${QUOTECOPY} +verbose "$tid: get filename with quotes" +echo "get \"$QUOTECOPY_ARG\" ${COPY}" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ + || fail "put failed" +cmp ${COPY} ${QUOTECOPY} || fail "corrupted copy after get with quotes" +rm -f ${QUOTECOPY} ${COPY} + rm -f ${COPY}.dd/* verbose "$tid: get to directory" echo "get $DATA ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ diff --git a/crypto/openssh/regress/ssh-com.sh b/crypto/openssh/regress/ssh-com.sh index 78ae6e9..c3715a2 100644 --- a/crypto/openssh/regress/ssh-com.sh +++ b/crypto/openssh/regress/ssh-com.sh @@ -1,4 +1,4 @@ -# $OpenBSD: ssh-com.sh,v 1.5 2003/05/14 22:08:27 markus Exp $ +# $OpenBSD: ssh-com.sh,v 1.6 2003/11/07 10:16:44 jmc Exp $ # Placed in the Public Domain. tid="connect to ssh.com server" @@ -29,7 +29,7 @@ SRC=`dirname ${SCRIPT}` # ssh.com cat << EOF > $OBJ/sshd2_config #*: - # Port and ListenAdress are not used. + # Port and ListenAddress are not used. QuietMode yes Port 4343 ListenAddress 127.0.0.1 diff --git a/crypto/openssh/regress/test-exec.sh b/crypto/openssh/regress/test-exec.sh index cc7ea67..98851dc 100644 --- a/crypto/openssh/regress/test-exec.sh +++ b/crypto/openssh/regress/test-exec.sh @@ -30,7 +30,7 @@ if [ ! -f $SCRIPT ]; then echo "not a file: $SCRIPT" exit 2 fi -if sh -n $SCRIPT; then +if $TEST_SHELL -n $SCRIPT; then true else echo "syntax error in $SCRIPT" @@ -185,7 +185,6 @@ Host * ChallengeResponseAuthentication no HostbasedAuthentication no PasswordAuthentication no - RhostsAuthentication no RhostsRSAAuthentication no BatchMode yes StrictHostKeyChecking yes -- cgit v1.1