summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 81536b2)
raw | patch | inline | side by side (parent: 81536b2)
author | Michael J Gruber <git@drmicha.warpmail.net> | |
Wed, 10 Nov 2010 11:17:30 +0000 (12:17 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 10 Nov 2010 17:40:35 +0000 (09:40 -0800) |
We have always been creating rfc1991 signatures for users with "rfc1991"
in their gpg config but failed to recognize them (tag -l -n largenumber)
and verify them (tag -v, verify-tag).
Make good use of the refactored signature detection and let us recognize
and verify those signatures also.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
in their gpg config but failed to recognize them (tag -l -n largenumber)
and verify them (tag -v, verify-tag).
Make good use of the refactored signature detection and let us recognize
and verify those signatures also.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7004-tag.sh | patch | blob | history | |
tag.c | patch | blob | history |
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index c7d49e1049eef666f93787af456f0beada542446..6841c23c0a276934928aed65aef4a55cb55370e1 100755 (executable)
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
EOF
chmod +x fakeeditor
-test_expect_failure GPG \
+test_expect_success GPG \
'reediting a signed tag body omits signature' '
echo "RFC1991 signed tag" >expect &&
GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&
test_cmp expect actual
'
-test_expect_failure GPG \
+test_expect_success GPG \
'verifying rfc1991 signature' '
git tag -v rfc1991-signed-tag
'
-test_expect_failure GPG \
+test_expect_success GPG \
'list tag with rfc1991 signature' '
echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
git tag -l -n1 rfc1991-signed-tag >actual &&
rm -f gpghome/gpg.conf
-test_expect_failure GPG \
+test_expect_success GPG \
'verifying rfc1991 signature without --rfc1991' '
git tag -v rfc1991-signed-tag
'
-test_expect_failure GPG \
+test_expect_success GPG \
'list tag with rfc1991 signature without --rfc1991' '
echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
git tag -l -n1 rfc1991-signed-tag >actual &&
test_cmp expect actual
'
-test_expect_failure GPG \
+test_expect_success GPG \
'reediting a signed tag body omits signature' '
echo "RFC1991 signed tag" >expect &&
GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&
index d4f3080e3f8c3d8026292a2eeccc17152b404254..f789744ccaf5d5fb6f63ba0911a869492affc162 100644 (file)
--- a/tag.c
+++ b/tag.c
#include "blob.h"
#define PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----"
+#define PGP_MESSAGE "-----BEGIN PGP MESSAGE-----"
const char *tag_type = "tag";
{
char *eol;
size_t len = 0;
- while (len < size && prefixcmp(buf + len, PGP_SIGNATURE)) {
+ while (len < size && prefixcmp(buf + len, PGP_SIGNATURE) &&
+ prefixcmp(buf + len, PGP_MESSAGE)) {
eol = memchr(buf + len, '\n', size - len);
len += eol ? eol - (buf + len) + 1 : size - len;
}