Skip to content

Commit c9a3cc7

Browse files
committed
test -Oprint-pubkey
1 parent 4d8c818 commit c9a3cc7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

regress/usr.bin/ssh/sshsig.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $OpenBSD: sshsig.sh,v 1.6 2021/07/23 03:54:55 djm Exp $
1+
# $OpenBSD: sshsig.sh,v 1.7 2021/08/11 08:55:04 djm Exp $
22
# Placed in the Public Domain.
33

44
tid="sshsig"
@@ -64,6 +64,17 @@ for t in $SIGNKEYS; do
6464
< $DATA >/dev/null 2>&1 || \
6565
fail "failed signature for $t key w/ limited namespace"
6666

67+
(printf "$sig_principal namespaces=\"$sig_namespace,whatever\" ";
68+
cat $pubkey) > $OBJ/allowed_signers
69+
${SSHKEYGEN} -q -Y verify -s $sigfile -n $sig_namespace \
70+
-I $sig_principal -f $OBJ/allowed_signers \
71+
-O print-pubkey \
72+
< $DATA | cut -d' ' -f1-2 > ${OBJ}/${keybase}-fromsig.pub || \
73+
fail "failed signature for $t key w/ print-pubkey"
74+
cut -d' ' -f1-2 ${OBJ}/${keybase}.pub > ${OBJ}/${keybase}-strip.pub
75+
diff -r ${OBJ}/${keybase}-strip.pub ${OBJ}/${keybase}-fromsig.pub || \
76+
fail "print-pubkey differs from signature key"
77+
6778
# Invalid option
6879
(printf "$sig_principal octopus " ; cat $pubkey) > $OBJ/allowed_signers
6980
${SSHKEYGEN} -vvv -Y verify -s $sigfile -n $sig_namespace \

0 commit comments

Comments
 (0)