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

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

From
Jeff King <peff@peff.net>
Date
May 9, 2018, 08:03 UTC
Message-ID
<20180509080341.GB3327@sigill.intra.peff.net>
In-Reply-To
<20180508230922.GB275488@genre.crustytoothpaste.net>
On Tue, May 08, 2018 at 11:09:22PM +0000, brian m. carlson wrote:
Show 10 quoted lines
> On Tue, May 08, 2018 at 09:28:14AM -0400, Jeff King wrote:
> > OK, so my question then is: what does just-gpgsm support look like?
> > 
> > Do we literally add gpgsm.program? My thought was that taking us the
> > first step towards a more generic config scheme would prevent us having
> > to backtrack later.
> 
> I think the signingtool prefix is fine, or something similar.  My "just
> gpgsm" proposal is literally just "check for PGP header" and "check for
> CMS header" in parse_signature and dispatch appropriately.

Hmm. I suppose that would work. I just didn't want to go the route of adding more hard-coded magic that the user couldn't override (or anything that is more complex than what the user could specify for their own tool if they wanted to). But I suppose there's probably not a big need to override the GPG or CMS matching in practice.

Show 8 quoted lines
> > There are also more CMS signers than gpgsm (and I know Ben is working on
> > a tool). So it feels a little ugly to make it "gpgsm.program", since it
> > really is a more generic format.
> 
> Okay, so signingtool.cms.program?  signingtool.smime.program?
> 
> I suppose Ben still intends to use the same command-line interface as
> for gpgsm.
AFAIK, yes.
Show 6 quoted lines
> > Or would you be happy if we just turned the matcher into a whole-line
> > substring or regex match?
> 
> A first line regex would probably be fine, if you want to go that way.
> That, I think, is generic enough that we can make use of it down the
> line, since it distinguishes all known formats, TTBOMK.

That seems like a happy medium to me. I worried at first that a regex might be noticeably expensive, but probably not. During "git log" we only feed "gpgsig" headers from each commit to the signature parsing code (so it's few lines, and no cost when you aren't using signatures). For tags we have to scan the whole tag body, but per-tag performance is much less important there, because you're not typically traversing hundreds of thousands of them.

> It would be nice if we could still continue to use gpg without having to
> add specific configuration for it, at least for compatibility reasons.

Definitely. Maintaining compatibility with the existing out-of-the-box behavior and with the existing config options is non-negotiable (and is already the case with the existing patch under discussion).

-Peff
Previous: brian m. carlsonNext: Junio C Hamano
Message 33 of 46 in “gpg-interface: Multiple signing tools”
  1. 0/8 gpg-interface: Multiple signing toolsBen Toews, Apr 9, 2018
  2. 1/8 gpg-interface: handle bool user.signingkeyBen Toews, Apr 9, 2018
  3. Eric SunshineApr 9, 2018
  4. Jeff KingApr 10, 2018
  5. 3/8 gpg-interface: use size_t for signature buffer sizeBen Toews, Apr 9, 2018
  6. 2/8 gpg-interface: modernize function declarationsBen Toews, Apr 9, 2018
  7. 4/8 gpg-interface: fix const-correctness of "eol" pointerBen Toews, Apr 9, 2018
  8. 5/8 gpg-interface: extract gpg line matching helperBen Toews, Apr 9, 2018
  9. 7/8 gpg-interface: prepare for parsing arbitrary PEM blocksBen Toews, Apr 9, 2018
  10. 6/8 gpg-interface: find the last gpg signature lineBen Toews, Apr 9, 2018
  11. Eric SunshineApr 9, 2018
  12. Junio C HamanoApr 10, 2018
  13. Ben ToewsApr 10, 2018
  14. Junio C HamanoApr 10, 2018
  15. Junio C HamanoApr 10, 2018
  16. Ben ToewsApr 11, 2018
  17. 8/8 gpg-interface: handle alternative signature typesBen Toews, Apr 9, 2018
  18. Stefan BellerApr 9, 2018
  19. Eric SunshineApr 10, 2018
  20. Ben ToewsApr 10, 2018
  21. brian m. carlsonApr 14, 2018
  22. Junio C HamanoApr 16, 2018
  23. brian m. carlsonApr 17, 2018
  24. Junio C HamanoApr 17, 2018
  25. Ben ToewsApr 17, 2018
  26. Taylor BlauApr 17, 2018
  27. Ben ToewsMay 3, 2018
  28. Jeff KingMay 7, 2018
  29. Junio C HamanoMay 7, 2018
  30. brian m. carlsonMay 7, 2018
  31. Jeff KingMay 8, 2018
  32. brian m. carlsonMay 8, 2018
  33. Jeff KingMay 9, 2018
  34. Junio C HamanoApr 10, 2018
  35. Ben ToewsApr 10, 2018
  36. SZEDER GáborApr 11, 2018
  37. 0/9 gpg-interface: Multiple signing toolsBen Toews, Apr 13, 2018
  38. 2/9 gpg-interface: handle bool user.signingkeyBen Toews, Apr 13, 2018
  39. 3/9 gpg-interface: modernize function declarationsBen Toews, Apr 13, 2018
  40. 1/9 t7004: fix mistaken tag nameBen Toews, Apr 13, 2018
  41. 8/9 gpg-interface: prepare for parsing arbitrary PEM blocksBen Toews, Apr 13, 2018
  42. 4/9 gpg-interface: use size_t for signature buffer sizeBen Toews, Apr 13, 2018
  43. 5/9 gpg-interface: fix const-correctness of "eol" pointerBen Toews, Apr 13, 2018
  44. 6/9 gpg-interface: extract gpg line matching helperBen Toews, Apr 13, 2018
  45. 7/9 gpg-interface: find the last gpg signature lineBen Toews, Apr 13, 2018
  46. 9/9 gpg-interface: handle alternative signature typesBen Toews, Apr 13, 2018

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.