Re: [PATCH 8/8] gpg-interface: handle alternative signature types

2018-05-03 Thread Ben Toews
On Tue, Apr 17, 2018 at 12:33 PM, Taylor Blau <m...@ttaylorr.com> wrote: > > On Tue, Apr 17, 2018 at 12:08:20PM -0600, Ben Toews wrote: > > On Mon, Apr 16, 2018 at 7:54 PM, Junio C Hamano <gits...@pobox.com> wrote: > > > "brian m. carlson" <sand...@cr

Re: [PATCH 8/8] gpg-interface: handle alternative signature types

2018-04-17 Thread Ben Toews
On Mon, Apr 16, 2018 at 7:54 PM, Junio C Hamano wrote: > "brian m. carlson" writes: > >> If we just want to add gpgsm support, that's fine, but we should be >> transparent about that fact and try to avoid making an interface which >> is at once

[PATCH v2 6/9] gpg-interface: extract gpg line matching helper

2018-04-13 Thread Ben Toews
From: Jeff King <p...@peff.net> Let's separate the actual line-by-line parsing of signatures from the notion of "is this a gpg signature line". That will make it easier to do more refactoring of this loop in future patches. Signed-off-by: Jeff King <p...@peff.net> Si

[PATCH v2 7/9] gpg-interface: find the last gpg signature line

2018-04-13 Thread Ben Toews
nature block, meaning we may be confused by a signature (or a signature-like line) in the actual body. Let's keep parsing and always find the final block, which should be the detached signature over all of the preceding content. Signed-off-by: Jeff King <p...@peff.net> Signed-off-by: Ben To

[PATCH v2 9/9] gpg-interface: handle alternative signature types

2018-04-13 Thread Ben Toews
to offer support for more exotic tools (e.g., people have asked before on the list about using OpenBSD signify). Signed-off-by: Ben Toews <mastahy...@gmail.com> --- Documentation/config.txt | 42 +--- builtin/fmt-merge-msg.c | 6 +- builtin/receive-pack.c | 7 +- builtin/t

[PATCH v2 2/9] gpg-interface: handle bool user.signingkey

2018-04-13 Thread Ben Toews
future patch, we'll leave it alone for now. We will add some whitespace and returns in preparation for adding more config keys, though. Signed-off-by: Jeff King <p...@peff.net> Signed-off-by: Ben Toews <mastahy...@gmail.com> --- gpg-interface.c | 6 ++ 1 file changed, 6 inserti

[PATCH v2 3/9] gpg-interface: modernize function declarations

2018-04-13 Thread Ben Toews
nt the interface. Signed-off-by: Jeff King <p...@peff.net> Signed-off-by: Ben Toews <mastahy...@gmail.com> --- gpg-interface.c | 17 - gpg-interface.h | 49 ++--- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/gpg-i

[PATCH v2 5/9] gpg-interface: fix const-correctness of "eol" pointer

2018-04-13 Thread Ben Toews
From: Jeff King <p...@peff.net> We accidentally shed the "const" of our buffer by passing it through memchr. Let's fix that, and while we're at it, move our variable declaration inside the loop, which is the only place that uses it. Signed-off-by: Jeff King <p...@peff.net&

[PATCH v2 4/9] gpg-interface: use size_t for signature buffer size

2018-04-13 Thread Ben Toews
in-memory buffer. Signed-off-by: Jeff King <p...@peff.net> Signed-off-by: Ben Toews <mastahy...@gmail.com> --- gpg-interface.c | 2 +- gpg-interface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gpg-interface.c b/gpg-interface.c index 08de0daa41..ac852ad4b9 100644

[PATCH v2 8/9] gpg-interface: prepare for parsing arbitrary PEM blocks

2018-04-13 Thread Ben Toews
From: Jeff King <p...@peff.net> In preparation for handling more PEM blocks besides "PGP SIGNATURE" and "PGP MESSAGE', let's break up the parsing to parameterize the actual block type. Signed-off-by: Jeff King <p...@peff.net> Signed-off-by: Ben Toews <mastahy...@g

[PATCH v2 0/9] gpg-interface: Multiple signing tools

2018-04-13 Thread Ben Toews
st_tick && git commit -a -m twelfth && + test_unconfig gpg.program && git tag twelfth-fake-signed && git cat-file -p twelfth-fake-signed >actual && grep "FAKE SIGNER SIGNATURE" actual && git conf

[PATCH v2 1/9] t7004: fix mistaken tag name

2018-04-13 Thread Ben Toews
From: Jeff King <p...@peff.net> We have a series of tests which create signed tags with various properties, but one test accidentally verifies a tag from much earlier in the series. Signed-off-by: Jeff King <p...@peff.net> Signed-off-by: Ben Toews <mastahy...@gmail.com> ---

Re: [PATCH 6/8] gpg-interface: find the last gpg signature line

