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

Re: [PATCH v1 0/2] gpg-interface: prefer check_signature() for GPG verification

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 6, 2020, 11:59 UTC
Message-ID
<nycvar.QRO.7.76.6.2003061257470.46@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqqftem4p6y.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Thu, 5 Mar 2020, Junio C Hamano wrote:
Show 27 quoted lines
> Hans Jerry Illikainen <hji@dyntopia.com> writes:
>
> > This patch refactors the use of verify_signed_buffer() for GPG
> > verification to use check_signature() instead.
> >
> > Previously, both check_signature() and verify_signed_buffer() were used
> > to verify signatures in various parts of Git.  However,
> > verify_signed_buffer() does not parse the GPG status message.  Instead,
> > it relies entirely on the exit code from GPG coupled with the existence
> > of a GOODSIG string in the output buffer.  Unfortunately, the mere
> > prescience of GOODSIG does not necessarily imply a valid signature, as
> > shown by Michał Górny [1].
> >
> > verify_signed_buffer() should be reserved for internal use by
> > check_signature() since check_signature() parses and verifies the status
> > message.  This is accomplished in this patch.
> >
> > Changes since v0:
> > * Added regression tests for log-tree and fmt-merge-msg.
> > * Fixed a bug in log-tree.c that caused "No signature" to be shown
> >   erroneously.
> > * Fixed a similar bug in fmt-merge-msg.c.
> > * Always invoke signature_check_clear() after check_signature().  The
> >   check function may touch the signature_check structure on failure.
>
> Thanks.  Will queue.  Let's cook it slower and aim for the next
> cycle.

Good call about cooking this slower: it fails both on Windows and on macOS (see https://dev.azure.com/gitgitgadget/git/_build/results?buildId=32672&view=ms.vss-test-web.build-test-results-tab&runId=101636&resultId=101463&paneView=debug for details):

	expecting success of 6200.2 'GPG':
		git tag -s -m signed-tag-msg signed-good-tag left
	++ git tag -s -m signed-tag-msg signed-good-tag left
	error: gpg failed to sign the data
	error: unable to sign the tag
	error: last command exited with $?=128
Not very helpful log, I must say.

Ciao, Dscho

Show 16 quoted lines
>
> > [1] https://dev.gentoo.org/~mgorny/articles/attack-on-git-signature-verification.html
> >
> > Hans Jerry Illikainen (2):
> >   t: increase test coverage of signature verification output
> >   gpg-interface: prefer check_signature() for GPG verification
> >
> >  builtin/fmt-merge-msg.c  |  11 ++--
> >  gpg-interface.c          |  97 +++++++++++++++++------------------
> >  gpg-interface.h          |   9 ----
> >  log-tree.c               |  34 ++++++-------
> >  t/t4202-log.sh           | 106 +++++++++++++++++++++++++++++++++++++++
> >  t/t6200-fmt-merge-msg.sh |  23 +++++++++
> >  6 files changed, 202 insertions(+), 78 deletions(-)
>
>
Previous: Junio C Hamano
Message 10 of 10 in “gpg-interface: prefer check_signature() for GPG verification”
  1. 0/1 gpg-interface: prefer check_signature() for GPG verificationHans Jerry Illikainen, Nov 27, 2019
  2. 1/1 gpg-interface: prefer check_signature() for GPG verificationHans Jerry Illikainen, Nov 27, 2019
  3. Junio C HamanoNov 30, 2019
  4. 0/2 gpg-interface: prefer check_signature() for GPG verificationHans Jerry Illikainen, Mar 4, 2020
  5. 1/2 t: increase test coverage of signature verification outputHans Jerry Illikainen, Mar 4, 2020
  6. Johannes SchindelinMar 14, 2020
  7. Junio C HamanoMar 15, 2020
  8. 2/2 gpg-interface: prefer check_signature() for GPG verificationHans Jerry Illikainen, Mar 4, 2020
  9. Junio C HamanoMar 5, 2020
  10. Johannes SchindelinMar 6, 2020

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.