Re: [PATCH 1/5] t/t7004-tag: test handling of rfc1991 signatures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano venit, vidit, dixit 09.11.2010 18:17:
> Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx> writes:
> 
>> Currently, git expects "-----BEGIN PGP SIGNATURE-----" at the beginning of a
>> signature. But gpg uses "MESSAGE" instead of "SIGNATURE" when used with
>> the "rfc1991" option. This leads to git's failing to verify it's own
>> signed tags, among other problems.
>>
>> Add tests for all code paths (tag -v, tag -l -n largenumber, tag -f
>> without -m) where signature detection matters.
>>
>> Reported-by: Stephan Hugel <urschrei@xxxxxxxxx>
>> Signed-off-by: Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx>
>> ---
>>  t/t7004-tag.sh |   43 +++++++++++++++++++++++++++++++++++++++++++
>>  1 files changed, 43 insertions(+), 0 deletions(-)
>>
>> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
>> index ac943f5..22dcc45 100755
>> --- a/t/t7004-tag.sh
>> +++ b/t/t7004-tag.sh
>> @@ -1030,6 +1030,49 @@ test_expect_success GPG \
>>  	test_cmp expect actual
>>  '
>>  
>> +# usage with rfc1991 signatures
>> +echo "rfc1991" > gpghome/gpg.conf
>> +get_tag_header rfc1991-signed-tag $commit commit $time >expect
>> +echo "RFC1991 signed tag" >>expect
>> +echo '-----BEGIN PGP MESSAGE-----' >>expect
>> +test_expect_success GPG \
>> +	'creating a signed tag with rfc1991' '
>> +	git tag -s -m "RFC1991 signed tag" rfc1991-signed-tag $commit &&
>> +	get_tag_msg rfc1991-signed-tag >actual &&
>> +	test_cmp expect actual
>> +'
>> +
>> +cat >fakeeditor <<'EOF'
>> +#!/bin/sh
>> +cp "$1" actual
>> +EOF
>> +chmod +x fakeeditor
>> +
>> +test_expect_failure GPG \
>> +...
>> +'
>> +
>> +rm -f gpghome/gpg.conf
> 
> Shouldn't this line be placed much earlier in the sequence, to make sure
> that people without --rfc1991 can grok new style signatures?  Better yet,
> shouldn't the script test rfc1991-signed tags both with and without the
> rfc1991 configuration?

The --rfc1991 option matters for the creation of signatures only, not
for the verification (and neither for display/listing with git, of course).

Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]