Gentoo Archives: gentoo-dev

From: Rich Freeman <rich0@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] git security (SHA-1)
Date: Tue, 16 Sep 2014 14:03:12
Message-Id: CAGfcS_k+Y0nB_ggX6yCDK4tNjX-f-bu5bbNoUUDeh83wBcM8Dg@mail.gmail.com
In Reply to: Re: [gentoo-dev] git security (SHA-1) by Ian Stakenvicius
1 On Tue, Sep 16, 2014 at 9:44 AM, Ian Stakenvicius <axs@g.o> wrote:
2 >
3 > If the issue preventing protection is that the gpg signature only
4 > signs the hash, couldn't we just make repoman automatically add to the
5 > bottom of the comment a clearsign on the contents of the commit?
6 >
7
8 The gpg signature is on the entire contents of the "commit." However,
9 the contents of the commit do not include the files that are being
10 committed - it includes hashes of the parent commit, the commit
11 message, other headers, and the hash of the tree being committed,
12 which is sha1. That last hash is the only thing that ties the commit
13 to the files being committed, so you can modify the files all you like
14 as long as the sha1 is the same.
15
16 I don't think we should try to fix git. It makes far more sense to
17 have upstream fix it. I don't think we should hold up the migration
18 over it - NOBODY is holding off on adopting git over this stuff and
19 I'm not even aware of any projects that gpg sign their git commits.
20
21 Remember, the data model is:
22 commit --> tree --> [tree...] --> blob
23 The signature is against the commit, and sha1 hashes are what tie
24 everything else to it.
25
26 If you want to satisfy yourself I believe you can get git to dump the
27 contents of any object without formatting/etc. You'll see that the
28 gpg signature matches the content of the commit (minus the gpg
29 signature header, of course). If you directly access objects from the
30 filesystem I think git prepends a hash or something to the start of
31 every file.
32
33 --
34 Rich

Replies

Subject Author
Re: [gentoo-dev] git security (SHA-1) Michael Orlitzky <mjo@g.o>
Re: [gentoo-dev] git security (SHA-1) Peter Stuge <peter@×××××.se>