From 75129025a2d504b630d1718fef0da002f5662f63 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 17 May 2013 09:19:10 +1000 Subject: - dtucker@cvs.openbsd.org 2013/04/06 06:00:22 [regress/rekey.sh regress/test-exec.sh regress/integrity.sh regress/multiplex.sh Makefile regress/cfgmatch.sh] Split the regress log into 3 parts: the debug output from ssh, the debug log from sshd and the output from the client command (ssh, scp or sftp). Somewhat functional now, will become more useful when ssh/sshd -E is added. --- regress/rekey.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'regress/rekey.sh') diff --git a/regress/rekey.sh b/regress/rekey.sh index 3c5f266fc..b23cfca70 100644 --- a/regress/rekey.sh +++ b/regress/rekey.sh @@ -1,11 +1,11 @@ -# $OpenBSD: rekey.sh,v 1.1 2003/03/28 13:58:28 markus Exp $ +# $OpenBSD: rekey.sh,v 1.2 2013/04/06 06:00:22 dtucker Exp $ # Placed in the Public Domain. tid="rekey during transfer data" DATA=${OBJ}/data COPY=${OBJ}/copy -LOG=${OBJ}/log +LOG=${TEST_SSH_LOGFILE} rm -f ${COPY} ${LOG} ${DATA} touch ${DATA} @@ -29,4 +29,4 @@ for s in 16 1k 128k 256k; do fail "no rekeying occured" fi done -rm -f ${COPY} ${LOG} ${DATA} +rm -f ${COPY} ${DATA} -- cgit v1.2.3 From dfea3bcdd7c980c2335402464b7dd8d8721e426d Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 17 May 2013 09:31:39 +1000 Subject: - dtucker@cvs.openbsd.org 2013/04/07 02:16:03 [regress/Makefile regress/rekey.sh regress/integrity.sh regress/sshd-log-wrapper.sh regress/forwarding.sh regress/test-exec.sh] use -E option for ssh and sshd to write debuging logs to ssh{,d}.log and save the output from any failing tests. If a test fails the debug output from ssh and sshd for the failing tests (and only the failing tests) should be available in failed-ssh{,d}.log. --- ChangeLog | 7 +++++++ regress/Makefile | 5 +++-- regress/forwarding.sh | 6 +++--- regress/integrity.sh | 11 ++++++----- regress/rekey.sh | 5 ++--- regress/sshd-log-wrapper.sh | 4 ++-- regress/test-exec.sh | 44 ++++++++++++++++++++++++++++++++++++-------- 7 files changed, 59 insertions(+), 23 deletions(-) (limited to 'regress/rekey.sh') diff --git a/ChangeLog b/ChangeLog index 14450ac65..bb6787cf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,13 @@ Split the regress log into 3 parts: the debug output from ssh, the debug log from sshd and the output from the client command (ssh, scp or sftp). Somewhat functional now, will become more useful when ssh/sshd -E is added. + - dtucker@cvs.openbsd.org 2013/04/07 02:16:03 + [regress/Makefile regress/rekey.sh regress/integrity.sh + regress/sshd-log-wrapper.sh regress/forwarding.sh regress/test-exec.sh] + use -E option for ssh and sshd to write debuging logs to ssh{,d}.log and + save the output from any failing tests. If a test fails the debug output + from ssh and sshd for the failing tests (and only the failing tests) should + be available in failed-ssh{,d}.log. 20130516 - (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be diff --git a/regress/Makefile b/regress/Makefile index b99bd3e83..4ac5b4d42 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.63 2013/04/06 06:00:22 dtucker Exp $ +# $OpenBSD: Makefile,v 1.64 2013/04/07 02:16:03 dtucker Exp $ REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t-exec tests: $(REGRESS_TARGETS) @@ -83,7 +83,8 @@ CLEANFILES= t2.out t3.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ key.rsa-* key.dsa-* key.ecdsa-* \ authorized_principals_${USER} expect actual ready \ sshd_proxy.* authorized_keys_${USER}.* modpipe revoked-* krl-* \ - ssh.log sshd.log regress.log + ssh.log failed-ssh.log sshd.log failed-sshd.log \ + regress.log failed-regress.log ssh-log-wrapper.sh # Enable all malloc(3) randomisations and checks TEST_ENV= "MALLOC_OPTIONS=AFGJPRX" diff --git a/regress/forwarding.sh b/regress/forwarding.sh index f9c367beb..6a7003070 100644 --- a/regress/forwarding.sh +++ b/regress/forwarding.sh @@ -1,4 +1,4 @@ -# $OpenBSD: forwarding.sh,v 1.8 2012/06/01 00:47:35 djm Exp $ +# $OpenBSD: forwarding.sh,v 1.9 2013/04/07 02:16:03 dtucker Exp $ # Placed in the Public Domain. tid="local and remote forwarding" @@ -75,7 +75,7 @@ for p in 1 2; do else # this one should fail ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 true \ - 2>>$TEST_SSH_LOGFILE && \ + >>$TEST_REGRESS_LOGFILE 2>&1 && \ fail "local forwarding not cleared" fi sleep 10 @@ -88,7 +88,7 @@ for p in 1 2; do else # this one should fail ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 true \ - 2>>$TEST_SSH_LOGFILE && \ + >>$TEST_REGRESS_LOGFILE 2>&1 && \ fail "remote forwarding not cleared" fi sleep 10 diff --git a/regress/integrity.sh b/regress/integrity.sh index 1bd330a18..3950b7d1f 100644 --- a/regress/integrity.sh +++ b/regress/integrity.sh @@ -1,4 +1,4 @@ -# $OpenBSD: integrity.sh,v 1.8 2013/04/06 06:00:22 dtucker Exp $ +# $OpenBSD: integrity.sh,v 1.9 2013/04/07 02:16:03 dtucker Exp $ # Placed in the Public Domain. tid="integrity" @@ -47,14 +47,15 @@ for m in $macs; do aes*gcm*) macopt="-c $m";; *) macopt="-m $m";; esac - output=`${SSH} $macopt -2F $OBJ/ssh_proxy -o "$pxy" \ - 999.999.999.999 'printf "%4096s" " "' 2>&1` + verbose "test $tid: $m @$off $output" + ${SSH} $macopt -2F $OBJ/ssh_proxy -o "$pxy" \ + 999.999.999.999 'printf "%4096s" " "' >/dev/null if [ $? -eq 0 ]; then fail "ssh -m $m succeeds with bit-flip at $off" fi ecnt=`expr $ecnt + 1` - output=`echo $output | tr -s '\r\n' '.'` - verbose "test $tid: $m @$off $output" + output=$(tail -2 $TEST_SSH_LOGFILE | egrep -v "^debug" | \ + tr -s '\r\n' '.') case "$output" in Bad?packet*) elen=`expr $elen + 1`; skip=3;; Corrupted?MAC* | Decryption?integrity?check?failed*) diff --git a/regress/rekey.sh b/regress/rekey.sh index b23cfca70..d2542ecd4 100644 --- a/regress/rekey.sh +++ b/regress/rekey.sh @@ -1,4 +1,4 @@ -# $OpenBSD: rekey.sh,v 1.2 2013/04/06 06:00:22 dtucker Exp $ +# $OpenBSD: rekey.sh,v 1.3 2013/04/07 02:16:03 dtucker Exp $ # Placed in the Public Domain. tid="rekey during transfer data" @@ -16,8 +16,7 @@ for s in 16 1k 128k 256k; do rm -f ${COPY} cat $DATA | \ ${SSH} -oCompression=no -oRekeyLimit=$s \ - -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}" \ - 2> ${LOG} + -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}" if [ $? -ne 0 ]; then fail "ssh failed" fi diff --git a/regress/sshd-log-wrapper.sh b/regress/sshd-log-wrapper.sh index c7a5ef3a6..a9386be4d 100644 --- a/regress/sshd-log-wrapper.sh +++ b/regress/sshd-log-wrapper.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: sshd-log-wrapper.sh,v 1.2 2005/02/27 11:40:30 dtucker Exp $ +# $OpenBSD: sshd-log-wrapper.sh,v 1.3 2013/04/07 02:16:03 dtucker Exp $ # Placed in the Public Domain. # # simple wrapper for sshd proxy mode to catch stderr output @@ -10,4 +10,4 @@ log=$2 shift shift -exec $sshd $@ -e 2>>$log +exec $sshd -E$log $@ diff --git a/regress/test-exec.sh b/regress/test-exec.sh index b02172c03..f797ab68d 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh @@ -1,4 +1,4 @@ -# $OpenBSD: test-exec.sh,v 1.39 2013/04/06 06:00:22 dtucker Exp $ +# $OpenBSD: test-exec.sh,v 1.40 2013/04/07 02:16:03 dtucker Exp $ # Placed in the Public Domain. #SUDO=sudo @@ -159,6 +159,15 @@ fi DATA=$OBJ/testdata cat $SSHD${EXEEXT} $SSHD${EXEEXT} $SSHD${EXEEXT} $SSHD${EXEEXT} >$DATA +# Create wrapper ssh with logging. We can't just specify "SSH=ssh -E..." +# because sftp and scp don't handle spaces in arguments. +SSHLOGWRAP=$OBJ/ssh-log-wrapper.sh +echo "#!/bin/sh" > $SSHLOGWRAP +echo "exec ${SSH} -E${TEST_SSH_LOGFILE} "'"$@"' >>$SSHLOGWRAP + +chmod a+rx $OBJ/ssh-log-wrapper.sh +SSH="$SSHLOGWRAP" + # these should be used in tests export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER $SCP @@ -214,9 +223,26 @@ cleanup () fi } +start_debug_log () +{ + echo "trace: $@" >$TEST_REGRESS_LOGFILE + echo "trace: $@" >$TEST_SSH_LOGFILE + echo "trace: $@" >$TEST_SSHD_LOGFILE +} + +save_debug_log () +{ + echo $@ >>$TEST_REGRESS_LOGFILE + echo $@ >>$TEST_SSH_LOGFILE + echo $@ >>$TEST_SSHD_LOGFILE + (cat $TEST_REGRESS_LOGFILE; echo) >>$OBJ/failed-regress.log + (cat $TEST_SSH_LOGFILE; echo) >>$OBJ/failed-ssh.log + (cat $TEST_SSHD_LOGFILE; echo) >>$OBJ/failed-sshd.log +} + trace () { - echo "trace: $@" >>$TEST_REGRESS_LOGFILE + start_debug_log $@ if [ "X$TEST_SSH_TRACE" = "Xyes" ]; then echo "$@" fi @@ -224,7 +250,7 @@ trace () verbose () { - echo "verbose: $@" >>$TEST_REGRESS_LOGFILE + start_debug_log $@ if [ "X$TEST_SSH_QUIET" != "Xyes" ]; then echo "$@" fi @@ -238,15 +264,16 @@ warn () fail () { - echo "FAIL: $@" >>$TEST_REGRESS_LOGFILE + save_debug_log "FAIL: $@" RESULT=1 echo "$@" + } fatal () { - echo "FATAL: $@" >>$TEST_REGRESS_LOGFILE - echon "FATAL: " + save_debug_log "FATAL: $@" + echo -n "FATAL: " fail "$@" cleanup exit $RESULT @@ -278,7 +305,7 @@ cat << EOF > $OBJ/sshd_config #ListenAddress ::1 PidFile $PIDFILE AuthorizedKeysFile $OBJ/authorized_keys_%u - LogLevel VERBOSE + LogLevel DEBUG3 AcceptEnv _XXX_TEST_* AcceptEnv _XXX_TEST Subsystem sftp $SFTPSERVER @@ -312,6 +339,7 @@ Host * PasswordAuthentication no BatchMode yes StrictHostKeyChecking yes + LogLevel DEBUG3 EOF if [ ! -z "$TEST_SSH_SSH_CONFOPTS" ]; then @@ -405,7 +433,7 @@ start_sshd () { # start sshd $SUDO ${SSHD} -f $OBJ/sshd_config "$@" -t || fatal "sshd_config broken" - $SUDO ${SSHD} -f $OBJ/sshd_config -e "$@" >>$TEST_SSHD_LOGFILE 2>&1 + $SUDO ${SSHD} -f $OBJ/sshd_config "$@" -E$TEST_SSHD_LOGFILE trace "wait for sshd" i=0; -- cgit v1.2.3 From a8a62fcc46c19997797846197a6256ed9a777a47 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 17 May 2013 09:42:34 +1000 Subject: - dtucker@cvs.openbsd.org 2013/05/16 02:10:35 [rekey.sh] Add test for time-based rekeying --- ChangeLog | 3 +++ regress/rekey.sh | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'regress/rekey.sh') diff --git a/ChangeLog b/ChangeLog index 5df073c92..41a628fa8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,9 @@ - djm@cvs.openbsd.org 2013/05/10 03:46:14 [modpipe.c] sync some portability changes from portable OpenSSH (id sync only) + - dtucker@cvs.openbsd.org 2013/05/16 02:10:35 + [rekey.sh] + Add test for time-based rekeying 20130516 - (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be diff --git a/regress/rekey.sh b/regress/rekey.sh index d2542ecd4..24d6c9652 100644 --- a/regress/rekey.sh +++ b/regress/rekey.sh @@ -1,4 +1,4 @@ -# $OpenBSD: rekey.sh,v 1.3 2013/04/07 02:16:03 dtucker Exp $ +# $OpenBSD: rekey.sh,v 1.4 2013/05/16 02:10:35 dtucker Exp $ # Placed in the Public Domain. tid="rekey during transfer data" @@ -13,7 +13,7 @@ dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1 for s in 16 1k 128k 256k; do trace "rekeylimit ${s}" - rm -f ${COPY} + rm -f ${COPY} ${LOG} cat $DATA | \ ${SSH} -oCompression=no -oRekeyLimit=$s \ -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}" @@ -28,4 +28,23 @@ for s in 16 1k 128k 256k; do fail "no rekeying occured" fi done + +for s in 5 10 15 ; do + trace "rekeylimit default ${s}" + rm -f ${COPY} ${LOG} + cat $DATA | \ + ${SSH} -oCompression=no -oRekeyLimit="default $s" -F \ + $OBJ/ssh_proxy somehost "cat >${COPY};sleep $s;sleep 5" + if [ $? -ne 0 ]; then + fail "ssh failed" + fi + cmp $DATA ${COPY} || fail "corrupted copy" + n=`grep 'NEWKEYS sent' ${LOG} | wc -l` + n=`expr $n - 1` + trace "$n rekeying(s)" + if [ $n -lt 1 ]; then + fail "no rekeying occured" + fi +done + rm -f ${COPY} ${DATA} -- cgit v1.2.3 From c31c8729c15f83fba14ef9da0d66bda6215ff69a Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 17 May 2013 09:43:33 +1000 Subject: - dtucker@cvs.openbsd.org 2013/05/16 03:33:30 [regress/rekey.sh] test rekeying when there's no data being transferred --- ChangeLog | 7 +++++-- regress/rekey.sh | 26 +++++++++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'regress/rekey.sh') diff --git a/ChangeLog b/ChangeLog index 41a628fa8..b44002024 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,11 +28,14 @@ [regress/multiplex.sh] Write mux master logs to regress.log instead of ssh.log to keep separate - djm@cvs.openbsd.org 2013/05/10 03:46:14 - [modpipe.c] + [regress/modpipe.c] sync some portability changes from portable OpenSSH (id sync only) - dtucker@cvs.openbsd.org 2013/05/16 02:10:35 - [rekey.sh] + [regress/rekey.sh] Add test for time-based rekeying + - dtucker@cvs.openbsd.org 2013/05/16 03:33:30 + [regress/rekey.sh] + test rekeying when there's no data being transferred 20130516 - (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be diff --git a/regress/rekey.sh b/regress/rekey.sh index 24d6c9652..3576a2a01 100644 --- a/regress/rekey.sh +++ b/regress/rekey.sh @@ -1,4 +1,4 @@ -# $OpenBSD: rekey.sh,v 1.4 2013/05/16 02:10:35 dtucker Exp $ +# $OpenBSD: rekey.sh,v 1.5 2013/05/16 03:33:30 dtucker Exp $ # Placed in the Public Domain. tid="rekey during transfer data" @@ -12,7 +12,7 @@ touch ${DATA} dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1 for s in 16 1k 128k 256k; do - trace "rekeylimit ${s}" + verbose "rekeylimit ${s}" rm -f ${COPY} ${LOG} cat $DATA | \ ${SSH} -oCompression=no -oRekeyLimit=$s \ @@ -29,12 +29,12 @@ for s in 16 1k 128k 256k; do fi done -for s in 5 10 15 ; do - trace "rekeylimit default ${s}" +for s in 5 10; do + verbose "rekeylimit default ${s}" rm -f ${COPY} ${LOG} cat $DATA | \ ${SSH} -oCompression=no -oRekeyLimit="default $s" -F \ - $OBJ/ssh_proxy somehost "cat >${COPY};sleep $s;sleep 5" + $OBJ/ssh_proxy somehost "cat >${COPY};sleep $s;sleep 3" if [ $? -ne 0 ]; then fail "ssh failed" fi @@ -47,4 +47,20 @@ for s in 5 10 15 ; do fi done +for s in 5 10; do + verbose "rekeylimit default ${s} no data" + rm -f ${COPY} ${LOG} + ${SSH} -oCompression=no -oRekeyLimit="default $s" -F \ + $OBJ/ssh_proxy somehost "sleep $s;sleep 3" + if [ $? -ne 0 ]; then + fail "ssh failed" + fi + n=`grep 'NEWKEYS sent' ${LOG} | wc -l` + n=`expr $n - 1` + trace "$n rekeying(s)" + if [ $n -lt 1 ]; then + fail "no rekeying occured" + fi +done + rm -f ${COPY} ${DATA} -- cgit v1.2.3 From 14490fe7b0f45b1b19f8a3dc10eb3d214f27f5bd Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 17 May 2013 09:44:20 +1000 Subject: - dtucker@cvs.openbsd.org 2013/05/16 04:26:10 [regress/rekey.sh] add server-side rekey test --- ChangeLog | 3 +++ regress/rekey.sh | 24 ++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'regress/rekey.sh') diff --git a/ChangeLog b/ChangeLog index b44002024..cff12dd94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -36,6 +36,9 @@ - dtucker@cvs.openbsd.org 2013/05/16 03:33:30 [regress/rekey.sh] test rekeying when there's no data being transferred + - dtucker@cvs.openbsd.org 2013/05/16 04:26:10 + [regress/rekey.sh] + add server-side rekey test 20130516 - (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be diff --git a/regress/rekey.sh b/regress/rekey.sh index 3576a2a01..736da9f92 100644 --- a/regress/rekey.sh +++ b/regress/rekey.sh @@ -1,4 +1,4 @@ -# $OpenBSD: rekey.sh,v 1.5 2013/05/16 03:33:30 dtucker Exp $ +# $OpenBSD: rekey.sh,v 1.6 2013/05/16 04:26:10 dtucker Exp $ # Placed in the Public Domain. tid="rekey during transfer data" @@ -12,7 +12,7 @@ touch ${DATA} dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1 for s in 16 1k 128k 256k; do - verbose "rekeylimit ${s}" + verbose "client rekeylimit ${s}" rm -f ${COPY} ${LOG} cat $DATA | \ ${SSH} -oCompression=no -oRekeyLimit=$s \ @@ -30,7 +30,7 @@ for s in 16 1k 128k 256k; do done for s in 5 10; do - verbose "rekeylimit default ${s}" + verbose "client rekeylimit default ${s}" rm -f ${COPY} ${LOG} cat $DATA | \ ${SSH} -oCompression=no -oRekeyLimit="default $s" -F \ @@ -48,7 +48,7 @@ for s in 5 10; do done for s in 5 10; do - verbose "rekeylimit default ${s} no data" + verbose "client rekeylimit default ${s} no data" rm -f ${COPY} ${LOG} ${SSH} -oCompression=no -oRekeyLimit="default $s" -F \ $OBJ/ssh_proxy somehost "sleep $s;sleep 3" @@ -63,4 +63,20 @@ for s in 5 10; do fi done +echo "rekeylimit default 5" >>$OBJ/sshd_proxy +for s in 5 10; do + verbose "server rekeylimit default ${s} no data" + rm -f ${COPY} ${LOG} + ${SSH} -oCompression=no -F $OBJ/ssh_proxy somehost "sleep $s;sleep 3" + if [ $? -ne 0 ]; then + fail "ssh failed" + fi + n=`grep 'NEWKEYS sent' ${LOG} | wc -l` + n=`expr $n - 1` + trace "$n rekeying(s)" + if [ $n -lt 1 ]; then + fail "no rekeying occured" + fi +done + rm -f ${COPY} ${DATA} -- cgit v1.2.3 From 982b0cbc4c2b5ea14725f4b339393cdf343dd0fe Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 17 May 2013 09:45:12 +1000 Subject: - dtucker@cvs.openbsd.org 2013/05/16 05:48:31 [regress/rekey.sh] add tests for RekeyLimit parsing --- ChangeLog | 3 +++ regress/rekey.sh | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) (limited to 'regress/rekey.sh') diff --git a/ChangeLog b/ChangeLog index cff12dd94..aabd6acd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,6 +39,9 @@ - dtucker@cvs.openbsd.org 2013/05/16 04:26:10 [regress/rekey.sh] add server-side rekey test + - dtucker@cvs.openbsd.org 2013/05/16 05:48:31 + [regress/rekey.sh] + add tests for RekeyLimit parsing 20130516 - (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be diff --git a/regress/rekey.sh b/regress/rekey.sh index 736da9f92..cefdea534 100644 --- a/regress/rekey.sh +++ b/regress/rekey.sh @@ -1,7 +1,7 @@ -# $OpenBSD: rekey.sh,v 1.6 2013/05/16 04:26:10 dtucker Exp $ +# $OpenBSD: rekey.sh,v 1.7 2013/05/16 05:48:31 dtucker Exp $ # Placed in the Public Domain. -tid="rekey during transfer data" +tid="rekey" DATA=${OBJ}/data COPY=${OBJ}/copy @@ -79,4 +79,35 @@ for s in 5 10; do fi done +verbose "rekeylimit parsing" +for size in 16 1k 1K 1m 1M 1g 1G; do + for time in 1 1m 1M 1h 1H 1d 1D 1w 1W; do + case $size in + 16) bytes=16 ;; + 1k|1K) bytes=1024 ;; + 1m|1M) bytes=1048576 ;; + 1g|1G) bytes=1073741824 ;; + esac + case $time in + 1) seconds=1 ;; + 1m|1M) seconds=60 ;; + 1h|1H) seconds=3600 ;; + 1d|1D) seconds=86400 ;; + 1w|1W) seconds=604800 ;; + esac + + b=`$SUDO ${SSHD} -T -o "rekeylimit $size $time" -f $OBJ/sshd_proxy | \ + awk '/rekeylimit/{print $2}'` + s=`$SUDO ${SSHD} -T -o "rekeylimit $size $time" -f $OBJ/sshd_proxy | \ + awk '/rekeylimit/{print $3}'` + + if [ "$bytes" != "$b" ]; then + fatal "rekeylimit size: expected $bytes got $b" + fi + if [ "$seconds" != "$s" ]; then + fatal "rekeylimit time: expected $time got $s" + fi + done +done + rm -f ${COPY} ${DATA} -- cgit v1.2.3 From 59d928d3b47e8298f4a8b4b3fb37fb8c8ce1b098 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 17 May 2013 15:32:29 +1000 Subject: - dtucker@cvs.openbsd.org 2013/05/17 04:29:14 [regress/sftp.sh regress/putty-ciphers.sh regress/cipher-speed.sh regress/test-exec.sh regress/sftp-batch.sh regress/dynamic-forward.sh regress/putty-transfer.sh regress/conch-ciphers.sh regress/sftp-cmds.sh regress/scp.sh regress/ssh-com-sftp.sh regress/rekey.sh regress/putty-kex.sh regress/stderr-data.sh regress/stderr-after-eof.sh regress/sftp-badcmds.sh regress/reexec.sh regress/ssh-com-client.sh regress/sftp-chroot.sh regress/forwarding.sh regress/transfer.sh regress/multiplex.sh] Move the setting of DATA and COPY into test-exec.sh --- ChangeLog | 10 ++++++++++ regress/cipher-speed.sh | 2 +- regress/conch-ciphers.sh | 5 +---- regress/dynamic-forward.sh | 4 +--- regress/forwarding.sh | 9 ++++----- regress/multiplex.sh | 4 +--- regress/putty-ciphers.sh | 5 +---- regress/putty-kex.sh | 5 +---- regress/putty-transfer.sh | 5 +---- regress/reexec.sh | 8 +++----- regress/rekey.sh | 8 ++------ regress/scp.sh | 4 +--- regress/sftp-badcmds.sh | 4 +--- regress/sftp-batch.sh | 4 +--- regress/sftp-chroot.sh | 4 +--- regress/sftp-cmds.sh | 4 +--- regress/sftp.sh | 5 +---- regress/ssh-com-client.sh | 6 +----- regress/ssh-com-sftp.sh | 4 +--- regress/stderr-after-eof.sh | 6 +----- regress/stderr-data.sh | 6 +----- regress/test-exec.sh | 15 ++++++++++----- regress/transfer.sh | 5 +---- 23 files changed, 47 insertions(+), 85 deletions(-) (limited to 'regress/rekey.sh') diff --git a/ChangeLog b/ChangeLog index a12bf335c..a0dd182f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,6 +58,16 @@ - dtucker@cvs.openbsd.org 2013/05/17 01:32:11 [regress/integrity.sh] don't print output from ssh before getting it (it's available in ssh.log) + - dtucker@cvs.openbsd.org 2013/05/17 04:29:14 + [regress/sftp.sh regress/putty-ciphers.sh regress/cipher-speed.sh + regress/test-exec.sh regress/sftp-batch.sh regress/dynamic-forward.sh + regress/putty-transfer.sh regress/conch-ciphers.sh regress/sftp-cmds.sh + regress/scp.sh regress/ssh-com-sftp.sh regress/rekey.sh + regress/putty-kex.sh regress/stderr-data.sh regress/stderr-after-eof.sh + regress/sftp-badcmds.sh regress/reexec.sh regress/ssh-com-client.sh + regress/sftp-chroot.sh regress/forwarding.sh regress/transfer.sh + regress/multiplex.sh] + Move the setting of DATA and COPY into test-exec.sh - (dtucker) [regress/bsd.regress.mk] Remove unused file. We've never used it in portable and it's long gone in openbsd. - (dtucker) [regress/integrity.sh]. Force fixed Diffie-Hellman key exchange diff --git a/regress/cipher-speed.sh b/regress/cipher-speed.sh index 07daebe62..489d9f5fa 100644 --- a/regress/cipher-speed.sh +++ b/regress/cipher-speed.sh @@ -1,4 +1,4 @@ -# $OpenBSD: cipher-speed.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $ +# $OpenBSD: cipher-speed.sh,v 1.9 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="cipher speed" diff --git a/regress/conch-ciphers.sh b/regress/conch-ciphers.sh index 5b65cd993..199d863a0 100644 --- a/regress/conch-ciphers.sh +++ b/regress/conch-ciphers.sh @@ -1,11 +1,8 @@ -# $OpenBSD: conch-ciphers.sh,v 1.2 2008/06/30 10:43:03 djm Exp $ +# $OpenBSD: conch-ciphers.sh,v 1.3 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="conch ciphers" -DATA=/bin/ls -COPY=${OBJ}/copy - if test "x$REGRESS_INTEROP_CONCH" != "xyes" ; then echo "conch interop tests not enabled" exit 0 diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh index d1ab8059b..42fa8acdc 100644 --- a/regress/dynamic-forward.sh +++ b/regress/dynamic-forward.sh @@ -1,12 +1,10 @@ -# $OpenBSD: dynamic-forward.sh,v 1.9 2011/06/03 00:29:52 dtucker Exp $ +# $OpenBSD: dynamic-forward.sh,v 1.10 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="dynamic forwarding" FWDPORT=`expr $PORT + 1` -DATA=/bin/ls${EXEEXT} - if have_prog nc && nc -h 2>&1 | grep "proxy address" >/dev/null; then proxycmd="nc -x 127.0.0.1:$FWDPORT -X" elif have_prog connect; then diff --git a/regress/forwarding.sh b/regress/forwarding.sh index 6a7003070..2ba140fee 100644 --- a/regress/forwarding.sh +++ b/regress/forwarding.sh @@ -1,8 +1,7 @@ -# $OpenBSD: forwarding.sh,v 1.9 2013/04/07 02:16:03 dtucker Exp $ +# $OpenBSD: forwarding.sh,v 1.10 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="local and remote forwarding" -DATA=/bin/ls${EXEEXT} start_sshd @@ -26,9 +25,9 @@ for p in 1 2; do trace "transfer over forwarded channels and check result" ${SSH} -$q -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ - somehost cat $DATA > $OBJ/ls.copy - test -f $OBJ/ls.copy || fail "failed copy $DATA" - cmp $DATA $OBJ/ls.copy || fail "corrupted copy of $DATA" + somehost cat ${DATA} > ${COPY} + test -f ${COPY} || fail "failed copy of ${DATA}" + cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" sleep 10 done diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 8389b3840..3e697e691 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.20 2013/04/22 07:28:53 dtucker Exp $ +# $OpenBSD: multiplex.sh,v 1.21 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. CTL=/tmp/openssh.regress.ctl-sock.$$ @@ -10,8 +10,6 @@ if config_defined DISABLE_FD_PASSING ; then exit 0 fi -DATA=/bin/ls${EXEEXT} -COPY=$OBJ/ls.copy P=3301 # test port wait_for_mux_master_ready() diff --git a/regress/putty-ciphers.sh b/regress/putty-ciphers.sh index 928ea60d2..724a98cc1 100644 --- a/regress/putty-ciphers.sh +++ b/regress/putty-ciphers.sh @@ -1,11 +1,8 @@ -# $OpenBSD: putty-ciphers.sh,v 1.3 2008/11/10 02:06:35 djm Exp $ +# $OpenBSD: putty-ciphers.sh,v 1.4 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="putty ciphers" -DATA=/bin/ls -COPY=${OBJ}/copy - if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then echo "putty interop tests not enabled" exit 0 diff --git a/regress/putty-kex.sh b/regress/putty-kex.sh index 293885a8a..1844d6599 100644 --- a/regress/putty-kex.sh +++ b/regress/putty-kex.sh @@ -1,11 +1,8 @@ -# $OpenBSD: putty-kex.sh,v 1.2 2008/06/30 10:31:11 djm Exp $ +# $OpenBSD: putty-kex.sh,v 1.3 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="putty KEX" -DATA=/bin/ls -COPY=${OBJ}/copy - if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then echo "putty interop tests not enabled" exit 0 diff --git a/regress/putty-transfer.sh b/regress/putty-transfer.sh index 9e1e1550a..aec0e04ee 100644 --- a/regress/putty-transfer.sh +++ b/regress/putty-transfer.sh @@ -1,11 +1,8 @@ -# $OpenBSD: putty-transfer.sh,v 1.2 2008/06/30 10:31:11 djm Exp $ +# $OpenBSD: putty-transfer.sh,v 1.3 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="putty transfer data" -DATA=/bin/ls -COPY=${OBJ}/copy - if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then echo "putty interop tests not enabled" exit 0 diff --git a/regress/reexec.sh b/regress/reexec.sh index 9464eb699..5fff62a66 100644 --- a/regress/reexec.sh +++ b/regress/reexec.sh @@ -1,12 +1,10 @@ -# $OpenBSD: reexec.sh,v 1.5 2004/10/08 02:01:50 djm Exp $ +# $OpenBSD: reexec.sh,v 1.6 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="reexec tests" -DATA=/bin/ls${EXEEXT} -COPY=${OBJ}/copy -SSHD_ORIG=$SSHD${EXEEXT} -SSHD_COPY=$OBJ/sshd${EXEEXT} +SSHD_ORIG=$SSHD +SSHD_COPY=$OBJ/sshd # Start a sshd and then delete it start_sshd_copy () diff --git a/regress/rekey.sh b/regress/rekey.sh index cefdea534..8eb7efaf9 100644 --- a/regress/rekey.sh +++ b/regress/rekey.sh @@ -1,15 +1,11 @@ -# $OpenBSD: rekey.sh,v 1.7 2013/05/16 05:48:31 dtucker Exp $ +# $OpenBSD: rekey.sh,v 1.8 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="rekey" -DATA=${OBJ}/data -COPY=${OBJ}/copy LOG=${TEST_SSH_LOGFILE} -rm -f ${COPY} ${LOG} ${DATA} -touch ${DATA} -dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1 +rm -f ${LOG} for s in 16 1k 128k 256k; do verbose "client rekeylimit ${s}" diff --git a/regress/scp.sh b/regress/scp.sh index c5d412dd9..ba5ba887d 100644 --- a/regress/scp.sh +++ b/regress/scp.sh @@ -1,4 +1,4 @@ -# $OpenBSD: scp.sh,v 1.7 2006/01/31 10:36:33 djm Exp $ +# $OpenBSD: scp.sh,v 1.8 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="scp" @@ -12,8 +12,6 @@ else DIFFOPT="-r" fi -DATA=/bin/ls${EXEEXT} -COPY=${OBJ}/copy COPY2=${OBJ}/copy2 DIR=${COPY}.dd DIR2=${COPY}.dd2 diff --git a/regress/sftp-badcmds.sh b/regress/sftp-badcmds.sh index 08009f26b..3dbeb58ca 100644 --- a/regress/sftp-badcmds.sh +++ b/regress/sftp-badcmds.sh @@ -1,12 +1,10 @@ -# $OpenBSD: sftp-badcmds.sh,v 1.4 2009/08/13 01:11:55 djm Exp $ +# $OpenBSD: sftp-badcmds.sh,v 1.5 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="sftp invalid commands" -DATA=/bin/ls${EXEEXT} DATA2=/bin/sh${EXEEXT} NONEXIST=/NONEXIST.$$ -COPY=${OBJ}/copy GLOBFILES=`(cd /bin;echo l*)` rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd diff --git a/regress/sftp-batch.sh b/regress/sftp-batch.sh index a51ef0782..41011549b 100644 --- a/regress/sftp-batch.sh +++ b/regress/sftp-batch.sh @@ -1,10 +1,8 @@ -# $OpenBSD: sftp-batch.sh,v 1.4 2009/08/13 01:11:55 djm Exp $ +# $OpenBSD: sftp-batch.sh,v 1.5 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="sftp batchfile" -DATA=/bin/ls${EXEEXT} -COPY=${OBJ}/copy BATCH=${OBJ}/sftp.bb rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* diff --git a/regress/sftp-chroot.sh b/regress/sftp-chroot.sh index 8c07979b4..98a364ebf 100644 --- a/regress/sftp-chroot.sh +++ b/regress/sftp-chroot.sh @@ -1,9 +1,8 @@ -# $OpenBSD: sftp-chroot.sh,v 1.1 2013/04/18 02:46:12 djm Exp $ +# $OpenBSD: sftp-chroot.sh,v 1.2 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="sftp in chroot" -COPY=${OBJ}/copy CHROOT=/var/run FILENAME=testdata_${USER} PRIVDATA=${CHROOT}/${FILENAME} @@ -18,7 +17,6 @@ $SUDO sh -c "echo mekmitastdigoat > $PRIVDATA" || \ start_sshd -oChrootDirectory=$CHROOT -oForceCommand="internal-sftp -d /" verbose "test $tid: get" -rm -f ${COPY} ${SFTP} -qS "$SSH" -F $OBJ/ssh_config host:/${FILENAME} $COPY || \ fatal "Fetch ${FILENAME} failed" cmp $PRIVDATA $COPY || fail "$PRIVDATA $COPY differ" diff --git a/regress/sftp-cmds.sh b/regress/sftp-cmds.sh index 2e0300e16..ba5ef066d 100644 --- a/regress/sftp-cmds.sh +++ b/regress/sftp-cmds.sh @@ -1,4 +1,4 @@ -# $OpenBSD: sftp-cmds.sh,v 1.12 2012/06/01 00:52:52 djm Exp $ +# $OpenBSD: sftp-cmds.sh,v 1.13 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. # XXX - TODO: @@ -7,8 +7,6 @@ tid="sftp commands" -DATA=/bin/ls${EXEEXT} -COPY=${OBJ}/copy # test that these files are readable! for i in `(cd /bin;echo l*)` do diff --git a/regress/sftp.sh b/regress/sftp.sh index f84fa6f4e..5f823ee23 100644 --- a/regress/sftp.sh +++ b/regress/sftp.sh @@ -1,11 +1,8 @@ -# $OpenBSD: sftp.sh,v 1.3 2009/08/13 01:11:55 djm Exp $ +# $OpenBSD: sftp.sh,v 1.4 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="basic sftp put/get" -DATA=/bin/ls${EXEEXT} -COPY=${OBJ}/copy - SFTPCMDFILE=${OBJ}/batch cat >$SFTPCMDFILE <$SFTPCMDFILE <$TEST_SSHD_LOGFILE >$TEST_REGRESS_LOGFILE -# Some data for test copies -DATA=$OBJ/testdata -cat $SSHD${EXEEXT} $SSHD${EXEEXT} $SSHD${EXEEXT} $SSHD${EXEEXT} >$DATA - # Create wrapper ssh with logging. We can't just specify "SSH=ssh -E..." # because sftp and scp don't handle spaces in arguments. SSHLOGWRAP=$OBJ/ssh-log-wrapper.sh @@ -168,6 +164,15 @@ echo "exec ${SSH} -E${TEST_SSH_LOGFILE} "'"$@"' >>$SSHLOGWRAP chmod a+rx $OBJ/ssh-log-wrapper.sh SSH="$SSHLOGWRAP" +# Some test data. We make a copy because some tests will overwrite it. +# The tests may assume that $DATA exists and is writable and $COPY does +# not exist. +DATA=$OBJ/data +cat $SSHD $SSHD $SSHD $SSHD >${DATA} +chmod u+w ${DATA} +COPY=$OBJ/copy +rm -f ${COPY} + # these should be used in tests export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER $SCP diff --git a/regress/transfer.sh b/regress/transfer.sh index 13ea367d5..1ae3ef5bf 100644 --- a/regress/transfer.sh +++ b/regress/transfer.sh @@ -1,11 +1,8 @@ -# $OpenBSD: transfer.sh,v 1.1 2002/03/27 00:03:37 markus Exp $ +# $OpenBSD: transfer.sh,v 1.2 2013/05/17 04:29:14 dtucker Exp $ # Placed in the Public Domain. tid="transfer data" -DATA=/bin/ls${EXEEXT} -COPY=${OBJ}/copy - for p in 1 2; do verbose "$tid: proto $p" rm -f ${COPY} -- cgit v1.2.3