From: djm Date: Wed, 5 Jan 2022 04:10:39 +0000 (+0000) Subject: regression test for find-principals NULL deref; from Fabian Stelzer X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1909f735fec4f7827bcbcd1a7be2d9d29e5bd0e7;p=openbsd regression test for find-principals NULL deref; from Fabian Stelzer --- diff --git a/regress/usr.bin/ssh/sshsig.sh b/regress/usr.bin/ssh/sshsig.sh index 732b3bf5b0e..40aa0c389bc 100644 --- a/regress/usr.bin/ssh/sshsig.sh +++ b/regress/usr.bin/ssh/sshsig.sh @@ -1,4 +1,4 @@ -# $OpenBSD: sshsig.sh,v 1.11 2021/11/27 07:23:35 djm Exp $ +# $OpenBSD: sshsig.sh,v 1.12 2022/01/05 04:10:39 djm Exp $ # Placed in the Public Domain. tid="sshsig" @@ -208,6 +208,14 @@ for t in $SIGNKEYS; do ${SSHKEYGEN} -vvv -Y find-principals -s $sigfile -f $OBJ/allowed_signers >/dev/null 2>&1 && \ fail "succeeded finding principal with invalid signers file" + # find-principals with a configured namespace but none on command-line + (printf "$sig_principal " ; + printf "namespaces=\"test1,test2\" "; + cat $pubkey) > $OBJ/allowed_signers + ${SSHKEYGEN} -vvv -Y find-principals -s $sigfile \ + -f $OBJ/allowed_signers >/dev/null 2>&1 || \ + fail "failed finding principal when namespaces are configured" + # Check signing keys using ssh-agent. ${SSHADD} -D >/dev/null 2>&1 # Remove all previously-loaded keys. ${SSHADD} ${privkey} > /dev/null 2>&1 || fail "ssh-add failed"