2018-04-11 Thread Ben Toews
04-tag.sh > +++ b/t/t7004-tag.sh > @@ -1056,7 +1056,7 @@ test_expect_success GPG \ > git tag -s -F sigblanknonlfile blanknonlfile-signed-tag && > get_tag_msg blanknonlfile-signed-tag >actual && > test_cmp expect actual && > - git tag -v signed-tag > + git tag -v blanknonlfile-signed-tag > ' > > # messages with commented lines for signed tags: > -- > 2.17.0-140-g0b0cc9f867 > -- -Ben Toews

Re: [PATCH 8/8] gpg-interface: handle alternative signature types

2018-04-10 Thread Ben Toews
On Tue, Apr 10, 2018 at 3:35 AM, Junio C Hamano <gits...@pobox.com> wrote: > Ben Toews <mastahy...@gmail.com> writes: > >> From: Ben Toews <bto...@github.com> >> >> Currently you can only sign commits and tags using "gpg". >> ... &g

Re: [PATCH 8/8] gpg-interface: handle alternative signature types

2018-04-10 Thread Ben Toews
On Tue, Apr 10, 2018 at 2:24 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Mon, Apr 9, 2018 at 4:41 PM, Ben Toews <mastahy...@gmail.com> wrote: >> [...] >> This patch introduces a set of configuration options for >> defining a "signi

Re: [PATCH 6/8] gpg-interface: find the last gpg signature line

2018-04-10 Thread Ben Toews
On Tue, Apr 10, 2018 at 3:44 AM, Junio C Hamano <gits...@pobox.com> wrote: > Ben Toews <mastahy...@gmail.com> writes: > >> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh >> index ee093b393d..e3f1e014aa 100755 >> --- a/t/t7004-tag.sh >> +

[PATCH 8/8] gpg-interface: handle alternative signature types

2018-04-09 Thread Ben Toews
From: Ben Toews <bto...@github.com> Currently you can only sign commits and tags using "gpg". You can _almost_ plug in a related tool like "gpgsm" (which uses S/MIME-style signatures instead of PGP) using gpg.program, as it has command-line compatibility. But there a

[PATCH 1/8] gpg-interface: handle bool user.signingkey

2018-04-09 Thread Ben Toews
From: Jeff King The config handler for user.signingkey does not check for a boolean value, and thus: git -c user.signingkey tag will segfault. We could fix this and even shorten the code by using git_config_string(). But our set_signing_key() helper is used by other code

[PATCH 3/8] gpg-interface: use size_t for signature buffer size

2018-04-09 Thread Ben Toews
From: Jeff King Even though our object sizes (from which these buffers would come) are typically "unsigned long", this is something we'd like to eventually fix (since it's only 32-bits even on 64-bit Windows). It makes more sense to use size_t when taking an in-memory buffer. ---

[PATCH 2/8] gpg-interface: modernize function declarations

2018-04-09 Thread Ben Toews
From: Jeff King Let's drop "extern" from our declarations, which brings us in line with our modern style guidelines. While we're here, let's wrap some of the overly long lines, and move docstrings for public functions to their declarations, since they document the interface. ---

[PATCH 4/8] gpg-interface: fix const-correctness of "eol" pointer

2018-04-09 Thread Ben Toews
From: Jeff King We accidentally shed the "const" of our buffer by passing it through memchr. Let's fix that, and while we're at it, move our variable declaration inside the loop, which is the only place that uses it. --- gpg-interface.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH 6/8] gpg-interface: find the last gpg signature line

2018-04-09 Thread Ben Toews
From: Jeff King A signed tag has a detached signature like this: object ... [...more header...] This is the tag body. -BEGIN PGP SIGNATURE- [opaque gpg data] -END PGP SIGNATURE- Our parser finds the _first_ line that appears to start a PGP signature

[PATCH 7/8] gpg-interface: prepare for parsing arbitrary PEM blocks

2018-04-09 Thread Ben Toews
From: Jeff King In preparation for handling more PEM blocks besides "PGP SIGNATURE" and "PGP MESSAGE', let's break up the parsing to parameterize the actual block type. --- gpg-interface.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git

[PATCH 0/8] gpg-interface: Multiple signing tools

2018-04-09 Thread Ben Toews
This series extends the configuration to allow Git to better work with multiple signing tools. Ben Toews (1): gpg-interface: handle alternative signature types Jeff King (7): gpg-interface: handle bool user.signingkey gpg-interface: modernize function declarations gpg-interface: use

[PATCH 5/8] gpg-interface: extract gpg line matching helper

2018-04-09 Thread Ben Toews
From: Jeff King Let's separate the actual line-by-line parsing of signatures from the notion of "is this a gpg signature line". That will make it easier to do more refactoring of this loop in future patches. --- gpg-interface.c | 9 +++-- 1 file changed, 7 insertions(+), 2