summaryrefslogtreecommitdiff
path: root/regress/hostkey-agent.sh
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-01-20 08:02:33 +0000
committerDamien Miller <djm@mindrot.org>2015-01-20 19:03:08 +1100
commit1d6424a6ff94633c221297ae8f42d54e12a20912 (patch)
treed82da0f628ed3ae4a08e71d155957da673661c9e /regress/hostkey-agent.sh
parent12b5f50777203e12575f1b08568281e447249ed3 (diff)
upstream commit
this test would accidentally delete agent.sh if run without obj/
Diffstat (limited to 'regress/hostkey-agent.sh')
-rw-r--r--regress/hostkey-agent.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/regress/hostkey-agent.sh b/regress/hostkey-agent.sh
index 84fb2c2d2..fddb0415b 100644
--- a/regress/hostkey-agent.sh
+++ b/regress/hostkey-agent.sh
@@ -1,9 +1,9 @@
1# $OpenBSD: hostkey-agent.sh,v 1.2 2015/01/19 06:01:32 djm Exp $ 1# $OpenBSD: hostkey-agent.sh,v 1.3 2015/01/20 08:02:33 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="hostkey agent" 4tid="hostkey agent"
5 5
6rm -f $OBJ/agent.* $OBJ/ssh_proxy.orig $OBJ/known_hosts.orig 6rm -f $OBJ/agent-key.* $OBJ/ssh_proxy.orig $OBJ/known_hosts.orig
7 7
8trace "start agent" 8trace "start agent"
9eval `${SSHAGENT} -s` > /dev/null 9eval `${SSHAGENT} -s` > /dev/null
@@ -15,16 +15,16 @@ echo "HostKeyAgent $SSH_AUTH_SOCK" >> $OBJ/sshd_proxy.orig
15 15
16trace "load hostkeys" 16trace "load hostkeys"
17for k in `${SSH} -Q key-plain` ; do 17for k in `${SSH} -Q key-plain` ; do
18 ${SSHKEYGEN} -qt $k -f $OBJ/agent.$k -N '' || fatal "ssh-keygen $k" 18 ${SSHKEYGEN} -qt $k -f $OBJ/agent-key.$k -N '' || fatal "ssh-keygen $k"
19 ( 19 (
20 echo -n 'localhost-with-alias,127.0.0.1,::1 ' 20 echo -n 'localhost-with-alias,127.0.0.1,::1 '
21 cat $OBJ/agent.$k.pub 21 cat $OBJ/agent-key.$k.pub
22 ) >> $OBJ/known_hosts.orig 22 ) >> $OBJ/known_hosts.orig
23 ${SSHADD} $OBJ/agent.$k >/dev/null 2>&1 || \ 23 ${SSHADD} $OBJ/agent-key.$k >/dev/null 2>&1 || \
24 fatal "couldn't load key $OBJ/agent.$k" 24 fatal "couldn't load key $OBJ/agent-key.$k"
25 echo "Hostkey $OBJ/agent.${k}" >> sshd_proxy.orig 25 echo "Hostkey $OBJ/agent-key.${k}" >> sshd_proxy.orig
26 # Remove private key so the server can't use it. 26 # Remove private key so the server can't use it.
27 rm $OBJ/agent.$k || fatal "couldn't rm $OBJ/agent.$k" 27 rm $OBJ/agent-key.$k || fatal "couldn't rm $OBJ/agent-key.$k"
28done 28done
29cp $OBJ/known_hosts.orig $OBJ/known_hosts 29cp $OBJ/known_hosts.orig $OBJ/known_hosts
30 30