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

Re: [PATCH 3/3] verify-commit: scriptable commit signature verification

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 30, 2014, 06:14 UTC
Message-ID
<xmqqzjguzzxo.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140628003246.GA13228@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> First off, I agree that "verify-tag" is probably not the right place.
> There _is_ no tag object to verify anymore (the only reason it is a tag
> at all is that the signature came out of what once was a tag).

Yes, if we imagine that the header were called "mergesig", it may be more apparent what it is. Similar to the commit signature itself (which gives GPG protection over the commit itself), a "mergesig" covers one of the parent commit object name recorded in the commit.

You could look at it as one aspect of the child commit object being verified, and that is why I would suggest it is the responsibility of verify-commit that is run on the child commit (I saw suggestions to verify other aspects such as "author ident matches the GPG signer of the signature on the commit itself", etc.)

Show 16 quoted lines
> Let us imagine that we have a "verify-commit" that verifies commit
> signatures made by "commit -S". If I run "verify-commit foo", that
> implies to me two things:
>
>   1. I am verifying the signature over the contents of "foo".
>
>      But the mergetag is _not_ a statement about "foo"; the person who
>      signed it never saw "foo". It is a statement about foo^2 at best,
>      or possibly about the whole history of foo^1..foo^2.
>
>   2. I am verifying _only_ the contents of foo. That is, I expect people
>      to use "commit -S" to cryptographically claim authorship of a
>      commit. Whereas with tags, I think we have typically taken them to
>      mean "I have signed the tip of a segment of history, and I am
>      taking responsibility for the final state" (e.g., signing release
>      tags).

I think you are making it too hard ;-). Fundamentally, a signature on a commit object itself _can_ be used to attest _some_ property about the whole history behind it by the signer, but it does not prevent a project from adopting a lot looser convention. If a project's stance is "commit signature in this project is about the contents of the tree" (i.e. the signer does not have much confidence in his memory on how he got there), the result from verify-commit on the signature of the commit itself should be interpreted in the context of such a project as such---the signer is confident that the tree matches what he signed and the signature wouldn't mean any more than that.

>      I realize that this claim is somewhat tenuous. It's not something
>      inherent in the crypto, but rather in the social convention of what
>      it means to sign a commit.
Yup, I think we are on the same page.
>      But I would ask, then: what
>      is the point of signing a commit versus signing a tag?  I think
>      that people who wanted commit signatures wanted them to give a
>      stronger guarantee of authorship of individual commits.
There are practical concerns.
 - tags are easier to manage because you can make a commit, give it
   out for trials by guinea pigs and then after it proves good, you
   can add a signed tag after the fact without rewriting the commit
   itself.  Incidentally, this is the primary reason behind the
   design of mergetags that were introduced after the k.org break-in
   fiasco.
   Theoretically you could have argued that lieutenants can sign the
   commits they want Linus to pull and we wouldn't have had to add
   anything to the system to support the new "not only we can use
   third-party publishing sites that we do not know how much we can
   trust, such as GitHub, we do not even have to trust k.org blindly"
   workflow.  But they really wanted to be able to commit first,
   let time pass and then sign to request pulling.
 - tags are a lot more cumbersome if you want to sign each and every
   commit (which some of us view as pointless, given the chain of
   SHA-1 hashes our history storage is based on), because you end up
   having to name, keep and transfer O(n) refs to represent them for
   the history of project of size n.  Embedding signature in each
   commit would be the only workable way if somebody wants to sign
   each and every commit.
>      Git has largely stayed agnostic about what such signatures mean.
>      But if we accept that some projects _are_ going to make that
>      distinction, I think conflating verification of the two within the
>      same command leads to a potential for confusion.

I agree that the users and scripts must be able to inspect the validity of "gpgsig" and "mergetag"(s) separately. When you inspect a merge commit, if gpgsig verifies but mergetag does not, we know that the integrator created and signed the merge but we do not know if the lieutenant whose name appears on the mergetag really asked the side branch to be pulled, or if the merge was made in response to a request by an imposter. For that matter, when verifying an octopus merge, we must be able to see the validity of "mergetag" for each parent separately. We can do that by having two separate commands (one to verify "gpgsig", the other to verify "mergetag"), or we can do that with a separate command line options to a single command ("verify-commit --gpgsig" and "verify-commit --mergsig <n>") or a single "verify-commit" may report multi-values to its output for scripts to parse. I do not have a strong opinion.

