[openssh-commits] [openssh] 02/02: upstream: regression test for UpdateHostkeys with multiple keys backed
git+noreply at mindrot.org
git+noreply at mindrot.org
Wed Nov 27 09:03:40 AEDT 2024
This is an automated email from the git hooks/post-receive script.
djm pushed a commit to branch master
in repository openssh.
commit 0ad34a6193357d286042322ea7347262a6fb0778
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Tue Nov 26 22:02:28 2024 +0000
upstream: regression test for UpdateHostkeys with multiple keys backed
by ssh-agent. Patch from Maxime Rey.
OpenBSD-Regress-ID: 1777ab6e639e57c0e20cbcb6df60455b49fd8bb3
---
regress/hostkey-agent.sh | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/regress/hostkey-agent.sh b/regress/hostkey-agent.sh
index 222d424b..38486585 100644
--- a/regress/hostkey-agent.sh
+++ b/regress/hostkey-agent.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: hostkey-agent.sh,v 1.13 2021/09/30 05:20:08 dtucker Exp $
+# $OpenBSD: hostkey-agent.sh,v 1.14 2024/11/26 22:02:28 djm Exp $
# Placed in the Public Domain.
tid="hostkey agent"
@@ -82,6 +82,30 @@ for k in $SSH_CERTTYPES ; do
fi
done
+verbose "multiple hostkeys"
+cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
+cp $OBJ/ssh_proxy $OBJ/ssh_proxy.orig
+grep -vi 'globalknownhostsfile' $OBJ/ssh_proxy.orig > $OBJ/ssh_proxy
+echo "UpdateHostkeys=yes" >> $OBJ/ssh_proxy
+echo "GlobalKnownHostsFile=none" >> $OBJ/ssh_proxy
+
+for k in $SSH_KEYTYPES ; do
+ verbose "Addkey type $k"
+ echo "Hostkey $OBJ/agent-key.${k}" >> $OBJ/sshd_proxy
+
+ ( printf 'localhost-with-alias ' ;
+ cat $OBJ/agent-key.$k.pub) > $OBJ/known_hosts
+done
+
+opts="-oStrictHostKeyChecking=yes -F $OBJ/ssh_proxy"
+SSH_CONNECTION=`${SSH} $opts host 'echo $SSH_CONNECTION'`
+if [ $? -ne 0 ]; then
+ fail "connection to server with multiple hostkeys failed"
+fi
+if [ "$SSH_CONNECTION" != "UNKNOWN 65535 UNKNOWN 65535" ]; then
+ fail "bad SSH_CONNECTION key while using multiple hostkeys"
+fi
+
trace "kill agent"
${SSHAGENT} -k > /dev/null
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list