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

Re: Commit SHA1 == SHA1 checksum?

From
Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Date
Feb 7, 2022, 13:32 UTC
Message-ID
<20220207133244.kpyczjsxriepjtdt@meerkat.local>
In-Reply-To
<xmqqee4fix0l.fsf@gitster.g>
On Sun, Feb 06, 2022 at 12:02:34PM -0800, Junio C Hamano wrote:
Show 12 quoted lines
> Philip Oakley <philipoakley@iee.email> writes:
> 
> > I think part of Todd's question was how the tag and uncompressed archive
> > 'checksums' (e.g. hashes) relate to each other and where those
> > guarantees come from.
> 
> There is no such linkage, and there are no guarantees.  The trust
> you may or may not have on the PGP key that signs the tag and the
> checksums of the tarball is the only source of such assurance.
> 
> More importantly, I do not think there can be any such linkage
> between the Git tree and release tarball:

Hmm... I've actually considered writing a tool that would verify whether a tarball corresponds to a signed tag/commit. It should be entirely possible, no?

1. list all the files in the tar archive and calculate their hashes
2. use that info to rebuild blob and tree hashes all the way to the top of
   the archive tree
3. verify the signature on the git tag and obtain the corresponding tree hash
4. compare the in-git tree hash with your calculated archive tree hash

It would be slow, but it would be perfectly workable. I didn't end up writing that tool mostly because if you already have a git tree to run "git verify-tag", then you might as well just run "git archive". :)

The only cases where doing the above would make sense would be specifically for forensic/verification purposes.

-K
Previous: Gamblin, ToddNext: Junio C Hamano
Message 12 of 19 in “Commit SHA1 == SHA1 checksum?”
  1. Gamblin, ToddFeb 5, 2022
  2. Philip OakleyFeb 6, 2022
  3. Gamblin, ToddFeb 6, 2022
  4. Johannes SixtFeb 6, 2022
  5. Junio C HamanoFeb 6, 2022
  6. Philip OakleyFeb 6, 2022
  7. Junio C HamanoFeb 6, 2022
  8. Philip OakleyFeb 6, 2022
  9. Gamblin, ToddFeb 7, 2022
  10. Konstantin RyabitsevFeb 7, 2022
  11. Gamblin, ToddFeb 7, 2022
  12. Konstantin RyabitsevFeb 7, 2022
  13. Junio C HamanoFeb 7, 2022
  14. Konstantin RyabitsevFeb 7, 2022
  15. Gamblin, ToddFeb 7, 2022
  16. Konstantin RyabitsevFeb 7, 2022
  17. Gamblin, ToddFeb 8, 2022
  18. Junio C HamanoFeb 7, 2022
  19. Konstantin RyabitsevFeb 7, 2022

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.