Code

tag: recognize rfc1991 signatures
[git.git] / tag.c
diff --git a/tag.c b/tag.c
index d4f3080e3f8c3d8026292a2eeccc17152b404254..f789744ccaf5d5fb6f63ba0911a869492affc162 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -5,6 +5,7 @@
 #include "blob.h"
 
 #define PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----"
+#define PGP_MESSAGE "-----BEGIN PGP MESSAGE-----"
 
 const char *tag_type = "tag";
 
@@ -140,7 +141,8 @@ size_t parse_signature(const char *buf, unsigned long size)
 {
        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;
        }