From 14a2cf57bbc2124ee2a607e114d9e7517c8c42fb Mon Sep 17 00:00:00 2001 From: djm Date: Tue, 8 Jun 2021 22:30:27 +0000 Subject: [PATCH] test that UserKnownHostsFile correctly accepts multiple arguments; would have caught readconf.c r1.356 regression --- regress/usr.bin/ssh/cert-hostkey.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/regress/usr.bin/ssh/cert-hostkey.sh b/regress/usr.bin/ssh/cert-hostkey.sh index ebf6c903925..de8652b0e5e 100644 --- a/regress/usr.bin/ssh/cert-hostkey.sh +++ b/regress/usr.bin/ssh/cert-hostkey.sh @@ -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 -- 2.20.1