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

Re: [PATCH 2/2] push -s: skeleton

From
Jeff King <peff@peff.net>
Date
Sep 8, 2011, 19:35 UTC
Message-ID
<20110908193555.GC16064@sigill.intra.peff.net>
In-Reply-To
<7vbouw2hqg.fsf@alter.siamese.dyndns.org>
On Wed, Sep 07, 2011 at 01:57:27PM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> If a tag is GPG-signed, and if you trust the cryptographic robustness of
> the SHA-1 and GPG, you can guarantee that all the history leading to the
> signed commit is not tampered with. However, it would be both cumbersome
> and cluttering to sign each and every commit. Especially if you strive to
> keep your history clean by tweaking, rewriting and polishing your commits
> before pushing the resulting history out, many commits you will create
> locally end up not mattering at all, and it is a waste of time to sign
> them.
> 
> A better alternative could be to sign a "push certificate" (for the lack
> of better name) every time you push, asserting that what commits you are
> pushing to update which refs. The basic workflow goes like this:

I think this is the right direction, but I was a little turned off by the idea that it needs a protocol extension. As I see it, there are two ways to care about the contents of a push certificate:

  1. The server might care, because it only wants to accept pushes that
     are accompanied by a certificate matching a certain key.
  2. A client fetching from the server might care, because they want the
     integrity and authenticity of the data to be ensured by the gpg key
     of the pusher, not by trusting the server.

I think (1) is actually not all that interesting. The server already has credentials for each user via ssh or http. So it knows who each pusher is already. It can't relay that information cryptographically to a client who fetches later, of course, but we are just talking about whether or not to accept the push at this moment.

But if you really did want to do that, it seems like a pre-receive hook would be sufficient.

For (2), you don't want to trust the server, so the user's authentication to the server isn't enough. You want a cryptographic chain leading back to the original pusher. But the server doesn't actually need to see or understand that cryptographic chain for this purpose. If it were stored in a notes-tree or other format pointed to by a ref, then a client could pull down those notes and do the verification themselves.

Which means you can start using this immediately, without having to care about whether your hosting provider supports it or not (or even whether your provider supports the git protocol. Such a system would Just Work across dumb http, local clones, sneakernet bundles, etc).

The only issue I foresee is one of atomicity. IIRC, we never have a whole-repo lock during push, so it's possible that a client might succeed in pushing the ref with the certificate, but fail at one or more refs that the certificate mentions. And maybe a protocol extension is required for that. You've looked much more closely at this than I have, so maybe you already considered something simpler.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 20 of 26 in “send-pack: typofix error message”
  1. 1/2 send-pack: typofix error messageJunio C Hamano, Sep 7, 2011
  2. 2/2 push -s: skeletonJunio C Hamano, Sep 7, 2011
  3. Shawn PearceSep 7, 2011
  4. Junio C HamanoSep 7, 2011
  5. Shawn PearceSep 7, 2011
  6. Junio C HamanoSep 8, 2011
  7. Nguyen Thai Ngoc DuySep 7, 2011
  8. Junio C HamanoSep 7, 2011
  9. Robin H. JohnsonSep 7, 2011
  10. Jeff KingSep 8, 2011
  11. Robin H. JohnsonSep 9, 2011
  12. Joey HessSep 9, 2011
  13. Drew NorthupSep 9, 2011
  14. Jeff KingSep 9, 2011
  15. 3/2 Split GPG interface into its own helper libraryJunio C Hamano, Sep 8, 2011
  16. 4/2 push -s: send signed push certificateJunio C Hamano, Sep 8, 2011
  17. 5/2 push -s: receiving endJunio C Hamano, Sep 8, 2011
  18. Johan HerlandSep 8, 2011
  19. Junio C HamanoSep 8, 2011
  20. Jeff KingSep 8, 2011
  21. Junio C HamanoSep 8, 2011
  22. Jeff KingSep 8, 2011
  23. Junio C HamanoSep 8, 2011
  24. Jeff KingSep 9, 2011
  25. Junio C HamanoSep 9, 2011
  26. Jeff KingSep 9, 2011

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.