summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
Diffstat (limited to 'regress')
-rw-r--r--regress/addrmatch.sh53
-rw-r--r--regress/cipher-speed.sh4
-rw-r--r--regress/connect-privsep.sh13
-rw-r--r--regress/forwarding.sh6
-rw-r--r--regress/multiplex.sh7
-rw-r--r--regress/reexec.sh5
-rw-r--r--regress/sftp-cmds.sh20
-rw-r--r--regress/test-exec.sh7
-rw-r--r--regress/try-ciphers.sh4
9 files changed, 68 insertions, 51 deletions
diff --git a/regress/addrmatch.sh b/regress/addrmatch.sh
index 23ddd65ce..1584bd405 100644
--- a/regress/addrmatch.sh
+++ b/regress/addrmatch.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: addrmatch.sh,v 1.3 2010/02/09 04:57:36 djm Exp $ 1# $OpenBSD: addrmatch.sh,v 1.4 2012/05/13 01:42:32 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="address match" 4tid="address match"
@@ -7,39 +7,50 @@ mv $OBJ/sshd_proxy $OBJ/sshd_proxy_bak
7 7
8run_trial() 8run_trial()
9{ 9{
10 user="$1"; addr="$2"; host="$3"; expected="$4"; descr="$5" 10 user="$1"; addr="$2"; host="$3"; laddr="$4"; lport="$5"
11 expected="$6"; descr="$7"
11 12
12 verbose "test $descr for $user $addr $host" 13 verbose "test $descr for $user $addr $host"
13 result=`${SSHD} -f $OBJ/sshd_proxy -T \ 14 result=`${SSHD} -f $OBJ/sshd_proxy -T \
14 -C user=${user},addr=${addr},host=${host} | \ 15 -C user=${user},addr=${addr},host=${host},laddr=${laddr},lport=${lport} | \
15 awk '/^passwordauthentication/ {print $2}'` 16 awk '/^forcecommand/ {print $2}'`
16 if [ "$result" != "$expected" ]; then 17 if [ "$result" != "$expected" ]; then
17 fail "failed for $user $addr $host: expected $expected, got $result" 18 fail "failed '$descr' expected $expected got $result"
18 fi 19 fi
19} 20}
20 21
21cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy 22cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy
22cat >>$OBJ/sshd_proxy <<EOD 23cat >>$OBJ/sshd_proxy <<EOD
23PasswordAuthentication no 24ForceCommand nomatch
24Match Address 192.168.0.0/16,!192.168.30.0/24,10.0.0.0/8,host.example.com 25Match Address 192.168.0.0/16,!192.168.30.0/24,10.0.0.0/8,host.example.com
25 PasswordAuthentication yes 26 ForceCommand match1
26Match Address 1.1.1.1,::1,!::3,2000::/16 27Match Address 1.1.1.1,::1,!::3,2000::/16
27 PasswordAuthentication yes 28 ForceCommand match2
29Match LocalAddress 127.0.0.1,::1
30 ForceCommand match3
31Match LocalPort 5678
32 ForceCommand match4
28EOD 33EOD
29 34
30run_trial user 192.168.0.1 somehost yes "permit, first entry" 35run_trial user 192.168.0.1 somehost 1.2.3.4 1234 match1 "first entry"
31run_trial user 192.168.30.1 somehost no "deny, negative match" 36run_trial user 192.168.30.1 somehost 1.2.3.4 1234 nomatch "negative match"
32run_trial user 19.0.0.1 somehost no "deny, no match" 37run_trial user 19.0.0.1 somehost 1.2.3.4 1234 nomatch "no match"
33run_trial user 10.255.255.254 somehost yes "permit, list middle" 38run_trial user 10.255.255.254 somehost 1.2.3.4 1234 match1 "list middle"
34run_trial user 192.168.30.1 192.168.0.1 no "deny, faked IP in hostname" 39run_trial user 192.168.30.1 192.168.0.1 1.2.3.4 1234 nomatch "faked IP in hostname"
35run_trial user 1.1.1.1 somehost.example.com yes "permit, bare IP4 address" 40run_trial user 1.1.1.1 somehost.example.com 1.2.3.4 1234 match2 "bare IP4 address"
36test "$TEST_SSH_IPV6" = "no" && exit 41run_trial user 19.0.0.1 somehost 127.0.0.1 1234 match3 "localaddress"
37run_trial user ::1 somehost.example.com yes "permit, bare IP6 address" 42run_trial user 19.0.0.1 somehost 1.2.3.4 5678 match4 "localport"
38run_trial user ::2 somehost.exaple.com no "deny IPv6" 43
39run_trial user ::3 somehost no "deny IP6 negated" 44if test "$TEST_SSH_IPV6" != "no"; then
40run_trial user ::4 somehost no "deny, IP6 no match" 45run_trial user ::1 somehost.example.com ::2 1234 match2 "bare IP6 address"
41run_trial user 2000::1 somehost yes "permit, IP6 network" 46run_trial user ::2 somehost.exaple.com ::2 1234 nomatch "deny IPv6"
42run_trial user 2001::1 somehost no "deny, IP6 network" 47run_trial user ::3 somehost ::2 1234 nomatch "IP6 negated"
48run_trial user ::4 somehost ::2 1234 nomatch "IP6 no match"
49run_trial user 2000::1 somehost ::2 1234 match2 "IP6 network"
50run_trial user 2001::1 somehost ::2 1234 nomatch "IP6 network"
51run_trial user ::5 somehost ::1 1234 match3 "IP6 localaddress"
52run_trial user ::5 somehost ::2 5678 match4 "IP6 localport"
53fi
43 54
44cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy 55cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy
45rm $OBJ/sshd_proxy_bak 56rm $OBJ/sshd_proxy_bak
diff --git a/regress/cipher-speed.sh b/regress/cipher-speed.sh
index 257afd179..5800f4b09 100644
--- a/regress/cipher-speed.sh
+++ b/regress/cipher-speed.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: cipher-speed.sh,v 1.4 2011/08/02 01:23:41 djm Exp $ 1# $OpenBSD: cipher-speed.sh,v 1.5 2012/06/28 05:07:45 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="cipher speed" 4tid="cipher speed"
@@ -18,7 +18,7 @@ ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc
18 aes128-ctr aes192-ctr aes256-ctr" 18 aes128-ctr aes192-ctr aes256-ctr"
19macs="hmac-sha1 hmac-md5 umac-64@openssh.com hmac-sha1-96 hmac-md5-96" 19macs="hmac-sha1 hmac-md5 umac-64@openssh.com hmac-sha1-96 hmac-md5-96"
20config_defined HAVE_EVP_SHA256 && 20config_defined HAVE_EVP_SHA256 &&
21 macs="$macs hmac-sha2-256 hmac-sha2-256-96 hmac-sha2-512 hmac-sha2-512-96" 21 macs="$macs hmac-sha2-256 hmac-sha2-512"
22 22
23for c in $ciphers; do for m in $macs; do 23for c in $ciphers; do for m in $macs; do
24 trace "proto 2 cipher $c mac $m" 24 trace "proto 2 cipher $c mac $m"
diff --git a/regress/connect-privsep.sh b/regress/connect-privsep.sh
index 11fb9aef9..94cc64acf 100644
--- a/regress/connect-privsep.sh
+++ b/regress/connect-privsep.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: connect-privsep.sh,v 1.2 2011/06/30 22:44:43 markus Exp $ 1# $OpenBSD: connect-privsep.sh,v 1.4 2012/07/02 14:37:06 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="proxy connect with privsep" 4tid="proxy connect with privsep"
@@ -23,3 +23,14 @@ for p in 1 2; do
23 warn "ssh privsep/sandbox+proxyconnect protocol $p failed" 23 warn "ssh privsep/sandbox+proxyconnect protocol $p failed"
24 fi 24 fi
25done 25done
26
27# Because sandbox is sensitive to changes in libc, especially malloc, retest
28# with every malloc.conf option (and none).
29for m in '' A F G H J P R S X Z '<' '>'; do
30 for p in 1 2; do
31 env MALLOC_OPTIONS="$m" ${SSH} -$p -F $OBJ/ssh_proxy 999.999.999.999 true
32 if [ $? -ne 0 ]; then
33 fail "ssh privsep/sandbox+proxyconnect protocol $p mopt '$m' failed"
34 fi
35 done
36done
diff --git a/regress/forwarding.sh b/regress/forwarding.sh
index 6dec991a6..f9c367beb 100644
--- a/regress/forwarding.sh
+++ b/regress/forwarding.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: forwarding.sh,v 1.7 2010/01/11 02:53:44 dtucker Exp $ 1# $OpenBSD: forwarding.sh,v 1.8 2012/06/01 00:47:35 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="local and remote forwarding" 4tid="local and remote forwarding"
@@ -75,7 +75,7 @@ for p in 1 2; do
75 else 75 else
76 # this one should fail 76 # this one should fail
77 ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 true \ 77 ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 true \
78 2>${TEST_SSH_LOGFILE} && \ 78 2>>$TEST_SSH_LOGFILE && \
79 fail "local forwarding not cleared" 79 fail "local forwarding not cleared"
80 fi 80 fi
81 sleep 10 81 sleep 10
@@ -88,7 +88,7 @@ for p in 1 2; do
88 else 88 else
89 # this one should fail 89 # this one should fail
90 ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 true \ 90 ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 true \
91 2>${TEST_SSH_LOGFILE} && \ 91 2>>$TEST_SSH_LOGFILE && \
92 fail "remote forwarding not cleared" 92 fail "remote forwarding not cleared"
93 fi 93 fi
94 sleep 10 94 sleep 10
diff --git a/regress/multiplex.sh b/regress/multiplex.sh
index b94cdf02f..93e15088f 100644
--- a/regress/multiplex.sh
+++ b/regress/multiplex.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: multiplex.sh,v 1.12 2009/05/05 07:51:36 dtucker Exp $ 1# $OpenBSD: multiplex.sh,v 1.13 2012/06/01 00:47:36 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4CTL=/tmp/openssh.regress.ctl-sock.$$ 4CTL=/tmp/openssh.regress.ctl-sock.$$
@@ -12,7 +12,6 @@ fi
12 12
13DATA=/bin/ls${EXEEXT} 13DATA=/bin/ls${EXEEXT}
14COPY=$OBJ/ls.copy 14COPY=$OBJ/ls.copy
15LOG=$TEST_SSH_LOGFILE
16 15
17start_sshd 16start_sshd
18 17
@@ -48,13 +47,13 @@ cmp ${DATA} ${COPY} || fail "ssh -S ctl: corrupted copy of ${DATA}"
48rm -f ${COPY} 47rm -f ${COPY}
49trace "sftp transfer over multiplexed connection and check result" 48trace "sftp transfer over multiplexed connection and check result"
50echo "get ${DATA} ${COPY}" | \ 49echo "get ${DATA} ${COPY}" | \
51 ${SFTP} -S ${SSH} -F $OBJ/ssh_config -oControlPath=$CTL otherhost >$LOG 2>&1 50 ${SFTP} -S ${SSH} -F $OBJ/ssh_config -oControlPath=$CTL otherhost >>$TEST_SSH_LOGFILE 2>&1
52test -f ${COPY} || fail "sftp: failed copy ${DATA}" 51test -f ${COPY} || fail "sftp: failed copy ${DATA}"
53cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}" 52cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}"
54 53
55rm -f ${COPY} 54rm -f ${COPY}
56trace "scp transfer over multiplexed connection and check result" 55trace "scp transfer over multiplexed connection and check result"
57${SCP} -S ${SSH} -F $OBJ/ssh_config -oControlPath=$CTL otherhost:${DATA} ${COPY} >$LOG 2>&1 56${SCP} -S ${SSH} -F $OBJ/ssh_config -oControlPath=$CTL otherhost:${DATA} ${COPY} >>$TEST_SSH_LOGFILE 2>&1
58test -f ${COPY} || fail "scp: failed copy ${DATA}" 57test -f ${COPY} || fail "scp: failed copy ${DATA}"
59cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" 58cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}"
60 59
diff --git a/regress/reexec.sh b/regress/reexec.sh
index 6edfc318e..9464eb699 100644
--- a/regress/reexec.sh
+++ b/regress/reexec.sh
@@ -46,6 +46,9 @@ rm -f $PIDFILE
46 46
47cp $OBJ/sshd_config.orig $OBJ/sshd_config 47cp $OBJ/sshd_config.orig $OBJ/sshd_config
48 48
49# cygwin can't fork a deleted binary
50if [ "$os" != "cygwin" ]; then
51
49verbose "test reexec fallback" 52verbose "test reexec fallback"
50 53
51start_sshd_copy 54start_sshd_copy
@@ -69,4 +72,4 @@ copy_tests
69$SUDO kill `$SUDO cat $PIDFILE` 72$SUDO kill `$SUDO cat $PIDFILE`
70rm -f $PIDFILE 73rm -f $PIDFILE
71 74
72 75fi
diff --git a/regress/sftp-cmds.sh b/regress/sftp-cmds.sh
index 1c67b6476..2e0300e16 100644
--- a/regress/sftp-cmds.sh
+++ b/regress/sftp-cmds.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: sftp-cmds.sh,v 1.11 2010/12/04 00:21:19 djm Exp $ 1# $OpenBSD: sftp-cmds.sh,v 1.12 2012/06/01 00:52:52 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4# XXX - TODO: 4# XXX - TODO:
@@ -17,20 +17,6 @@ do
17 fi 17 fi
18done 18done
19 19
20if have_prog uname
21then
22 case `uname` in
23 CYGWIN*)
24 os=cygwin
25 ;;
26 *)
27 os=`uname`
28 ;;
29 esac
30else
31 os="unknown"
32fi
33
34# Path with embedded quote 20# Path with embedded quote
35QUOTECOPY=${COPY}".\"blah\"" 21QUOTECOPY=${COPY}".\"blah\""
36QUOTECOPY_ARG=${COPY}'.\"blah\"' 22QUOTECOPY_ARG=${COPY}'.\"blah\"'
@@ -40,7 +26,7 @@ SPACECOPY_ARG="${COPY}\ this\ has\ spaces.txt"
40# File with glob metacharacters 26# File with glob metacharacters
41GLOBMETACOPY="${COPY} [metachar].txt" 27GLOBMETACOPY="${COPY} [metachar].txt"
42 28
43rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2 ${BATCH}.* 29rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2
44mkdir ${COPY}.dd 30mkdir ${COPY}.dd
45 31
46verbose "$tid: lls" 32verbose "$tid: lls"
@@ -242,7 +228,7 @@ verbose "$tid: lchdir"
242echo "lchdir ${COPY}.dd" | ${SFTP} -D ${SFTPSERVER} >/dev/null 2>&1 \ 228echo "lchdir ${COPY}.dd" | ${SFTP} -D ${SFTPSERVER} >/dev/null 2>&1 \
243 || fail "lchdir failed" 229 || fail "lchdir failed"
244 230
245rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2 ${BATCH}.* 231rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2
246rm -rf ${QUOTECOPY} "$SPACECOPY" "$GLOBMETACOPY" 232rm -rf ${QUOTECOPY} "$SPACECOPY" "$GLOBMETACOPY"
247 233
248 234
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 092cfed5b..bdc2c1a49 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -12,6 +12,13 @@ OSF1*)
12 BIN_SH=xpg4 12 BIN_SH=xpg4
13 export BIN_SH 13 export BIN_SH
14 ;; 14 ;;
15CYGWIN_NT-5.0)
16 os=cygwin
17 TEST_SSH_IPV6=no
18 ;;
19CYGWIN*)
20 os=cygwin
21 ;;
15esac 22esac
16 23
17if [ ! -z "$TEST_SSH_PORT" ]; then 24if [ ! -z "$TEST_SSH_PORT" ]; then
diff --git a/regress/try-ciphers.sh b/regress/try-ciphers.sh
index 0918d2245..925863504 100644
--- a/regress/try-ciphers.sh
+++ b/regress/try-ciphers.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: try-ciphers.sh,v 1.12 2011/08/02 01:23:41 djm Exp $ 1# $OpenBSD: try-ciphers.sh,v 1.13 2012/06/28 05:07:45 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="try ciphers" 4tid="try ciphers"
@@ -9,7 +9,7 @@ ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc
9 aes128-ctr aes192-ctr aes256-ctr" 9 aes128-ctr aes192-ctr aes256-ctr"
10macs="hmac-sha1 hmac-md5 umac-64@openssh.com hmac-sha1-96 hmac-md5-96" 10macs="hmac-sha1 hmac-md5 umac-64@openssh.com hmac-sha1-96 hmac-md5-96"
11config_defined HAVE_EVP_SHA256 && 11config_defined HAVE_EVP_SHA256 &&
12 macs="$macs hmac-sha2-256 hmac-sha2-256-96 hmac-sha2-512 hmac-sha2-512-96" 12 macs="$macs hmac-sha2-256 hmac-sha2-512"
13 13
14for c in $ciphers; do 14for c in $ciphers; do
15 for m in $macs; do 15 for m in $macs; do