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

Re: how to (integrity) verify a whole git repo

From
Christoph Anton Mitterer <calestyo@scientia.net>
Date
Apr 21, 2020, 14:42 UTC
Message-ID
<be69ed1bade98cb7e414c2713fe0d6b5cadd7172.camel@scientia.net>
In-Reply-To
<20200421065301.GH96152@google.com>
Hey Jonathan.
On Mon, 2020-04-20 at 23:53 -0700, Jonathan Nieder wrote:
Show 5 quoted lines
> This happens automatically as part of fetch.  When you fetch, the
> objects' content is transfered over the wire but not their
> names.  The
> name of each object is a hash of its content.  Thus, whenever you
> address an object by its name, you are using its verified identity.

Okay maybe I wasn't clear enough :D (mixing up integrity and authenticity).

I'd guess that what you describe here is, that effectively the chain of all SHA1 hashes is computed when one does fetch, right?

But this alone doesn't guarantee cryptographic authenticity, e.g. as in "that's the kernel sources as released by Linus".

Show 5 quoted lines
> Tag and commit object content include the object ids for the objects
> they reference, so (assuming we are using a strong hash) their name
> is enough to verify all content reachable from them.
> 
> In other words, it's a Merkle tree.

And for (cryptographically) checking the authenticity of that tree, wouldn't I need to verify the signatures on it's leaves?

Taking again the kernel as an example: If I clone the repo (or fsck it later), than all I know is that there was no corruption, if the all the tips are correct, since they start the chain of hash sums to all other objects.

But an attacker could have just forged these tips. So for checking authenticity, I need to verify some signatures on them

Now if I check e.g. Linus signature on tag v5.6; I should know that everything earlier (in the tree, not chronologically) to that tag are authentic.

But not e.g. any commits on top of v.5.6 (which aren't either signed themselves or protected by another tag "above" them). Neither any commits never reached from v.5.6, e.g. later stable patches like anything from above v.5.5 (which is again below v.5.6) up to v.5.5.13, which is not.

So from my understanding, to use only commits that are authentic by the kernel upstream developers, I'd need verify all these tips.. and throw away everything which is not reachable by one of them.

Is that somehow possible?

Thanks, Chris.

Previous: Jonathan NiederNext: Konstantin Ryabitsev
Message 3 of 7 in “how to (integrity) verify a whole git repo”
  1. Christoph Anton MittererApr 21, 2020
  2. Jonathan NiederApr 21, 2020
  3. Christoph Anton MittererApr 21, 2020
  4. Konstantin RyabitsevApr 21, 2020
  5. Christoph Anton MittererApr 23, 2020
  6. Junio C HamanoApr 21, 2020
  7. Christoph Anton MittererApr 23, 2020

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.