summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
Diffstat (limited to 'regress')
-rw-r--r--regress/Makefile12
-rw-r--r--regress/README.regress31
-rw-r--r--regress/dynamic-forward.sh4
-rw-r--r--regress/envpass.sh51
-rw-r--r--regress/login-timeout.sh4
-rw-r--r--regress/multiplex.sh74
-rw-r--r--regress/reexec.sh87
-rw-r--r--regress/scp-ssh-wrapper.sh54
-rw-r--r--regress/scp.sh82
-rw-r--r--regress/test-exec.sh35
-rw-r--r--regress/try-ciphers.sh4
11 files changed, 413 insertions, 25 deletions
diff --git a/regress/Makefile b/regress/Makefile
index cf65b3630..9e98e5880 100644
--- a/regress/Makefile
+++ b/regress/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.27 2004/02/17 08:23:20 dtucker Exp $ 1# $OpenBSD: Makefile,v 1.31 2004/06/24 19:32:00 djm Exp $
2 2
3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec 3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec
4tests: $(REGRESS_TARGETS) 4tests: $(REGRESS_TARGETS)
@@ -13,6 +13,7 @@ LTESTS= connect \
13 proto-version \ 13 proto-version \
14 proto-mismatch \ 14 proto-mismatch \
15 exit-status \ 15 exit-status \
16 envpass \
16 transfer \ 17 transfer \
17 banner \ 18 banner \
18 rekey \ 19 rekey \
@@ -28,13 +29,16 @@ LTESTS= connect \
28 agent-ptrace \ 29 agent-ptrace \
29 keyscan \ 30 keyscan \
30 keygen-change \ 31 keygen-change \
32 scp \
31 sftp \ 33 sftp \
32 sftp-cmds \ 34 sftp-cmds \
33 sftp-badcmds \ 35 sftp-badcmds \
34 sftp-batch \ 36 sftp-batch \
35 reconfigure \ 37 reconfigure \
36 dynamic-forward \ 38 dynamic-forward \
37 forwarding 39 forwarding \
40 multiplex \
41 reexec
38 42
39USER!= id -un 43USER!= id -un
40CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ 44CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \
@@ -42,7 +46,9 @@ CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \
42 ssh_config ssh_proxy sshd_config sshd_proxy \ 46 ssh_config ssh_proxy sshd_config sshd_proxy \
43 rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \ 47 rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \
44 rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \ 48 rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \
45 ls.copy banner.in banner.out empty.in remote_pid 49 ls.copy banner.in banner.out empty.in \
50 scp-ssh-wrapper.exe \
51 remote_pid
46 52
47#LTESTS += ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp 53#LTESTS += ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp
48 54
diff --git a/regress/README.regress b/regress/README.regress
index 6ff032b68..0c07c9cf1 100644
--- a/regress/README.regress
+++ b/regress/README.regress
@@ -27,15 +27,26 @@ TEST_SSH_QUIET: set to "yes" to suppress non-fatal output.
27TEST_SSH_x: path to "ssh" command under test, where x=SSH,SSHD,SSHAGENT,SSHADD 27TEST_SSH_x: path to "ssh" command under test, where x=SSH,SSHD,SSHAGENT,SSHADD
28 SSHKEYGEN,SSHKEYSCAN,SFTP,SFTPSERVER 28 SSHKEYGEN,SSHKEYSCAN,SFTP,SFTPSERVER
29OBJ: used by test scripts to access build dir. 29OBJ: used by test scripts to access build dir.
30TEST_SHELL: shell used for running the test scripts.
31TEST_SSH_PORT: TCP port to be used for the listening tests.
32TEST_SSH_SSH_CONFOTPS: Configuration directives to be added to ssh_config
33 before running each test.
34TEST_SSH_SSHD_CONFOTPS: Configuration directives to be added to sshd_config
35 before running each test.
30 36
31 37
32Individual tests. 38Individual tests.
33 39
34You can invoke test-exec.sh directly if you set up the path to find the 40You can run an individual test from the top-level Makefile, eg:
35binaries under test and the test scripts themselves, for example: 41$ make tests LTESTS=agent-timeout
42
43If you need to manipulate the environment more you can invoke test-exec.sh
44directly if you set up the path to find the binaries under test and the
45test scripts themselves, for example:
36 46
37$ cd regress 47$ cd regress
38$ PATH=`pwd`/..:$PATH:. sh test-exec.sh `pwd` agent-timeout.sh 48$ PATH=`pwd`/..:$PATH:. TEST_SHELL=/bin/sh sh test-exec.sh `pwd` \
49 agent-timeout.sh
39ok agent timeout test 50ok agent timeout test
40 51
41 52
@@ -82,16 +93,12 @@ Failed tests can be difficult to diagnose. Suggestions:
82 93
83Known Issues. 94Known Issues.
84 95
85- If you build with tcpwrappers and try to run the regression tests,
86 your hosts.allow must permit connections from localhost and from
87 "unknown". This is because some tests are performed via the loopback
88 interface, while others are done with "sshd -i" as a ProxyCommand. In
89 the latter case, when sshd calls getpeername() on the socket it will
90 fail (because it's not a tcp socket) and will be identified as
91 "unknown", which is then checked against tcpwrappers.
92
93- If your build requires ssh-rand-helper regress tests will fail 96- If your build requires ssh-rand-helper regress tests will fail
94 unless ssh-rand-helper is in pre-installed (the path to 97 unless ssh-rand-helper is in pre-installed (the path to
95 ssh-rand-helper is hard coded). 98 ssh-rand-helper is hard coded).
96 99
97$Id: README.regress,v 1.4 2004/03/08 20:12:18 tim Exp $ 100- Recent GNU coreutils deprecate "head -[n]": this will cause the yes-head
101 test to fail. The old behaviour can be restored by setting (and
102 exporting) _POSIX2_VERSION=199209 before running the tests.
103
104$Id: README.regress,v 1.9 2004/08/17 12:31:33 dtucker Exp $
diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh
index 3a6e5c1ef..392fc1978 100644
--- a/regress/dynamic-forward.sh
+++ b/regress/dynamic-forward.sh
@@ -3,8 +3,8 @@
3 3
4tid="dynamic forwarding" 4tid="dynamic forwarding"
5 5
6PORT=4242 6FWDPORT=`expr $PORT + 1`
7FWDPORT=4243 7
8DATA=/bin/ls${EXEEXT} 8DATA=/bin/ls${EXEEXT}
9 9
10if have_prog nc && nc -h 2>&1 | grep "proxy address" >/dev/null; then 10if have_prog nc && nc -h 2>&1 | grep "proxy address" >/dev/null; then
diff --git a/regress/envpass.sh b/regress/envpass.sh
new file mode 100644
index 000000000..5a7e178d8
--- /dev/null
+++ b/regress/envpass.sh
@@ -0,0 +1,51 @@
1# $OpenBSD: envpass.sh,v 1.3 2004/06/22 22:42:02 dtucker Exp $
2# Placed in the Public Domain.
3
4tid="environment passing"
5
6# NB accepted env vars are in test-exec.sh (_XXX_TEST_* and _XXX_TEST)
7
8trace "pass env, don't accept"
9verbose "test $tid: pass env, don't accept"
10_TEST_ENV=blah ${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy otherhost \
11 sh << 'EOF'
12 test -z "$_TEST_ENV"
13EOF
14r=$?
15if [ $r -ne 0 ]; then
16 fail "environment found"
17fi
18
19trace "don't pass env, accept"
20verbose "test $tid: don't pass env, accept"
21${SSH} -F $OBJ/ssh_proxy otherhost \
22 sh << 'EOF'
23 test -z "$_XXX_TEST_A" && test -z "$_XXX_TEST_B"
24EOF
25r=$?
26if [ $r -ne 0 ]; then
27 fail "environment found"
28fi
29
30trace "pass single env, accept single env"
31verbose "test $tid: pass single env, accept single env"
32_XXX_TEST=blah ${SSH} -oSendEnv="_XXX_TEST" -F $OBJ/ssh_proxy otherhost \
33 sh << 'EOF'
34 test X"$_XXX_TEST" = X"blah"
35EOF
36r=$?
37if [ $r -ne 0 ]; then
38 fail "environment not found"
39fi
40
41trace "pass multiple env, accept multiple env"
42verbose "test $tid: pass multiple env, accept multiple env"
43_XXX_TEST_A=1 _XXX_TEST_B=2 ${SSH} -oSendEnv="_XXX_TEST_*" \
44 -F $OBJ/ssh_proxy otherhost \
45 sh << 'EOF'
46 test X"$_XXX_TEST_A" = X"1" -a X"$_XXX_TEST_B" = X"2"
47EOF
48r=$?
49if [ $r -ne 0 ]; then
50 fail "environment not found"
51fi
diff --git a/regress/login-timeout.sh b/regress/login-timeout.sh
index dfc6e6b44..ce6edade5 100644
--- a/regress/login-timeout.sh
+++ b/regress/login-timeout.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: login-timeout.sh,v 1.1 2004/02/17 08:23:20 dtucker Exp $ 1# $OpenBSD: login-timeout.sh,v 1.3 2004/03/08 10:17:12 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="connect after login grace timeout" 4tid="connect after login grace timeout"
@@ -15,7 +15,7 @@ if [ $? -ne 0 ]; then
15 fail "ssh connect after login grace timeout failed with privsep" 15 fail "ssh connect after login grace timeout failed with privsep"
16fi 16fi
17 17
18kill `cat $PIDFILE` 18$SUDO kill `cat $PIDFILE`
19 19
20trace "test login grace without privsep" 20trace "test login grace without privsep"
21echo "UsePrivilegeSeparation no" >> $OBJ/sshd_config 21echo "UsePrivilegeSeparation no" >> $OBJ/sshd_config
diff --git a/regress/multiplex.sh b/regress/multiplex.sh
new file mode 100644
index 000000000..dbf2025be
--- /dev/null
+++ b/regress/multiplex.sh
@@ -0,0 +1,74 @@
1# $OpenBSD: multiplex.sh,v 1.8 2004/06/22 03:12:13 markus Exp $
2# Placed in the Public Domain.
3
4CTL=$OBJ/ctl-sock
5
6tid="connection multiplexing"
7
8DATA=/bin/ls${EXEEXT}
9COPY=$OBJ/ls.copy
10
11start_sshd
12
13trace "start master, fork to background"
14${SSH} -2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" -f somehost sleep 120
15
16verbose "test $tid: envpass"
17trace "env passing over multiplexed connection"
18_XXX_TEST=blah ${SSH} -oSendEnv="_XXX_TEST" -S$CTL otherhost sh << 'EOF'
19 test X"$_XXX_TEST" = X"blah"
20EOF
21if [ $? -ne 0 ]; then
22 fail "environment not found"
23fi
24
25verbose "test $tid: transfer"
26rm -f ${COPY}
27trace "ssh transfer over multiplexed connection and check result"
28${SSH} -S$CTL otherhost cat ${DATA} > ${COPY}
29test -f ${COPY} || fail "ssh -Sctl: failed copy ${DATA}"
30cmp ${DATA} ${COPY} || fail "ssh -Sctl: corrupted copy of ${DATA}"
31
32rm -f ${COPY}
33trace "ssh transfer over multiplexed connection and check result"
34${SSH} -S $CTL otherhost cat ${DATA} > ${COPY}
35test -f ${COPY} || fail "ssh -S ctl: failed copy ${DATA}"
36cmp ${DATA} ${COPY} || fail "ssh -S ctl: corrupted copy of ${DATA}"
37
38rm -f ${COPY}
39trace "sftp transfer over multiplexed connection and check result"
40echo "get ${DATA} ${COPY}" | \
41 ${SFTP} -S ${SSH} -oControlPath=$CTL otherhost >/dev/null 2>&1
42test -f ${COPY} || fail "sftp: failed copy ${DATA}"
43cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}"
44
45rm -f ${COPY}
46trace "scp transfer over multiplexed connection and check result"
47${SCP} -S ${SSH} -oControlPath=$CTL otherhost:${DATA} ${COPY} >/dev/null 2>&1
48test -f ${COPY} || fail "scp: failed copy ${DATA}"
49cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}"
50
51rm -f ${COPY}
52
53for s in 0 1 4 5 44; do
54 trace "exit status $s over multiplexed connection"
55 verbose "test $tid: status $s"
56 ${SSH} -S $CTL otherhost exit $s
57 r=$?
58 if [ $r -ne $s ]; then
59 fail "exit code mismatch for protocol $p: $r != $s"
60 fi
61
62 # same with early close of stdout/err
63 trace "exit status $s with early close over multiplexed connection"
64 ${SSH} -S $CTL -n otherhost \
65 exec sh -c \'"sleep 2; exec > /dev/null 2>&1; sleep 3; exit $s"\'
66 r=$?
67 if [ $r -ne $s ]; then
68 fail "exit code (with sleep) mismatch for protocol $p: $r != $s"
69 fi
70done
71
72# kill master, remove control socket. ssh -MS will exit when sleep exits
73$SUDO kill `cat $PIDFILE`
74rm -f $CTL
diff --git a/regress/reexec.sh b/regress/reexec.sh
new file mode 100644
index 000000000..39fffefbc
--- /dev/null
+++ b/regress/reexec.sh
@@ -0,0 +1,87 @@
1# $OpenBSD: reexec.sh,v 1.3 2004/06/25 01:32:44 djm Exp $
2# Placed in the Public Domain.
3
4tid="reexec tests"
5
6DATA=/bin/ls
7COPY=${OBJ}/copy
8SSHD_ORIG=$SSHD
9SSHD_COPY=$OBJ/sshd.copy
10
11# Start a sshd and then delete it
12start_sshd_copy_zap ()
13{
14 cp $SSHD_ORIG $SSHD_COPY
15 SSHD=$SSHD_COPY
16 start_sshd
17 rm -f $SSHD_COPY
18 SSHD=$SSHD_ORIG
19}
20
21verbose "test config passing"
22cp $OBJ/sshd_config $OBJ/sshd_config.orig
23
24start_sshd
25
26echo "InvalidXXX=no" >> $OBJ/sshd_config
27
28rm -f ${COPY}
29for p in 1 2; do
30 verbose "$tid: proto $p"
31 ${SSH} -nqo "Protocol=$p" -F $OBJ/ssh_config somehost \
32 cat ${DATA} > ${COPY}
33 if [ $? -ne 0 ]; then
34 fail "ssh cat $DATA failed"
35 fi
36 cmp ${DATA} ${COPY} || fail "corrupted copy"
37 rm -f ${COPY}
38done
39
40$SUDO kill `cat $PIDFILE`
41rm -f $PIDFILE
42
43cp $OBJ/sshd_config.orig $OBJ/sshd_config
44
45verbose "test reexec fallback"
46
47start_sshd_copy_zap
48
49rm -f ${COPY}
50for p in 1 2; do
51 verbose "$tid: proto $p"
52 ${SSH} -nqo "Protocol=$p" -F $OBJ/ssh_config somehost \
53 cat ${DATA} > ${COPY}
54 if [ $? -ne 0 ]; then
55 fail "ssh cat $DATA failed"
56 fi
57 cmp ${DATA} ${COPY} || fail "corrupted copy"
58 rm -f ${COPY}
59done
60
61$SUDO kill `cat $PIDFILE`
62rm -f $PIDFILE
63
64verbose "test reexec fallback without privsep"
65
66cp $OBJ/sshd_config.orig $OBJ/sshd_config
67echo "UsePrivilegeSeparation=no" >> $OBJ/sshd_config
68
69start_sshd_copy_zap
70
71rm -f ${COPY}
72for p in 1 2; do
73 verbose "$tid: proto $p"
74 ${SSH} -nqo "Protocol=$p" -F $OBJ/ssh_config somehost \
75 cat ${DATA} > ${COPY}
76 if [ $? -ne 0 ]; then
77 fail "ssh cat $DATA failed"
78 fi
79 cmp ${DATA} ${COPY} || fail "corrupted copy"
80 rm -f ${COPY}
81done
82
83$SUDO kill `cat $PIDFILE`
84rm -f $PIDFILE
85
86cp $OBJ/sshd_config.orig $OBJ/sshd_config
87
diff --git a/regress/scp-ssh-wrapper.sh b/regress/scp-ssh-wrapper.sh
new file mode 100644
index 000000000..8e4314773
--- /dev/null
+++ b/regress/scp-ssh-wrapper.sh
@@ -0,0 +1,54 @@
1#!/bin/sh
2# $OpenBSD: scp-ssh-wrapper.sh,v 1.1 2004/06/13 13:51:02 dtucker Exp $
3# Placed in the Public Domain.
4
5printname () {
6 NAME=$1
7 save_IFS=$IFS
8 IFS=/
9 set -- `echo "$NAME"`
10 IFS="$save_IFS"
11 while [ $# -ge 1 ] ; do
12 if [ "x$1" != "x" ]; then
13 echo "D0755 0 $1"
14 fi
15 shift;
16 done
17}
18
19# discard first 5 args
20shift; shift; shift; shift; shift
21
22BAD="../../../../../../../../../../../../../${DIR}/dotpathdir"
23
24case "$SCPTESTMODE" in
25badserver_0)
26 echo "D0755 0 /${DIR}/rootpathdir"
27 echo "C755 2 rootpathfile"
28 echo "X"
29 ;;
30badserver_1)
31 echo "D0755 0 $BAD"
32 echo "C755 2 file"
33 echo "X"
34 ;;
35badserver_2)
36 echo "D0755 0 $BAD"
37 echo "C755 2 file"
38 echo "X"
39 ;;
40badserver_3)
41 printname $BAD
42 echo "C755 2 file"
43 echo "X"
44 ;;
45badserver_4)
46 printname $BAD
47 echo "D0755 0 .."
48 echo "C755 2 file"
49 echo "X"
50 ;;
51*)
52 exec $1
53 ;;
54esac
diff --git a/regress/scp.sh b/regress/scp.sh
new file mode 100644
index 000000000..703cc0893
--- /dev/null
+++ b/regress/scp.sh
@@ -0,0 +1,82 @@
1# $OpenBSD: scp.sh,v 1.2 2004/06/16 13:15:09 dtucker Exp $
2# Placed in the Public Domain.
3
4tid="scp"
5
6#set -x
7
8# Figure out if diff understands "-N"
9if diff -N ${SRC}/scp.sh ${SRC}/scp.sh 2>/dev/null; then
10 DIFFOPT="-rN"
11else
12 DIFFOPT="-r"
13fi
14
15DATA=/bin/ls
16COPY=${OBJ}/copy
17COPY2=${OBJ}/copy2
18DIR=${COPY}.dd
19DIR2=${COPY}.dd2
20
21SRC=`dirname ${SCRIPT}`
22cp ${SRC}/scp-ssh-wrapper.sh ${OBJ}/scp-ssh-wrapper.exe
23chmod 755 ${OBJ}/scp-ssh-wrapper.exe
24scpopts="-q -S ${OBJ}/scp-ssh-wrapper.exe"
25
26scpclean() {
27 rm -rf ${COPY} ${COPY2} ${DIR} ${DIR2}
28 mkdir ${DIR} ${DIR2}
29}
30
31verbose "$tid: simple copy local file to remote file"
32scpclean
33$SCP $scpopts ${DATA} somehost:${COPY} || fail "copy failed"
34cmp ${DATA} ${COPY} || fail "corrupted copy"
35
36verbose "$tid: simple copy remote file to local file"
37scpclean
38$SCP $scpopts somehost:${DATA} ${COPY} || fail "copy failed"
39cmp ${DATA} ${COPY} || fail "corrupted copy"
40
41verbose "$tid: simple copy local file to remote dir"
42scpclean
43cp ${DATA} ${COPY}
44$SCP $scpopts ${COPY} somehost:${DIR} || fail "copy failed"
45cmp ${COPY} ${DIR}/copy || fail "corrupted copy"
46
47verbose "$tid: simple copy remote file to local dir"
48scpclean
49cp ${DATA} ${COPY}
50$SCP $scpopts somehost:${COPY} ${DIR} || fail "copy failed"
51cmp ${COPY} ${DIR}/copy || fail "corrupted copy"
52
53verbose "$tid: recursive local dir to remote dir"
54scpclean
55rm -rf ${DIR2}
56cp ${DATA} ${DIR}/copy
57$SCP $scpopts -r ${DIR} somehost:${DIR2} || fail "copy failed"
58diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
59
60verbose "$tid: recursive remote dir to local dir"
61scpclean
62rm -rf ${DIR2}
63cp ${DATA} ${DIR}/copy
64$SCP $scpopts -r somehost:${DIR} ${DIR2} || fail "copy failed"
65diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
66
67for i in 0 1 2 3 4; do
68 verbose "$tid: disallow bad server #$i"
69 SCPTESTMODE=badserver_$i
70 export DIR SCPTESTMODE
71 scpclean
72 $SCP $scpopts somehost:${DATA} ${DIR} >/dev/null 2>/dev/null
73 [ -d {$DIR}/rootpathdir ] && fail "allows dir relative to root dir"
74 [ -d ${DIR}/dotpathdir ] && fail "allows dir creation in non-recursive mode"
75
76 scpclean
77 $SCP -r $scpopts somehost:${DATA} ${DIR2} >/dev/null 2>/dev/null
78 [ -d ${DIR}/dotpathdir ] && fail "allows dir creation outside of subdir"
79done
80
81scpclean
82rm -f ${OBJ}/scp-ssh-wrapper.exe
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 986d99287..70250acd7 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,9 +1,14 @@
1# $OpenBSD: test-exec.sh,v 1.15 2004/02/24 16:56:30 markus Exp $ 1# $OpenBSD: test-exec.sh,v 1.23 2004/06/25 01:25:12 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4PORT=4242
5#SUDO=sudo 4#SUDO=sudo
6 5
6if [ ! -z "$TEST_SSH_PORT" ]; then
7 PORT="$TEST_SSH_PORT"
8else
9 PORT=4242
10fi
11
7if [ -x /usr/ucb/whoami ]; then 12if [ -x /usr/ucb/whoami ]; then
8 USER=`/usr/ucb/whoami` 13 USER=`/usr/ucb/whoami`
9elif whoami >/dev/null 2>&1; then 14elif whoami >/dev/null 2>&1; then
@@ -47,6 +52,7 @@ SSHKEYGEN=ssh-keygen
47SSHKEYSCAN=ssh-keyscan 52SSHKEYSCAN=ssh-keyscan
48SFTP=sftp 53SFTP=sftp
49SFTPSERVER=/usr/libexec/openssh/sftp-server 54SFTPSERVER=/usr/libexec/openssh/sftp-server
55SCP=scp
50 56
51if [ "x$TEST_SSH_SSH" != "x" ]; then 57if [ "x$TEST_SSH_SSH" != "x" ]; then
52 SSH="${TEST_SSH_SSH}" 58 SSH="${TEST_SSH_SSH}"
@@ -72,10 +78,16 @@ fi
72if [ "x$TEST_SSH_SFTPSERVER" != "x" ]; then 78if [ "x$TEST_SSH_SFTPSERVER" != "x" ]; then
73 SFTPSERVER="${TEST_SSH_SFTPSERVER}" 79 SFTPSERVER="${TEST_SSH_SFTPSERVER}"
74fi 80fi
81if [ "x$TEST_SSH_SCP" != "x" ]; then
82 SCP="${TEST_SSH_SCP}"
83fi
84
85# Path to sshd must be absolute for rexec
86SSHD=`which sshd`
75 87
76# these should be used in tests 88# these should be used in tests
77export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER 89export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP
78#echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER 90#echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER $SCP
79 91
80# helper 92# helper
81echon() 93echon()
@@ -156,15 +168,23 @@ trap fatal 3 2
156 168
157# create server config 169# create server config
158cat << EOF > $OBJ/sshd_config 170cat << EOF > $OBJ/sshd_config
171 StrictModes no
159 Port $PORT 172 Port $PORT
160 ListenAddress 127.0.0.1 173 ListenAddress 127.0.0.1
161 #ListenAddress ::1 174 #ListenAddress ::1
162 PidFile $PIDFILE 175 PidFile $PIDFILE
163 AuthorizedKeysFile $OBJ/authorized_keys_%u 176 AuthorizedKeysFile $OBJ/authorized_keys_%u
164 LogLevel QUIET 177 LogLevel QUIET
165 StrictModes no 178 AcceptEnv _XXX_TEST_*
179 AcceptEnv _XXX_TEST
180 Subsystem sftp $SFTPSERVER
166EOF 181EOF
167 182
183if [ ! -z "$TEST_SSH_SSHD_CONFOPTS" ]; then
184 trace "adding sshd_config option $TEST_SSH_SSHD_CONFOPTS"
185 echo "$TEST_SSH_SSHD_CONFOPTS" >> $OBJ/sshd_config
186fi
187
168# server config for proxy connects 188# server config for proxy connects
169cp $OBJ/sshd_config $OBJ/sshd_proxy 189cp $OBJ/sshd_config $OBJ/sshd_proxy
170 190
@@ -190,6 +210,11 @@ Host *
190 StrictHostKeyChecking yes 210 StrictHostKeyChecking yes
191EOF 211EOF
192 212
213if [ ! -z "$TEST_SSH_SSH_CONFOPTS" ]; then
214 trace "adding ssh_config option $TEST_SSH_SSHD_CONFOPTS"
215 echo "$TEST_SSH_SSH_CONFOPTS" >> $OBJ/ssh_config
216fi
217
193rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER 218rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER
194 219
195trace "generate keys" 220trace "generate keys"
diff --git a/regress/try-ciphers.sh b/regress/try-ciphers.sh
index 15827e250..c6e1b9152 100644
--- a/regress/try-ciphers.sh
+++ b/regress/try-ciphers.sh
@@ -29,8 +29,10 @@ for c in $ciphers; do
29 fi 29 fi
30done 30done
31 31
32if ! ${SSH} -oCiphers=acss@openssh.org 2>&1 | grep "Bad SSH2 cipher" >/dev/null 32if ${SSH} -oCiphers=acss@openssh.org 2>&1 | grep "Bad SSH2 cipher" >/dev/null
33then 33then
34 :
35else
34 36
35echo "Ciphers acss@openssh.org" >> $OBJ/sshd_proxy 37echo "Ciphers acss@openssh.org" >> $OBJ/sshd_proxy
36c=acss@openssh.org 38c=acss@openssh.org