summaryrefslogtreecommitdiff
path: root/regress/hostkey-rotate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/hostkey-rotate.sh')
-rw-r--r--regress/hostkey-rotate.sh11
1 files changed, 4 insertions, 7 deletions
diff --git a/regress/hostkey-rotate.sh b/regress/hostkey-rotate.sh
index cc6bd9cf6..c3e100c3e 100644
--- a/regress/hostkey-rotate.sh
+++ b/regress/hostkey-rotate.sh
@@ -1,11 +1,8 @@
1# $OpenBSD: hostkey-rotate.sh,v 1.6 2019/08/30 05:08:28 dtucker Exp $ 1# $OpenBSD: hostkey-rotate.sh,v 1.8 2019/11/26 23:43:10 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="hostkey rotate" 4tid="hostkey rotate"
5 5
6# Need full names here since they are used in HostKeyAlgorithms
7HOSTKEY_TYPES="`${SSH} -Q key-plain`"
8
9rm -f $OBJ/hkr.* $OBJ/ssh_proxy.orig 6rm -f $OBJ/hkr.* $OBJ/ssh_proxy.orig
10 7
11grep -vi 'hostkey' $OBJ/sshd_proxy > $OBJ/sshd_proxy.orig 8grep -vi 'hostkey' $OBJ/sshd_proxy > $OBJ/sshd_proxy.orig
@@ -20,7 +17,7 @@ secondary="$primary"
20trace "prepare hostkeys" 17trace "prepare hostkeys"
21nkeys=0 18nkeys=0
22all_algs="" 19all_algs=""
23for k in $HOSTKEY_TYPES; do 20for k in $SSH_HOSTKEY_TYPES; do
24 ${SSHKEYGEN} -qt $k -f $OBJ/hkr.$k -N '' || fatal "ssh-keygen $k" 21 ${SSHKEYGEN} -qt $k -f $OBJ/hkr.$k -N '' || fatal "ssh-keygen $k"
25 echo "Hostkey $OBJ/hkr.${k}" >> $OBJ/sshd_proxy.orig 22 echo "Hostkey $OBJ/hkr.${k}" >> $OBJ/sshd_proxy.orig
26 nkeys=`expr $nkeys + 1` 23 nkeys=`expr $nkeys + 1`
@@ -67,12 +64,12 @@ verbose "learn additional hostkeys"
67dossh -oStrictHostKeyChecking=yes -oHostKeyAlgorithms=$all_algs 64dossh -oStrictHostKeyChecking=yes -oHostKeyAlgorithms=$all_algs
68# Check that other keys learned 65# Check that other keys learned
69expect_nkeys $nkeys "learn hostkeys" 66expect_nkeys $nkeys "learn hostkeys"
70for k in $HOSTKEY_TYPES; do 67for k in $SSH_HOSTKEY_TYPES; do
71 check_key_present $k || fail "didn't learn keytype $k" 68 check_key_present $k || fail "didn't learn keytype $k"
72done 69done
73 70
74# Check each key type 71# Check each key type
75for k in $HOSTKEY_TYPES; do 72for k in $SSH_HOSTKEY_TYPES; do
76 verbose "learn additional hostkeys, type=$k" 73 verbose "learn additional hostkeys, type=$k"
77 dossh -oStrictHostKeyChecking=yes -oHostKeyAlgorithms=$k,$all_algs 74 dossh -oStrictHostKeyChecking=yes -oHostKeyAlgorithms=$k,$all_algs
78 expect_nkeys $nkeys "learn hostkeys $k" 75 expect_nkeys $nkeys "learn hostkeys $k"