Skip to content

Verify GPG signatures when merging and extend %G? pretty string

Sebastian Götte git 6 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest5 patches 3 repliesIn review
  2. v75 patches 6 repliesSuperseded
  3. v65 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v55 patches10 repliesSuperseded
v45 patches4 repliesSuperseded
v24 patches1 replySuperseded

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Move commit GPG signature verification to commit.ccommit.c commit.h gpg-interface.h +1 more+93 -780 replies
2/5commit.c/GPG signature verification: Also look at the first GPG status linecommit.c+12 -50 replies
3/5merge/pull: verify GPG signatures of commits being mergedDocumentation/merge-options.txt builtin/merge.c git-pull.sh +1 more+96 -33 replies
4/5merge/pull Check for untrusted good GPG signaturesDocumentation/merge-options.txt builtin/merge.c commit.c +7 more+28 -120 replies
5/5pretty printing: extend %G? to include 'N' and 'U'Documentation/pretty-formats.txt pretty.c+4 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.

Read the v8 thread

Cover letter [PATCH v8 0/5] Verify GPG signatures when merging and extend %G? pretty string
Quoted 7 lines · Sebastian Götte
Quoted 7 lines
(quoted diff) +2 -4
+	/* Iterate over all search strings */
 	for (i = 0; i < ARRAY_SIZE(sigcheck_gpg_status); i++) {
-		const char *found = strstr(buf, sigcheck_gpg_status[i].check);
-		const char *next;
-		if (!found)
-			continue;
+		const char *found, *next;
Quoted 8 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+
+		if (!prefixcmp(buf, sigcheck_gpg_status[i].check + 1)) {
+			/* At the very beginning of the buffer */

This seems wrong. You're losing the "\n" in front of the status strings above but adding a special first line check skipping the first character. Surely it should be one of these changes or the other, not both?

You're right, that does not make a whole lot of sense.

Quoted 5 lines · John Keeping

Review

Quoted 1 line
(quoted diff) +1 -0
+		if (sigc->result != 'U') {

This could use a comment; we know now that only GOODSIG and BADSIG are followed by a signature, but someone looking at this code in the future will probably appreciate an explanation.

Fixed.

Sebastian Götte (5):
Move commit GPG signature verification to commit.c commit.c/GPG signature verification: Also look at the first GPG status
line
merge/pull: verify GPG signatures of commits being merged merge/pull Check for untrusted good GPG signatures
pretty printing: extend %G? to include 'N' and 'U'

 Documentation/merge-options.txt    |   5 ++
 Documentation/pretty-formats.txt   |   3 +-
 builtin/merge.c                    |  34 +++++++++++++-
 commit.c                           |  70 ++++++++++++++++++++++++++++
 commit.h                           |  10 ++++
 git-pull.sh                        |  10 +++-
 gpg-interface.h                    |  12 +++++
 pretty.c                           |  93 ++++++-------------------------------
 t/lib-gpg/pubring.gpg              | Bin 1164 -> 2359 bytes
 t/lib-gpg/random_seed              | Bin 600 -> 600 bytes
 t/lib-gpg/secring.gpg              | Bin 1237 -> 3734 bytes
 t/lib-gpg/trustdb.gpg              | Bin 1280 -> 1360 bytes
 t/t7612-merge-verify-signatures.sh |  61 ++++++++++++++++++++++++
 13 files changed, 216 insertions(+), 82 deletions(-)
 create mode 100755 t/t7612-merge-verify-signatures.sh
Signature · 1 line
1.8.1.5