]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: test that UserKnownHostsFile correctly accepts multiple
authordjm@openbsd.org <djm@openbsd.org>
Tue, 8 Jun 2021 22:30:27 +0000 (22:30 +0000)
committerDamien Miller <djm@mindrot.org>
Tue, 8 Jun 2021 22:38:51 +0000 (08:38 +1000)
arguments; would have caught readconf.c r1.356 regression

OpenBSD-Regress-ID: 71ca54e66c2a0211b04999263e56390b1f323a6a

regress/cert-hostkey.sh

index ebf6c903925c21809d3ac60f436f2d87279d7fc1..de8652b0e5e274376cc0fda74383ed8f478b309b 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: cert-hostkey.sh,v 1.24 2021/02/25 03:27:34 djm Exp $
+#      $OpenBSD: cert-hostkey.sh,v 1.25 2021/06/08 22:30:27 djm Exp $
 #      Placed in the Public Domain.
 
 tid="certified host keys"
@@ -283,11 +283,17 @@ for ktype in $PLAIN_TYPES ; do
        ) > $OBJ/sshd_proxy
 
        ${SSH} -oUserKnownHostsFile=$OBJ/known_hosts-cert \
-           -oGlobalKnownHostsFile=$OBJ/known_hosts-cert \
-               -F $OBJ/ssh_proxy somehost true
+           -oGlobalKnownHostsFile=none -F $OBJ/ssh_proxy somehost true
        if [ $? -ne 0 ]; then
                fail "ssh cert connect failed"
        fi
+       # Also check that it works when the known_hosts file is not in the
+       # first array position.
+       ${SSH} -oUserKnownHostsFile="/dev/null $OBJ/known_hosts-cert" \
+           -oGlobalKnownHostsFile=none -F $OBJ/ssh_proxy somehost true
+       if [ $? -ne 0 ]; then
+               fail "ssh cert connect failed known_hosts 2nd"
+       fi
 done
 
 # Wrong certificate