summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-05-17 13:28:36 +1000
committerDarren Tucker <dtucker@zip.com.au>2013-05-17 13:28:36 +1000
commit56347efe796a0506e846621ae65562b978e45f1d (patch)
tree0202d8efec2ba2bd1904f445f4c009ea8a05a091
parent91af05c5167fe0aa5bd41d2e4a83757d9f627c18 (diff)
- dtucker@cvs.openbsd.org 2013/05/17 00:37:40
[regress/agent.sh regress/keytype.sh regress/cfgmatch.sh regress/forcecommand.sh regress/proto-version.sh regress/test-exec.sh regress/cipher-speed.sh regress/cert-hostkey.sh regress/cert-userkey.sh regress/ssh-com.sh] replace 'echo -n' with 'printf' since it's more portable also remove "echon" hack.
-rw-r--r--ChangeLog7
-rw-r--r--regress/agent.sh4
-rw-r--r--regress/cert-hostkey.sh48
-rw-r--r--regress/cert-userkey.sh10
-rw-r--r--regress/cfgmatch.sh6
-rw-r--r--regress/cipher-speed.sh2
-rw-r--r--regress/forcecommand.sh8
-rw-r--r--regress/keytype.sh4
-rw-r--r--regress/proto-version.sh4
-rw-r--r--regress/ssh-com.sh4
-rw-r--r--regress/test-exec.sh18
11 files changed, 55 insertions, 60 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f6572779..da5495f59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,13 @@
42 - dtucker@cvs.openbsd.org 2013/05/16 05:48:31 42 - dtucker@cvs.openbsd.org 2013/05/16 05:48:31
43 [regress/rekey.sh] 43 [regress/rekey.sh]
44 add tests for RekeyLimit parsing 44 add tests for RekeyLimit parsing
45 - dtucker@cvs.openbsd.org 2013/05/17 00:37:40
46 [regress/agent.sh regress/keytype.sh regress/cfgmatch.sh
47 regress/forcecommand.sh regress/proto-version.sh regress/test-exec.sh
48 regress/cipher-speed.sh regress/cert-hostkey.sh regress/cert-userkey.sh
49 regress/ssh-com.sh]
50 replace 'echo -n' with 'printf' since it's more portable
51 also remove "echon" hack.
45 - (dtucker) [regress/bsd.regress.mk] Remove unused file. We've never used it 52 - (dtucker) [regress/bsd.regress.mk] Remove unused file. We've never used it
46 in portable and it's long gone in openbsd. 53 in portable and it's long gone in openbsd.
47 - (dtucker) [regress/integrity.sh]. Force fixed Diffie-Hellman key exchange 54 - (dtucker) [regress/integrity.sh]. Force fixed Diffie-Hellman key exchange
diff --git a/regress/agent.sh b/regress/agent.sh
index 094cf694b..be7d91334 100644
--- a/regress/agent.sh
+++ b/regress/agent.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: agent.sh,v 1.7 2007/11/25 15:35:09 jmc Exp $ 1# $OpenBSD: agent.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="simple agent test" 4tid="simple agent test"
@@ -19,7 +19,7 @@ else
19 fail "ssh-add -l did not fail with exit code 1" 19 fail "ssh-add -l did not fail with exit code 1"
20 fi 20 fi
21 trace "overwrite authorized keys" 21 trace "overwrite authorized keys"
22 echon > $OBJ/authorized_keys_$USER 22 printf '' > $OBJ/authorized_keys_$USER
23 for t in rsa rsa1; do 23 for t in rsa rsa1; do
24 # generate user key for agent 24 # generate user key for agent
25 rm -f $OBJ/$t-agent 25 rm -f $OBJ/$t-agent
diff --git a/regress/cert-hostkey.sh b/regress/cert-hostkey.sh
index 6216abd87..35cd39293 100644
--- a/regress/cert-hostkey.sh
+++ b/regress/cert-hostkey.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: cert-hostkey.sh,v 1.6 2011/05/20 02:43:36 djm Exp $ 1# $OpenBSD: cert-hostkey.sh,v 1.7 2013/05/17 00:37:40 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="certified host keys" 4tid="certified host keys"
@@ -18,8 +18,8 @@ HOSTS='localhost-with-alias,127.0.0.1,::1'
18${SSHKEYGEN} -q -N '' -t rsa -f $OBJ/host_ca_key ||\ 18${SSHKEYGEN} -q -N '' -t rsa -f $OBJ/host_ca_key ||\
19 fail "ssh-keygen of host_ca_key failed" 19 fail "ssh-keygen of host_ca_key failed"
20( 20(
21 echon '@cert-authority ' 21 printf '@cert-authority '
22 echon "$HOSTS " 22 printf "$HOSTS "
23 cat $OBJ/host_ca_key.pub 23 cat $OBJ/host_ca_key.pub
24) > $OBJ/known_hosts-cert 24) > $OBJ/known_hosts-cert
25 25
@@ -66,25 +66,25 @@ done
66 66
67# Revoked certificates with key present 67# Revoked certificates with key present
68( 68(
69 echon '@cert-authority ' 69 printf '@cert-authority '
70 echon "$HOSTS " 70 printf "$HOSTS "
71 cat $OBJ/host_ca_key.pub 71 cat $OBJ/host_ca_key.pub
72 echon '@revoked ' 72 printf '@revoked '
73 echon "* " 73 printf "* "
74 cat $OBJ/cert_host_key_rsa.pub 74 cat $OBJ/cert_host_key_rsa.pub
75 if test "x$TEST_SSH_ECC" = "xyes"; then 75 if test "x$TEST_SSH_ECC" = "xyes"; then
76 echon '@revoked ' 76 printf '@revoked '
77 echon "* " 77 printf "* "
78 cat $OBJ/cert_host_key_ecdsa.pub 78 cat $OBJ/cert_host_key_ecdsa.pub
79 fi 79 fi
80 echon '@revoked ' 80 printf '@revoked '
81 echon "* " 81 printf "* "
82 cat $OBJ/cert_host_key_dsa.pub 82 cat $OBJ/cert_host_key_dsa.pub
83 echon '@revoked ' 83 printf '@revoked '
84 echon "* " 84 printf "* "
85 cat $OBJ/cert_host_key_rsa_v00.pub 85 cat $OBJ/cert_host_key_rsa_v00.pub
86 echon '@revoked ' 86 printf '@revoked '
87 echon "* " 87 printf "* "
88 cat $OBJ/cert_host_key_dsa_v00.pub 88 cat $OBJ/cert_host_key_dsa_v00.pub
89) > $OBJ/known_hosts-cert 89) > $OBJ/known_hosts-cert
90for privsep in yes no ; do 90for privsep in yes no ; do
@@ -108,11 +108,11 @@ done
108 108
109# Revoked CA 109# Revoked CA
110( 110(
111 echon '@cert-authority ' 111 printf '@cert-authority '
112 echon "$HOSTS " 112 printf "$HOSTS "
113 cat $OBJ/host_ca_key.pub 113 cat $OBJ/host_ca_key.pub
114 echon '@revoked ' 114 printf '@revoked '
115 echon "* " 115 printf "* "
116 cat $OBJ/host_ca_key.pub 116 cat $OBJ/host_ca_key.pub
117) > $OBJ/known_hosts-cert 117) > $OBJ/known_hosts-cert
118for ktype in rsa dsa $ecdsa rsa_v00 dsa_v00 ; do 118for ktype in rsa dsa $ecdsa rsa_v00 dsa_v00 ; do
@@ -132,8 +132,8 @@ done
132 132
133# Create a CA key and add it to known hosts 133# Create a CA key and add it to known hosts
134( 134(
135 echon '@cert-authority ' 135 printf '@cert-authority '
136 echon "$HOSTS " 136 printf "$HOSTS "
137 cat $OBJ/host_ca_key.pub 137 cat $OBJ/host_ca_key.pub
138) > $OBJ/known_hosts-cert 138) > $OBJ/known_hosts-cert
139 139
@@ -200,7 +200,7 @@ for v in v01 v00 ; do
200 -n $HOSTS $OBJ/cert_host_key_${ktype} || 200 -n $HOSTS $OBJ/cert_host_key_${ktype} ||
201 fail "couldn't sign cert_host_key_${ktype}" 201 fail "couldn't sign cert_host_key_${ktype}"
202 ( 202 (
203 echon "$HOSTS " 203 printf "$HOSTS "
204 cat $OBJ/cert_host_key_${ktype}.pub 204 cat $OBJ/cert_host_key_${ktype}.pub
205 ) > $OBJ/known_hosts-cert 205 ) > $OBJ/known_hosts-cert
206 ( 206 (
@@ -220,8 +220,8 @@ done
220 220
221# Wrong certificate 221# Wrong certificate
222( 222(
223 echon '@cert-authority ' 223 printf '@cert-authority '
224 echon "$HOSTS " 224 printf "$HOSTS "
225 cat $OBJ/host_ca_key.pub 225 cat $OBJ/host_ca_key.pub
226) > $OBJ/known_hosts-cert 226) > $OBJ/known_hosts-cert
227for v in v01 v00 ; do 227for v in v01 v00 ; do
diff --git a/regress/cert-userkey.sh b/regress/cert-userkey.sh
index 3bba9f8f2..6018b38f4 100644
--- a/regress/cert-userkey.sh
+++ b/regress/cert-userkey.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: cert-userkey.sh,v 1.10 2013/01/18 00:45:29 djm Exp $ 1# $OpenBSD: cert-userkey.sh,v 1.11 2013/05/17 00:37:40 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="certified user keys" 4tid="certified user keys"
@@ -126,7 +126,7 @@ for ktype in rsa dsa $ecdsa rsa_v00 dsa_v00 ; do
126 # Wrong principals list 126 # Wrong principals list
127 verbose "$tid: ${_prefix} wrong principals key option" 127 verbose "$tid: ${_prefix} wrong principals key option"
128 ( 128 (
129 echon 'cert-authority,principals="gregorsamsa" ' 129 printf 'cert-authority,principals="gregorsamsa" '
130 cat $OBJ/user_ca_key.pub 130 cat $OBJ/user_ca_key.pub
131 ) > $OBJ/authorized_keys_$USER 131 ) > $OBJ/authorized_keys_$USER
132 ${SSH} -2i $OBJ/cert_user_key_${ktype} \ 132 ${SSH} -2i $OBJ/cert_user_key_${ktype} \
@@ -138,7 +138,7 @@ for ktype in rsa dsa $ecdsa rsa_v00 dsa_v00 ; do
138 # Correct principals list 138 # Correct principals list
139 verbose "$tid: ${_prefix} correct principals key option" 139 verbose "$tid: ${_prefix} correct principals key option"
140 ( 140 (
141 echon 'cert-authority,principals="mekmitasdigoat" ' 141 printf 'cert-authority,principals="mekmitasdigoat" '
142 cat $OBJ/user_ca_key.pub 142 cat $OBJ/user_ca_key.pub
143 ) > $OBJ/authorized_keys_$USER 143 ) > $OBJ/authorized_keys_$USER
144 ${SSH} -2i $OBJ/cert_user_key_${ktype} \ 144 ${SSH} -2i $OBJ/cert_user_key_${ktype} \
@@ -154,7 +154,7 @@ basic_tests() {
154 if test "x$auth" = "xauthorized_keys" ; then 154 if test "x$auth" = "xauthorized_keys" ; then
155 # Add CA to authorized_keys 155 # Add CA to authorized_keys
156 ( 156 (
157 echon 'cert-authority ' 157 printf 'cert-authority '
158 cat $OBJ/user_ca_key.pub 158 cat $OBJ/user_ca_key.pub
159 ) > $OBJ/authorized_keys_$USER 159 ) > $OBJ/authorized_keys_$USER
160 else 160 else
@@ -264,7 +264,7 @@ test_one() {
264 if test "x$auth" = "xauthorized_keys" ; then 264 if test "x$auth" = "xauthorized_keys" ; then
265 # Add CA to authorized_keys 265 # Add CA to authorized_keys
266 ( 266 (
267 echon "cert-authority${auth_opt} " 267 printf "cert-authority${auth_opt} "
268 cat $OBJ/user_ca_key.pub 268 cat $OBJ/user_ca_key.pub
269 ) > $OBJ/authorized_keys_$USER 269 ) > $OBJ/authorized_keys_$USER
270 else 270 else
diff --git a/regress/cfgmatch.sh b/regress/cfgmatch.sh
index 02755d9d0..df4acfe0c 100644
--- a/regress/cfgmatch.sh
+++ b/regress/cfgmatch.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: cfgmatch.sh,v 1.7 2013/04/06 06:00:22 dtucker Exp $ 1# $OpenBSD: cfgmatch.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="sshd_config match" 4tid="sshd_config match"
@@ -75,9 +75,9 @@ for p in 1 2; do
75done 75done
76 76
77# Retry previous with key option, should also be denied. 77# Retry previous with key option, should also be denied.
78echon 'permitopen="127.0.0.1:'$PORT'" ' >$OBJ/authorized_keys_$USER 78printf 'permitopen="127.0.0.1:'$PORT'" ' >$OBJ/authorized_keys_$USER
79cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER 79cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER
80echon 'permitopen="127.0.0.1:'$PORT'" ' >>$OBJ/authorized_keys_$USER 80printf 'permitopen="127.0.0.1:'$PORT'" ' >>$OBJ/authorized_keys_$USER
81cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER 81cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER
82for p in 1 2; do 82for p in 1 2; do
83 trace "match permitopen proxy w/key opts proto $p" 83 trace "match permitopen proxy w/key opts proto $p"
diff --git a/regress/cipher-speed.sh b/regress/cipher-speed.sh
index 65e5f35ec..07daebe62 100644
--- a/regress/cipher-speed.sh
+++ b/regress/cipher-speed.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: cipher-speed.sh,v 1.7 2013/01/12 11:23:53 djm Exp $ 1# $OpenBSD: cipher-speed.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="cipher speed" 4tid="cipher speed"
diff --git a/regress/forcecommand.sh b/regress/forcecommand.sh
index 99e51a60f..ba21c0eb1 100644
--- a/regress/forcecommand.sh
+++ b/regress/forcecommand.sh
@@ -5,9 +5,9 @@ tid="forced command"
5 5
6cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak 6cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak
7 7
8echon 'command="true" ' >$OBJ/authorized_keys_$USER 8printf 'command="true" ' >$OBJ/authorized_keys_$USER
9cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER 9cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER
10echon 'command="true" ' >>$OBJ/authorized_keys_$USER 10printf 'command="true" ' >>$OBJ/authorized_keys_$USER
11cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER 11cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER
12 12
13for p in 1 2; do 13for p in 1 2; do
@@ -16,9 +16,9 @@ for p in 1 2; do
16 fail "forced command in key proto $p" 16 fail "forced command in key proto $p"
17done 17done
18 18
19echon 'command="false" ' >$OBJ/authorized_keys_$USER 19printf 'command="false" ' >$OBJ/authorized_keys_$USER
20cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER 20cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER
21echon 'command="false" ' >>$OBJ/authorized_keys_$USER 21printf 'command="false" ' >>$OBJ/authorized_keys_$USER
22cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER 22cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER
23 23
24cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy 24cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy
diff --git a/regress/keytype.sh b/regress/keytype.sh
index cb40c6864..59586bf0d 100644
--- a/regress/keytype.sh
+++ b/regress/keytype.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: keytype.sh,v 1.1 2010/09/02 16:12:55 markus Exp $ 1# $OpenBSD: keytype.sh,v 1.2 2013/05/17 00:37:40 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="login with different key types" 4tid="login with different key types"
@@ -40,7 +40,7 @@ for ut in $ktypes; do
40 echo IdentityFile $OBJ/key.$ut 40 echo IdentityFile $OBJ/key.$ut
41 ) > $OBJ/ssh_proxy 41 ) > $OBJ/ssh_proxy
42 ( 42 (
43 echon 'localhost-with-alias,127.0.0.1,::1 ' 43 printf 'localhost-with-alias,127.0.0.1,::1 '
44 cat $OBJ/key.$ht.pub 44 cat $OBJ/key.$ht.pub
45 ) > $OBJ/known_hosts 45 ) > $OBJ/known_hosts
46 cat $OBJ/key.$ut.pub > $OBJ/authorized_keys_$USER 46 cat $OBJ/key.$ut.pub > $OBJ/authorized_keys_$USER
diff --git a/regress/proto-version.sh b/regress/proto-version.sh
index 1651a69e1..b876dd7ec 100644
--- a/regress/proto-version.sh
+++ b/regress/proto-version.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: proto-version.sh,v 1.3 2002/03/15 13:08:56 markus Exp $ 1# $OpenBSD: proto-version.sh,v 1.4 2013/05/17 00:37:40 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="sshd version with different protocol combinations" 4tid="sshd version with different protocol combinations"
@@ -8,7 +8,7 @@ check_version ()
8{ 8{
9 version=$1 9 version=$1
10 expect=$2 10 expect=$2
11 banner=`echon | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy` 11 banner=`printf '' | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy`
12 case ${banner} in 12 case ${banner} in
13 SSH-1.99-*) 13 SSH-1.99-*)
14 proto=199 14 proto=199
diff --git a/regress/ssh-com.sh b/regress/ssh-com.sh
index 7bcd85b65..6c5cfe888 100644
--- a/regress/ssh-com.sh
+++ b/regress/ssh-com.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: ssh-com.sh,v 1.7 2004/02/24 17:06:52 markus Exp $ 1# $OpenBSD: ssh-com.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="connect to ssh.com server" 4tid="connect to ssh.com server"
@@ -70,7 +70,7 @@ done
70 70
71# convert and append DSA hostkey 71# convert and append DSA hostkey
72( 72(
73 echon 'ssh2-localhost-with-alias,127.0.0.1,::1 ' 73 printf 'ssh2-localhost-with-alias,127.0.0.1,::1 '
74 ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub 74 ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub
75) >> $OBJ/known_hosts 75) >> $OBJ/known_hosts
76 76
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index f797ab68d..0680eaa94 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: test-exec.sh,v 1.40 2013/04/07 02:16:03 dtucker Exp $ 1# $OpenBSD: test-exec.sh,v 1.41 2013/05/17 00:37:40 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4#SUDO=sudo 4#SUDO=sudo
@@ -172,18 +172,6 @@ SSH="$SSHLOGWRAP"
172export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP 172export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP
173#echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER $SCP 173#echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER $SCP
174 174
175# helper
176echon()
177{
178 if [ "x`echo -n`" = "x" ]; then
179 echo -n "$@"
180 elif [ "x`echo '\c'`" = "x" ]; then
181 echo "$@\c"
182 else
183 fatal "Don't know how to echo without newline."
184 fi
185}
186
187have_prog() 175have_prog()
188{ 176{
189 saved_IFS="$IFS" 177 saved_IFS="$IFS"
@@ -273,7 +261,7 @@ fail ()
273fatal () 261fatal ()
274{ 262{
275 save_debug_log "FATAL: $@" 263 save_debug_log "FATAL: $@"
276 echo -n "FATAL: " 264 printf "FATAL: "
277 fail "$@" 265 fail "$@"
278 cleanup 266 cleanup
279 exit $RESULT 267 exit $RESULT
@@ -360,7 +348,7 @@ for t in rsa rsa1; do
360 348
361 # known hosts file for client 349 # known hosts file for client
362 ( 350 (
363 echon 'localhost-with-alias,127.0.0.1,::1 ' 351 printf 'localhost-with-alias,127.0.0.1,::1 '
364 cat $OBJ/$t.pub 352 cat $OBJ/$t.pub
365 ) >> $OBJ/known_hosts 353 ) >> $OBJ/known_hosts
366 354