X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fverify-tag.c;h=313476604967bb2962350c82d45ffad04eab09e1;hb=3fc44a10f62fdca29558dc553a3e12949af30637;hp=8136dba7a1a43bf90cd213a30a7f1a57a1248ac3;hpb=0b0cd0e0a29a139f418991dd769ea4266ffec370;p=git.git diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c index 8136dba7a..313476604 100644 --- a/builtin/verify-tag.c +++ b/builtin/verify-tag.c @@ -17,13 +17,11 @@ static const char * const verify_tag_usage[] = { NULL }; -#define PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----" - static int run_gpg_verify(const char *buf, unsigned long size, int verbose) { struct child_process gpg; const char *args_gpg[] = {"gpg", "--verify", "FILE", "-", NULL}; - char path[PATH_MAX], *eol; + char path[PATH_MAX]; size_t len; int fd, ret; @@ -37,11 +35,7 @@ static int run_gpg_verify(const char *buf, unsigned long size, int verbose) close(fd); /* find the length without signature */ - len = 0; - while (len < size && prefixcmp(buf + len, PGP_SIGNATURE)) { - eol = memchr(buf + len, '\n', size - len); - len += eol ? eol - (buf + len) + 1 : size - len; - } + len = parse_signature(buf, size); if (verbose) write_in_full(1, buf, len);