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

Re: [PATCH 1/1] verify-tag/verify-commit should exit unsuccessfully when signature is not trusted

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Aug 10, 2018, 02:27 UTC
Message-ID
<20180810022749.GA70480@genre.crustytoothpaste.net>
In-Reply-To
<xmqqy3dfbcys.fsf@gitster-ct.c.googlers.com>
On Thu, Aug 09, 2018 at 11:40:27AM -0700, Junio C Hamano wrote:
Show 33 quoted lines
> -- >8 --
> Subject: [PATCH] gpg-interface: propagate exit status from gpg back to the callers
> 
> When gpg-interface API unified support for signature verification
> codepaths for signed tags and signed commits in mid 2015 at around
> v2.6.0-rc0~114, we accidentally loosened the GPG signature
> verification.
> 
> Before that change, signed commits were verified by looking for
> "G"ood signature from GPG, while ignoring the exit status of "gpg
> --verify" process, while signed tags were verified by simply passing
> the exit status of "gpg --verify" through.  The unified code we
> currently have ignores the exit status of "gpg --verify" and returns
> successful verification when the signature matches an unexpired key
> regardless of the trust placed on the key (i.e. in addition to "G"ood
> ones, we accept "U"ntrusted ones).
> 
> Make these commands signal failure with their exit status when
> underlying "gpg --verify" (or the custom command specified by
> "gpg.program" configuration variable) does so.  This essentially
> changes their behaviour in a backward incompatible way to reject
> signatures that have been made with untrusted keys even if they
> correctly verify, as that is how "gpg --verify" behaves.
> 
> Note that the code still overrides a zero exit status obtained from
> "gpg" (or gpg.program) if the output does not say the signature is
> good or computes correctly but made with untrusted keys, to catch
> a poorly written wrapper around "gpg" the user may give us.
> 
> We could exclude "U"ntrusted support from this fallback code, but
> that would be making two backward incompatible changes in a single
> commit, so let's avoid that for now.  A follow-up change could do so
> if desired.
This looks great to me.  Thanks.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Jeff KingNext: Vojtech Myslivec
Message 17 of 19 in “verify-tag/verify-commit should exit unsuccessfully when signature is not trusted”
  1. 1/1 verify-tag/verify-commit should exit unsuccessfully when signature is not trustedVojtech Myslivec, Jul 31, 2018
  2. brian m. carlsonAug 1, 2018
  3. Santiago TorresAug 1, 2018
  4. Karel KočíAug 3, 2018
  5. Santiago TorresAug 3, 2018
  6. Jeff KingAug 3, 2018
  7. Karel KočíAug 4, 2018
  8. Jeff KingAug 8, 2018
  9. brian m. carlsonAug 8, 2018
  10. Junio C HamanoAug 9, 2018
  11. brian m. carlsonAug 9, 2018
  12. Jeff KingAug 9, 2018
  13. Junio C HamanoAug 9, 2018
  14. Jeff KingAug 9, 2018
  15. Junio C HamanoAug 9, 2018
  16. Jeff KingAug 9, 2018
  17. brian m. carlsonAug 10, 2018
  18. Vojtech MyslivecAug 13, 2018
  19. Junio C HamanoAug 3, 2018

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.