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

Re: How safe are signed git tags? Only as safe as SHA-1 or somehow safer?

From
Jeff King <peff@peff.net>
Date
Nov 24, 2014, 15:51 UTC
Message-ID
<20141124155108.GC25912@peff.net>
In-Reply-To
<54730546.7000200@drmicha.warpmail.net>
On Mon, Nov 24, 2014 at 11:15:34AM +0100, Michael J Gruber wrote:
Show 8 quoted lines
> > I wonder if we can have an option to sign all blob content of the tree
> > associated to a commit, and the content of parent commit(s). It's more
> > expensive than signing just commit/tag content. But it's also safer
> > without completely ditching SHA-1.
> > 
> 
> This amounts to hashing the blob content with whatever hash you told
> your gpg to use (hopefully not sha1 ;) ) and signing that.

Right. You could also create a graph of SHA-256 (or whatever) object hashes and sign that. I.e., create a parallel to git's trees using SHA-256 and include a single:

  object-256 ....

line in the tag header. That still involves re-hashing all of the data, but it would at least be possible to cache (i.e., a mapping of SHA-1 to SHA-256 hashes). Of course one way to keep that caching layer up to date would be to just calculate the SHA-256 along with the SHA-1 whenever we create an object. And then you can sprinkle SHA-256 links in other places, too, like commit objects.

And now you are halfway down the road to a combined SHA-1/SHA-256 git. :)

The tricky thing is fitting the extra hash into the tree objects. And of course the rules for actually generating and/or sending extra objects.

-Peff
Previous: Duy NguyenNext: Nico Williams
Message 12 of 21 in “How safe are signed git tags? Only as safe as SHA-1 or somehow safer?”
  1. Patrick SchleizerNov 16, 2014
  2. Jeff KingNov 17, 2014
  3. Patrick SchleizerNov 21, 2014
  4. Jason PyeronNov 21, 2014
  5. Jeff KingNov 22, 2014
  6. Jeff KingNov 22, 2014
  7. Fedor BrunnerNov 25, 2014
  8. Duy NguyenNov 24, 2014
  9. Michael J GruberNov 24, 2014
  10. Duy NguyenNov 24, 2014
  11. Duy NguyenNov 25, 2014
  12. Jeff KingNov 24, 2014
  13. Nico WilliamsNov 24, 2014
  14. Duy NguyenNov 25, 2014
  15. Jonathan NiederNov 25, 2014
  16. Duy NguyenNov 25, 2014
  17. Stefan BellerNov 25, 2014
  18. Jeff KingNov 25, 2014
  19. Duy NguyenNov 25, 2014
  20. Junio C HamanoNov 25, 2014
  21. brian m. carlsonNov 25, 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.