[openssh-commits] [openssh] 18/18: upstream: regression test for sshsig signatured with certificate
git+noreply at mindrot.org
git+noreply at mindrot.org
Wed Nov 25 19:56:13 AEDT 2026
This is an automated email from the git hooks/post-receive script.
djm pushed a commit to branch master
in repository openssh.
commit 07d888efaf1605d5f53692e827ae4418a212ca26
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Wed Nov 25 08:49:18 2026 +0000
upstream: regression test for sshsig signatured with certificate
options
OpenBSD-Regress-ID: cb70d5aeaa6b6378e3b821e580a997c29c603159
---
regress/sshsig.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 46 insertions(+), 2 deletions(-)
diff --git a/regress/sshsig.sh b/regress/sshsig.sh
index 695070acb..45adc69eb 100644
--- a/regress/sshsig.sh
+++ b/regress/sshsig.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: sshsig.sh,v 1.17 2026/06/16 10:58:42 dtucker Exp $
+# $OpenBSD: sshsig.sh,v 1.18 2026/11/25 08:49:18 djm Exp $
# Placed in the Public Domain.
tid="sshsig"
@@ -6,7 +6,7 @@ tid="sshsig"
DATA2=$OBJ/${DATANAME}.2
cat ${DATA} ${DATA} > ${DATA2}
-rm -f $OBJ/sshsig-*.sig $OBJ/wrong-key* $OBJ/sigca-key*
+rm -f $OBJ/sshsig-*.sig $OBJ/wrong-key* $OBJ/sigca-key* $OBJ/sigcrit*
sig_namespace="test-$$"
sig_principal="user-$$@example.com"
@@ -505,6 +505,50 @@ for t in $SIGNKEYS; do
< $DATA >/dev/null 2>&1 && \
fail "accepted signature for $t key with expired CA but valid cert"
+ # Certificates with unsupported critical options
+ (printf "$sig_principal cert-authority " ;
+ cat $CA_PUB) > $OBJ/allowed_signers
+ cp $privkey $OBJ/sigcrit
+ cp $privkey.pub $OBJ/sigcrit.pub
+ for o in critical:test at example.com force-command=/bin/true \
+ source-address=127.0.0.1 ; do
+ trace "$tid: key type $t verify cert with $o"
+ ${SSHKEYGEN} -q -s $CA_PRIV -I "critical" -O $o \
+ -n $sig_principal $OBJ/sigcrit.pub || \
+ fatal "couldn't sign ${t} with $o"
+ SSH_AUTH_SOCK=/nonexistent ${SSHKEYGEN} -q -Y sign \
+ -f $OBJ/sigcrit-cert.pub -n $sig_namespace \
+ < $DATA > $OBJ/sshsig-crit.sig 2>/dev/null || \
+ fail "sign using $t cert with $o failed"
+ ${SSHKEYGEN} -vvv -Y verify -s $OBJ/sshsig-crit.sig \
+ -n $sig_namespace -I $sig_principal \
+ -f $OBJ/allowed_signers < $DATA >/dev/null 2>&1 && \
+ fail "accepted signature for $t cert with $o"
+ ${SSHKEYGEN} -vvv -Y find-principals -s $OBJ/sshsig-crit.sig \
+ -f $OBJ/allowed_signers >/dev/null 2>&1 && \
+ fail "find-principals succeeded for $t cert with $o"
+ done
+
+ # Certificate requiring user verification that the signature lacks
+ # (the regress sk keys are enrolled without user verification)
+ case "$t" in
+ sk-*)
+ trace "$tid: key type $t verify cert with verify-required"
+ ${SSHKEYGEN} -q -s $CA_PRIV -I "critical" -O verify-required \
+ -n $sig_principal $OBJ/sigcrit.pub || \
+ fatal "couldn't sign ${t} with verify-required"
+ SSH_AUTH_SOCK=/nonexistent ${SSHKEYGEN} -q -Y sign \
+ -f $OBJ/sigcrit-cert.pub -n $sig_namespace \
+ < $DATA > $OBJ/sshsig-crit.sig 2>/dev/null || \
+ fail "sign using $t cert with verify-required failed"
+ ${SSHKEYGEN} -vvv -Y verify -s $OBJ/sshsig-crit.sig \
+ -n $sig_namespace -I $sig_principal \
+ -f $OBJ/allowed_signers < $DATA >/dev/null 2>&1 && \
+ fail "accepted signature for $t cert without user verification"
+ ;;
+ esac
+ rm -f $OBJ/sigcrit $OBJ/sigcrit.pub $OBJ/sigcrit-cert.pub
+
done
# Test key independant match-principals
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list