Skip to content

Commit ad5dfea

Browse files
peffgitster
authored andcommitted
t7030: stop using invalid tag name
We intentionally invalidate the signature of a tag by switching its tag name from "seventh" to "7th forged". However, the latter is not a valid tag name because it contains a space. This doesn't currently affect the test, but we're better off using something syntactically valid. That reduces the number of possible failure modes in the test, and future-proofs us if git hash-object gets more picky about its input. The t7031 script, which was mostly copied from t7030, has the same problem, so we'll fix it, too. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 61cc4be commit ad5dfea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

t/t7030-verify-tag.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ test_expect_success GPGSM 'verify and show signatures x509 with high minTrustLev
115115

116116
test_expect_success GPG 'detect fudged signature' '
117117
git cat-file tag seventh-signed >raw &&
118-
sed -e "/^tag / s/seventh/7th forged/" raw >forged1 &&
118+
sed -e "/^tag / s/seventh/7th-forged/" raw >forged1 &&
119119
git hash-object -w -t tag forged1 >forged1.tag &&
120120
test_must_fail git verify-tag $(cat forged1.tag) 2>actual1 &&
121121
grep "BAD signature from" actual1 &&

t/t7031-verify-tag-signed-ssh.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'verify-tag failes with tag date ou
125125
test_expect_success GPGSSH 'detect fudged ssh signature' '
126126
test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
127127
git cat-file tag seventh-signed >raw &&
128-
sed -e "/^tag / s/seventh/7th forged/" raw >forged1 &&
128+
sed -e "/^tag / s/seventh/7th-forged/" raw >forged1 &&
129129
git hash-object -w -t tag forged1 >forged1.tag &&
130130
test_must_fail git verify-tag $(cat forged1.tag) 2>actual1 &&
131131
grep "${GPGSSH_BAD_SIGNATURE}" actual1 &&

0 commit comments

Comments
 (0)