• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..28-Jan-2021-

README.mdH A D28-Jan-20212.7 KiB5845

allow-incorrect-sha512-commitsH A D28-Jan-202182 32

allow-revsig-commitsH A D28-Jan-202120.2 KiB505504

allow-unclean-merge-commitsH A D28-Jan-2021164 54

gpg.shH A D28-Jan-20212.4 KiB6648

pre-push-hook.shH A D28-Jan-2021656 2215

trusted-git-rootH A D28-Jan-202141 21

trusted-keysH A D28-Jan-202182 32

trusted-sha512-root-commitH A D28-Jan-202141 21

verify-commits.pyH A D28-Jan-20218 KiB166124

README.md

1Tooling for verification of PGP signed commits
2----------------------------------------------
3
4This is an incomplete work in progress, but currently includes a pre-push hook
5script (`pre-push-hook.sh`) for maintainers to ensure that their own commits
6are PGP signed (nearly always merge commits), as well as a Python 3 script to verify
7commits against a trusted keys list.
8
9
10Using verify-commits.py safely
11------------------------------
12
13Remember that you can't use an untrusted script to verify itself. This means
14that checking out code, then running `verify-commits.py` against `HEAD` is
15_not_ safe, because the version of `verify-commits.py` that you just ran could
16be backdoored. Instead, you need to use a trusted version of verify-commits
17prior to checkout to make sure you're checking out only code signed by trusted
18keys:
19
20 ```sh
21 git fetch origin && \
22 ./contrib/verify-commits/verify-commits.py origin/master && \
23 git checkout origin/master
24 ```
25
26Note that the above isn't a good UI/UX yet, and needs significant improvements
27to make it more convenient and reduce the chance of errors; pull-reqs
28improving this process would be much appreciated.
29
30Configuration files
31-------------------
32
33* `trusted-git-root`: This file should contain a single git commit hash which is the first unsigned git commit (hence it is the "root of trust").
34* `trusted-sha512-root-commit`: This file should contain a single git commit hash which is the first commit without a SHA512 root commitment.
35* `trusted-keys`: This file should contain a \n-delimited list of all PGP fingerprints of authorized commit signers (primary, not subkeys).
36* `allow-revsig-commits`: This file should contain a \n-delimited list of git commit hashes. See next section for more info.
37
38Import trusted keys
39-------------------
40In order to check the commit signatures, you must add the trusted PGP keys to your machine. [GnuPG](https://gnupg.org/) may be used to import the trusted keys by running the following command:
41
42```sh
43gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys $(<contrib/verify-commits/trusted-keys)
44```
45
46Key expiry/revocation
47---------------------
48
49When a key (or subkey) which has signed old commits expires or is revoked,
50verify-commits will start failing to verify all commits which were signed by
51said key. In order to avoid bumping the root-of-trust `trusted-git-root`
52file, individual commits which were signed by such a key can be added to the
53`allow-revsig-commits` file. That way, the PGP signatures are still verified
54but no new commits can be signed by any expired/revoked key. To easily build a
55list of commits which need to be added, verify-commits.py can be edited to test
56each commit with BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG set to both 1 and 0, and
57those which need it set to 1 printed.
58