diff options
author | djm@openbsd.org <djm@openbsd.org> | 2015-03-03 17:53:40 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-03-04 04:54:27 +1100 |
commit | d608a51daad4f14ad6ab43d7cf74ef4801cc3fe9 (patch) | |
tree | c4930f63d5b33068b6959ca3cbe89b86ba5c26b7 | |
parent | 68d2dfc464fbcdf8d6387884260f9801f4352393 (diff) |
upstream commit
reorder logic for better portability; patch from Roumen
Petrov
-rw-r--r-- | regress/hostkey-rotate.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/regress/hostkey-rotate.sh b/regress/hostkey-rotate.sh index d964b35c2..b5d542d12 100644 --- a/regress/hostkey-rotate.sh +++ b/regress/hostkey-rotate.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: hostkey-rotate.sh,v 1.1 2015/01/26 06:12:18 djm Exp $ | 1 | # $OpenBSD: hostkey-rotate.sh,v 1.2 2015/03/03 17:53:40 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="hostkey rotate" | 4 | tid="hostkey rotate" |
@@ -38,11 +38,10 @@ expect_nkeys() { | |||
38 | check_key_present() { | 38 | check_key_present() { |
39 | _type=$1 | 39 | _type=$1 |
40 | _kfile=$2 | 40 | _kfile=$2 |
41 | _prog='print $2 " " $3' | ||
42 | test "x$_kfile" = "x" && _kfile="$OBJ/hkr.${_type}.pub" | 41 | test "x$_kfile" = "x" && _kfile="$OBJ/hkr.${_type}.pub" |
43 | _ktext=`awk "/ $_type / { $_prog }" < $OBJ/known_hosts` || \ | 42 | _kpub=`awk "/$_type /"' { print $2 }' < $_kfile` || \ |
44 | fatal "awk failed" | 43 | fatal "awk failed" |
45 | grep -q "$_ktext" $_kfile | 44 | fgrep "$_kpub" $OBJ/known_hosts > /dev/null |
46 | } | 45 | } |
47 | 46 | ||
48 | cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy | 47 | cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy |
@@ -110,7 +109,7 @@ dossh -oStrictHostKeyChecking=yes -oHostKeyAlgorithms=ssh-rsa | |||
110 | expect_nkeys 1 "learn hostkeys" | 109 | expect_nkeys 1 "learn hostkeys" |
111 | check_key_present ssh-rsa || fail "didn't learn changed key" | 110 | check_key_present ssh-rsa || fail "didn't learn changed key" |
112 | 111 | ||
113 | # $OpenBSD: hostkey-rotate.sh,v 1.1 2015/01/26 06:12:18 djm Exp $ | 112 | # $OpenBSD: hostkey-rotate.sh,v 1.2 2015/03/03 17:53:40 djm Exp $ |
114 | # Placed in the Public Domain. | 113 | # Placed in the Public Domain. |
115 | 114 | ||
116 | tid="hostkey rotate" | 115 | tid="hostkey rotate" |