]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Add test for ssh hashed known_hosts handling.
authordtucker@openbsd.org <dtucker@openbsd.org>
Fri, 1 Oct 2021 05:20:20 +0000 (05:20 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 6 Oct 2021 03:39:32 +0000 (14:39 +1100)
OpenBSD-Regress-ID: bcef3b3cd5a1ad9899327b4b2183de2541aaf9cf

regress/Makefile
regress/knownhosts.sh [new file with mode: 0644]

index d5481e44f1565a0985fdf5b0674a86a198d83d17..75e00ae5077f7b5c10c55d8f7668a80b5482450f 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.117 2021/09/03 04:11:13 dtucker Exp $
+#      $OpenBSD: Makefile,v 1.118 2021/10/01 05:20:20 dtucker Exp $
 
 tests:         prep file-tests t-exec unit
 
@@ -98,6 +98,7 @@ LTESTS=       connect \
                allow-deny-users \
                authinfo \
                sshsig \
+               knownhosts \
                knownhosts-command
 
 
diff --git a/regress/knownhosts.sh b/regress/knownhosts.sh
new file mode 100644 (file)
index 0000000..dfc768a
--- /dev/null
@@ -0,0 +1,17 @@
+#      $OpenBSD: knownhosts.sh,v 1.1 2021/10/01 05:20:20 dtucker Exp $
+#      Placed in the Public Domain.
+
+tid="known hosts"
+
+opts="-F $OBJ/ssh_proxy"
+
+trace "test initial connection"
+${SSH} $opts somehost true || fail "initial connection"
+
+trace "learn hashed known host"
+>$OBJ/known_hosts
+${SSH} -ohashknownhosts=yes -o stricthostkeychecking=no $opts somehost true \
+   || fail "learn hashed known_hosts"
+
+trace "test hashed known hosts"
+${SSH} $opts somehost true || fail "reconnect with hashed known hosts"