diff --git a/regress/cert-hostkey.sh b/regress/cert-hostkey.sh index ebf6c9039..de8652b0e 100644 --- a/regress/cert-hostkey.sh +++ b/regress/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