diff options
Diffstat (limited to 'regress/hostkey-rotate.sh')
-rw-r--r-- | regress/hostkey-rotate.sh | 11 |
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 | ||
4 | tid="hostkey rotate" | 4 | tid="hostkey rotate" |
5 | 5 | ||
6 | # Need full names here since they are used in HostKeyAlgorithms | ||
7 | HOSTKEY_TYPES="`${SSH} -Q key-plain`" | ||
8 | |||
9 | rm -f $OBJ/hkr.* $OBJ/ssh_proxy.orig | 6 | rm -f $OBJ/hkr.* $OBJ/ssh_proxy.orig |
10 | 7 | ||
11 | grep -vi 'hostkey' $OBJ/sshd_proxy > $OBJ/sshd_proxy.orig | 8 | grep -vi 'hostkey' $OBJ/sshd_proxy > $OBJ/sshd_proxy.orig |
@@ -20,7 +17,7 @@ secondary="$primary" | |||
20 | trace "prepare hostkeys" | 17 | trace "prepare hostkeys" |
21 | nkeys=0 | 18 | nkeys=0 |
22 | all_algs="" | 19 | all_algs="" |
23 | for k in $HOSTKEY_TYPES; do | 20 | for 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" | |||
67 | dossh -oStrictHostKeyChecking=yes -oHostKeyAlgorithms=$all_algs | 64 | dossh -oStrictHostKeyChecking=yes -oHostKeyAlgorithms=$all_algs |
68 | # Check that other keys learned | 65 | # Check that other keys learned |
69 | expect_nkeys $nkeys "learn hostkeys" | 66 | expect_nkeys $nkeys "learn hostkeys" |
70 | for k in $HOSTKEY_TYPES; do | 67 | for 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" |
72 | done | 69 | done |
73 | 70 | ||
74 | # Check each key type | 71 | # Check each key type |
75 | for k in $HOSTKEY_TYPES; do | 72 | for 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" |