summaryrefslogtreecommitdiff
path: root/regress/hostkey-rotate.sh
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2020-02-21 11:57:14 +0000
committerColin Watson <cjwatson@debian.org>2020-02-21 11:57:14 +0000
commitf0de78bd4f29fa688c5df116f3f9cd43543a76d0 (patch)
tree856b0dee3f2764c13a32dad5ffe2424fab7fef41 /regress/hostkey-rotate.sh
parent4213eec74e74de6310c27a40c3e9759a08a73996 (diff)
parent8aa3455b16fddea4c0144a7c4a1edb10ec67dcc8 (diff)
Import openssh_8.2p1.orig.tar.gz
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"