1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-17 23:03:29 +02:00

Use awk instead of cut to help -portable.

Some platforms have size limits on cut.
This commit is contained in:
dtucker
2026-06-16 10:58:42 +00:00
parent b13c09525e
commit 50d94f9ab6
+4 -4
View File
@@ -1,4 +1,4 @@
# $OpenBSD: sshsig.sh,v 1.16 2025/09/11 07:23:32 djm Exp $
# $OpenBSD: sshsig.sh,v 1.17 2026/06/16 10:58:42 dtucker Exp $
# Placed in the Public Domain.
tid="sshsig"
@@ -86,10 +86,10 @@ for t in $SIGNKEYS; do
cat $pubkey) > $OBJ/allowed_signers
${SSHKEYGEN} -q -Y verify -s $sigfile -n $sig_namespace \
-I $sig_principal -f $OBJ/allowed_signers \
-O print-pubkey \
< $DATA | cut -d' ' -f1-2 > ${OBJ}/${keybase}-fromsig.pub || \
-O print-pubkey < $DATA | \
awk '{print $1" "$2}' >${OBJ}/${keybase}-fromsig.pub || \
fail "failed signature for $t key w/ print-pubkey"
cut -d' ' -f1-2 ${OBJ}/${keybase}.pub > ${OBJ}/${keybase}-strip.pub
awk '{print $1" "$2}' ${OBJ}/${keybase}.pub >${OBJ}/${keybase}-strip.pub
diff -r ${OBJ}/${keybase}-strip.pub ${OBJ}/${keybase}-fromsig.pub || \
fail "print-pubkey differs from signature key"