git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v8 5/6] verify-tag: move tag verification code to tag.c

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 22, 2016, 17:19 UTC
Message-ID
<CAPig+cSXoVeiHsq1m7Ng_+fP0bY3eR20jJqCmTwUF5a1C-F=LA@mail.gmail.com>
In-Reply-To
<1461336725-29915-6-git-send-email-santiago@nyu.edu>
On Fri, Apr 22, 2016 at 10:52 AM,  <santiago@nyu.edu> wrote:
Show 12 quoted lines
> The PGP verification routine for tags could be accessed by other modules
> that require to do so.
>
> Publish the verify_tag function in tag.c and rename it to gpg_verify_tag
> so it does not conflict with builtin/mktag's static function.
>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Santiago Torres <santiago@nyu.edu>
> ---
> diff --git a/tag.c b/tag.c
> @@ -6,6 +6,59 @@
> +int gpg_verify_tag(const unsigned char *sha1, const char *name_to_report,
Nit: This line has trailing whitespace. Probably not worth a re-roll.
Show 27 quoted lines
> +               unsigned flags)
> +{
> +       enum object_type type;
> +       char *buf;
> +       unsigned long size;
> +       int ret;
> +
> +       type = sha1_object_info(sha1, NULL);
> +       if (type != OBJ_TAG)
> +               return error("%s: cannot verify a non-tag object of type %s.",
> +                               name_to_report ?
> +                               name_to_report :
> +                               find_unique_abbrev(sha1, DEFAULT_ABBREV),
> +                               typename(type));
> +
> +       buf = read_sha1_file(sha1, &type, &size);
> +       if (!buf)
> +               return error("%s: unable to read file.",
> +                               name_to_report ?
> +                               name_to_report :
> +                               find_unique_abbrev(sha1, DEFAULT_ABBREV));
> +
> +       ret = run_gpg_verify(buf, size, flags);
> +
> +       free(buf);
> +       return ret;
> +}
Previous: santiago@nyu.eduNext: santiago@nyu.edu
Message 7 of 9 in “Move PGP verification out of verify-tag”
  1. 0/6 Move PGP verification out of verify-tagsantiago@nyu.edu, Apr 22, 2016
  2. 1/6 builtin/verify-tag.c: ignore SIGPIPE in gpg-interfacesantiago@nyu.edu, Apr 22, 2016
  3. 2/6 t7030: test verifying multiple tagssantiago@nyu.edu, Apr 22, 2016
  4. 3/6 verify-tag: update variable name and typesantiago@nyu.edu, Apr 22, 2016
  5. 4/6 verify-tag: prepare verify_tag for libificationsantiago@nyu.edu, Apr 22, 2016
  6. 5/6 verify-tag: move tag verification code to tag.csantiago@nyu.edu, Apr 22, 2016
  7. Eric SunshineApr 22, 2016
  8. 6/6 tag -v: verify directly rather than exec-ing verify-tagsantiago@nyu.edu, Apr 22, 2016
  9. Eric SunshineApr 22, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.