diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/addrmatch.sh | 53 | ||||
-rw-r--r-- | regress/cipher-speed.sh | 4 | ||||
-rw-r--r-- | regress/connect-privsep.sh | 13 | ||||
-rw-r--r-- | regress/forwarding.sh | 6 | ||||
-rw-r--r-- | regress/multiplex.sh | 7 | ||||
-rw-r--r-- | regress/reexec.sh | 5 | ||||
-rw-r--r-- | regress/sftp-cmds.sh | 20 | ||||
-rw-r--r-- | regress/test-exec.sh | 7 | ||||
-rw-r--r-- | regress/try-ciphers.sh | 4 |
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 | ||
4 | tid="address match" | 4 | tid="address match" |
@@ -7,39 +7,50 @@ mv $OBJ/sshd_proxy $OBJ/sshd_proxy_bak | |||
7 | 7 | ||
8 | run_trial() | 8 | run_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 | ||
21 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy | 22 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy |
22 | cat >>$OBJ/sshd_proxy <<EOD | 23 | cat >>$OBJ/sshd_proxy <<EOD |
23 | PasswordAuthentication no | 24 | ForceCommand nomatch |
24 | Match Address 192.168.0.0/16,!192.168.30.0/24,10.0.0.0/8,host.example.com | 25 | Match 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 |
26 | Match Address 1.1.1.1,::1,!::3,2000::/16 | 27 | Match Address 1.1.1.1,::1,!::3,2000::/16 |
27 | PasswordAuthentication yes | 28 | ForceCommand match2 |
29 | Match LocalAddress 127.0.0.1,::1 | ||
30 | ForceCommand match3 | ||
31 | Match LocalPort 5678 | ||
32 | ForceCommand match4 | ||
28 | EOD | 33 | EOD |
29 | 34 | ||
30 | run_trial user 192.168.0.1 somehost yes "permit, first entry" | 35 | run_trial user 192.168.0.1 somehost 1.2.3.4 1234 match1 "first entry" |
31 | run_trial user 192.168.30.1 somehost no "deny, negative match" | 36 | run_trial user 192.168.30.1 somehost 1.2.3.4 1234 nomatch "negative match" |
32 | run_trial user 19.0.0.1 somehost no "deny, no match" | 37 | run_trial user 19.0.0.1 somehost 1.2.3.4 1234 nomatch "no match" |
33 | run_trial user 10.255.255.254 somehost yes "permit, list middle" | 38 | run_trial user 10.255.255.254 somehost 1.2.3.4 1234 match1 "list middle" |
34 | run_trial user 192.168.30.1 192.168.0.1 no "deny, faked IP in hostname" | 39 | run_trial user 192.168.30.1 192.168.0.1 1.2.3.4 1234 nomatch "faked IP in hostname" |
35 | run_trial user 1.1.1.1 somehost.example.com yes "permit, bare IP4 address" | 40 | run_trial user 1.1.1.1 somehost.example.com 1.2.3.4 1234 match2 "bare IP4 address" |
36 | test "$TEST_SSH_IPV6" = "no" && exit | 41 | run_trial user 19.0.0.1 somehost 127.0.0.1 1234 match3 "localaddress" |
37 | run_trial user ::1 somehost.example.com yes "permit, bare IP6 address" | 42 | run_trial user 19.0.0.1 somehost 1.2.3.4 5678 match4 "localport" |
38 | run_trial user ::2 somehost.exaple.com no "deny IPv6" | 43 | |
39 | run_trial user ::3 somehost no "deny IP6 negated" | 44 | if test "$TEST_SSH_IPV6" != "no"; then |
40 | run_trial user ::4 somehost no "deny, IP6 no match" | 45 | run_trial user ::1 somehost.example.com ::2 1234 match2 "bare IP6 address" |
41 | run_trial user 2000::1 somehost yes "permit, IP6 network" | 46 | run_trial user ::2 somehost.exaple.com ::2 1234 nomatch "deny IPv6" |
42 | run_trial user 2001::1 somehost no "deny, IP6 network" | 47 | run_trial user ::3 somehost ::2 1234 nomatch "IP6 negated" |
48 | run_trial user ::4 somehost ::2 1234 nomatch "IP6 no match" | ||
49 | run_trial user 2000::1 somehost ::2 1234 match2 "IP6 network" | ||
50 | run_trial user 2001::1 somehost ::2 1234 nomatch "IP6 network" | ||
51 | run_trial user ::5 somehost ::1 1234 match3 "IP6 localaddress" | ||
52 | run_trial user ::5 somehost ::2 5678 match4 "IP6 localport" | ||
53 | fi | ||
43 | 54 | ||
44 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy | 55 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy |
45 | rm $OBJ/sshd_proxy_bak | 56 | rm $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 | ||
4 | tid="cipher speed" | 4 | tid="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" |
19 | macs="hmac-sha1 hmac-md5 umac-64@openssh.com hmac-sha1-96 hmac-md5-96" | 19 | macs="hmac-sha1 hmac-md5 umac-64@openssh.com hmac-sha1-96 hmac-md5-96" |
20 | config_defined HAVE_EVP_SHA256 && | 20 | config_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 | ||
23 | for c in $ciphers; do for m in $macs; do | 23 | for 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 | ||
4 | tid="proxy connect with privsep" | 4 | tid="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 |
25 | done | 25 | done |
26 | |||
27 | # Because sandbox is sensitive to changes in libc, especially malloc, retest | ||
28 | # with every malloc.conf option (and none). | ||
29 | for 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 | ||
36 | done | ||
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 | ||
4 | tid="local and remote forwarding" | 4 | tid="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 | ||
4 | CTL=/tmp/openssh.regress.ctl-sock.$$ | 4 | CTL=/tmp/openssh.regress.ctl-sock.$$ |
@@ -12,7 +12,6 @@ fi | |||
12 | 12 | ||
13 | DATA=/bin/ls${EXEEXT} | 13 | DATA=/bin/ls${EXEEXT} |
14 | COPY=$OBJ/ls.copy | 14 | COPY=$OBJ/ls.copy |
15 | LOG=$TEST_SSH_LOGFILE | ||
16 | 15 | ||
17 | start_sshd | 16 | start_sshd |
18 | 17 | ||
@@ -48,13 +47,13 @@ cmp ${DATA} ${COPY} || fail "ssh -S ctl: corrupted copy of ${DATA}" | |||
48 | rm -f ${COPY} | 47 | rm -f ${COPY} |
49 | trace "sftp transfer over multiplexed connection and check result" | 48 | trace "sftp transfer over multiplexed connection and check result" |
50 | echo "get ${DATA} ${COPY}" | \ | 49 | echo "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 |
52 | test -f ${COPY} || fail "sftp: failed copy ${DATA}" | 51 | test -f ${COPY} || fail "sftp: failed copy ${DATA}" |
53 | cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}" | 52 | cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}" |
54 | 53 | ||
55 | rm -f ${COPY} | 54 | rm -f ${COPY} |
56 | trace "scp transfer over multiplexed connection and check result" | 55 | trace "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 |
58 | test -f ${COPY} || fail "scp: failed copy ${DATA}" | 57 | test -f ${COPY} || fail "scp: failed copy ${DATA}" |
59 | cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" | 58 | cmp ${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 | ||
47 | cp $OBJ/sshd_config.orig $OBJ/sshd_config | 47 | cp $OBJ/sshd_config.orig $OBJ/sshd_config |
48 | 48 | ||
49 | # cygwin can't fork a deleted binary | ||
50 | if [ "$os" != "cygwin" ]; then | ||
51 | |||
49 | verbose "test reexec fallback" | 52 | verbose "test reexec fallback" |
50 | 53 | ||
51 | start_sshd_copy | 54 | start_sshd_copy |
@@ -69,4 +72,4 @@ copy_tests | |||
69 | $SUDO kill `$SUDO cat $PIDFILE` | 72 | $SUDO kill `$SUDO cat $PIDFILE` |
70 | rm -f $PIDFILE | 73 | rm -f $PIDFILE |
71 | 74 | ||
72 | 75 | fi | |
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 |
18 | done | 18 | done |
19 | 19 | ||
20 | if have_prog uname | ||
21 | then | ||
22 | case `uname` in | ||
23 | CYGWIN*) | ||
24 | os=cygwin | ||
25 | ;; | ||
26 | *) | ||
27 | os=`uname` | ||
28 | ;; | ||
29 | esac | ||
30 | else | ||
31 | os="unknown" | ||
32 | fi | ||
33 | |||
34 | # Path with embedded quote | 20 | # Path with embedded quote |
35 | QUOTECOPY=${COPY}".\"blah\"" | 21 | QUOTECOPY=${COPY}".\"blah\"" |
36 | QUOTECOPY_ARG=${COPY}'.\"blah\"' | 22 | QUOTECOPY_ARG=${COPY}'.\"blah\"' |
@@ -40,7 +26,7 @@ SPACECOPY_ARG="${COPY}\ this\ has\ spaces.txt" | |||
40 | # File with glob metacharacters | 26 | # File with glob metacharacters |
41 | GLOBMETACOPY="${COPY} [metachar].txt" | 27 | GLOBMETACOPY="${COPY} [metachar].txt" |
42 | 28 | ||
43 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2 ${BATCH}.* | 29 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2 |
44 | mkdir ${COPY}.dd | 30 | mkdir ${COPY}.dd |
45 | 31 | ||
46 | verbose "$tid: lls" | 32 | verbose "$tid: lls" |
@@ -242,7 +228,7 @@ verbose "$tid: lchdir" | |||
242 | echo "lchdir ${COPY}.dd" | ${SFTP} -D ${SFTPSERVER} >/dev/null 2>&1 \ | 228 | echo "lchdir ${COPY}.dd" | ${SFTP} -D ${SFTPSERVER} >/dev/null 2>&1 \ |
243 | || fail "lchdir failed" | 229 | || fail "lchdir failed" |
244 | 230 | ||
245 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2 ${BATCH}.* | 231 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2 |
246 | rm -rf ${QUOTECOPY} "$SPACECOPY" "$GLOBMETACOPY" | 232 | rm -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 | ;; |
15 | CYGWIN_NT-5.0) | ||
16 | os=cygwin | ||
17 | TEST_SSH_IPV6=no | ||
18 | ;; | ||
19 | CYGWIN*) | ||
20 | os=cygwin | ||
21 | ;; | ||
15 | esac | 22 | esac |
16 | 23 | ||
17 | if [ ! -z "$TEST_SSH_PORT" ]; then | 24 | if [ ! -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 | ||
4 | tid="try ciphers" | 4 | tid="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" |
10 | macs="hmac-sha1 hmac-md5 umac-64@openssh.com hmac-sha1-96 hmac-md5-96" | 10 | macs="hmac-sha1 hmac-md5 umac-64@openssh.com hmac-sha1-96 hmac-md5-96" |
11 | config_defined HAVE_EVP_SHA256 && | 11 | config_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 | ||
14 | for c in $ciphers; do | 14 | for c in $ciphers; do |
15 | for m in $macs; do | 15 | for m in $macs; do |