Previous: Jeff KingNext: Michael J Gruber
Message 27 of 75 in “verify-commit: verify commit signatures”
  1. 0/3 verify-commit: verify commit signaturesMichael J Gruber, Jun 6, 2014
  2. 1/3 pretty: free the gpg status bufMichael J Gruber, Jun 6, 2014
  3. 2/3 gpg-interface: provide access to the payloadMichael J Gruber, Jun 6, 2014
  4. Jeff KingJun 13, 2014
  5. Michael J GruberJun 13, 2014
  6. Jeff KingJun 13, 2014
  7. 3/3 verify-commit: scriptable commit signature verificationMichael J Gruber, Jun 6, 2014
  8. Michael J GruberJun 11, 2014
  9. Jeff KingJun 13, 2014
  10. Michael J GruberJun 13, 2014
  11. Jeff KingJun 13, 2014
  12. Junio C HamanoJun 13, 2014
  13. Michael J GruberJun 16, 2014
  14. Jeff KingJun 16, 2014
  15. Junio C HamanoJun 16, 2014
  16. Jeff KingJun 16, 2014
  17. Michael J GruberJun 27, 2014
  18. Michael J GruberJun 27, 2014
  19. Michael J GruberJun 27, 2014
  20. log: correctly identify mergetag signature verification statusMichael J Gruber, Jun 27, 2014
  21. Jeff KingJun 28, 2014
  22. Junio C HamanoJul 10, 2014
  23. Michael J GruberJun 27, 2014
  24. Junio C HamanoJun 27, 2014
  25. Junio C HamanoJun 27, 2014
  26. Jeff KingJun 28, 2014
  27. Junio C HamanoJun 30, 2014
  28. 0/6 verify-commit: verify commit signaturesMichael J Gruber, Jun 13, 2014
  29. 0/5 verify-commit: verify commit signaturesMichael J Gruber, Jun 23, 2014
  30. Jeff KingJun 23, 2014
  31. Junio C HamanoJun 23, 2014
  32. Jeff KingJun 23, 2014
  33. Junio C HamanoJun 23, 2014
  34. 0/4 verify-commit: verify commit signaturesMichael J Gruber, Jun 27, 2014
  35. Junio C HamanoJun 27, 2014
  36. Jeff KingJun 28, 2014
  37. Jeff KingJun 28, 2014
  38. 1/4 gpg-interface: provide clear helper for struct signature_checkMichael J Gruber, Jun 27, 2014
  39. 2/4 gpg-interface: provide access to the payloadMichael J Gruber, Jun 27, 2014
  40. 3/4 verify-commit: scriptable commit signature verificationMichael J Gruber, Jun 27, 2014
  41. 4/4 t7510: test verify-commitMichael J Gruber, Jun 27, 2014
  42. Junio C HamanoJun 27, 2014
  43. Michael J GruberJun 27, 2014
  44. 1/5 gpg-interface: provide clear helper for struct signature_checkMichael J Gruber, Jun 23, 2014
  45. 2/5 gpg-interface: provide access to the payloadMichael J Gruber, Jun 23, 2014
  46. 3/5 verify-commit: scriptable commit signature verificationMichael J Gruber, Jun 23, 2014
  47. 4/5 t7510: exit for loop with test resultMichael J Gruber, Jun 23, 2014
  48. 5/5 t7510: test verify-commitMichael J Gruber, Jun 23, 2014
  49. Junio C HamanoJun 23, 2014
  50. 1/6 pretty: free the gpg status bufMichael J Gruber, Jun 13, 2014
  51. Jeff KingJun 13, 2014
  52. 2/6 gpg-interface: provide access to the payloadMichael J Gruber, Jun 13, 2014
  53. 3/6 verify-commit: scriptable commit signature verificationMichael J Gruber, Jun 13, 2014
  54. Jeff KingJun 13, 2014
  55. Michael J GruberJun 13, 2014
  56. Jeff KingJun 13, 2014
  57. Michael J GruberJun 13, 2014
  58. 4/6 t7510: exit for loop with test resultMichael J Gruber, Jun 13, 2014
  59. Jeff KingJun 13, 2014
  60. Michael J GruberJun 13, 2014
  61. Michael J GruberJun 13, 2014
  62. Michael J GruberJun 13, 2014
  63. Jeff KingJun 13, 2014
  64. Johannes SixtJun 13, 2014
  65. Michael J GruberJun 13, 2014
  66. Johannes SixtJun 13, 2014
  67. Jeff KingJun 13, 2014
  68. Michael J GruberJun 13, 2014
  69. Johannes SixtJun 13, 2014
  70. Junio C HamanoJun 13, 2014
  71. 5/6 t7510: test verify-commitMichael J Gruber, Jun 13, 2014
  72. Jeff KingJun 13, 2014
  73. Michael J GruberJun 13, 2014
  74. Junio C HamanoJun 13, 2014
  75. 6/6 gpg-interface: provide clear helper for struct signature_checkMichael J Gruber, Jun 13, 2014

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.