summaryrefslogtreecommitdiffstats
path: root/regress/knownhosts.sh
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2021-10-01 07:20:20 +0200
committerDamien Miller <djm@mindrot.org>2021-10-06 05:39:32 +0200
commit12937d867019469ebce83c2ff614cdc6688fc2d8 (patch)
tree9e91afb0f204ec0b0c46bcbff065614ffd1b4e3e /regress/knownhosts.sh
parentfix broken OPENSSL_HAS_ECC test (diff)
downloadopenssh-12937d867019469ebce83c2ff614cdc6688fc2d8.tar.xz
openssh-12937d867019469ebce83c2ff614cdc6688fc2d8.zip
upstream: Add test for ssh hashed known_hosts handling.
OpenBSD-Regress-ID: bcef3b3cd5a1ad9899327b4b2183de2541aaf9cf
Diffstat (limited to 'regress/knownhosts.sh')
-rw-r--r--regress/knownhosts.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/regress/knownhosts.sh b/regress/knownhosts.sh
new file mode 100644
index 000000000..dfc768ac9
--- /dev/null
+++ b/regress/knownhosts.sh
@@ -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"