unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: "David Bremner" <david@tethera.net>,
	"Tomi Ollila" <tomi.ollila@iki.fi>,
	"Dan Čermák" <dan.cermak@posteo.net>,
	notmuch@notmuchmail.org
Subject: Re: crypto test failures on Fedora and OpenSUSE
Date: Thu, 02 Jul 2020 01:06:49 -0400	[thread overview]
Message-ID: <87366av72u.fsf@fifthhorseman.net> (raw)
In-Reply-To: <87ftafo25l.fsf@zancas>


[-- Attachment #1.1.1: Type: text/plain, Size: 1802 bytes --]

Hi folks--

On Sun 2020-06-28 08:33:42 -0300, David Bremner wrote:
> I dug a bit further down, and this is what is returned from gpgme
> (line 345 in g_mime_gpgme_get_signatures)
>
> sig = {next = 0x0,
>     summary = GPGME_SIGSUM_KEY_MISSING, 
>     fpr = 0x4ac480 "5AEAB11F5E33DCE875DDB75B6D92612D94E46381", status = 9, 
>     notations = 0x0, timestamp = 1559167762, exp_timestamp = 0, wrong_key_usage = 0, 
>     pka_trust = 0, chain_model = 0, is_de_vs = 0, _unused = 0, 
>     validity = GPGME_VALIDITY_UNKNOWN, validity_reason = 0, 
>     pubkey_algo = GPGME_PK_RSA, hash_algo = GPGME_MD_SHA256, pka_address = 0x0, 
>     key = 0x0}
>
> At this point I'm leaning towards declaring it a gpgme problem in
> fedora32, and suggesting that relevant distros mark the test broken. I
> am of course open to more informed opinions.

The problem does indeed appear to be with gpgme, in versions 1.13.0 and
1.13.1.

In particular, it is a problem with the resolution of
https://dev.gnupg.org/T3464, which is ultimately fixed upstream, but is
not yet fixed in a released version of gpgme.

The upstream commit, which should be patched into gpgme on Fedora and
OpenSUSE (and anywhere else that depends on gpgme) is:

    https://dev.gnupg.org/rMae4d7761a15b82eb98b0bcc72af2ae2e8973e1f9

(patch attached here as well)

We don't see this on Debian because gpgme in debian has carried this
patch for over a year now.

In gpgme 1.12.0 and earlier, this bug did not exist.  But gpgme 1.13.0
introduced the bug in an attempt to avoid error diagnostics when *not*
trying to verify a signature while using a session key.  The fix in
1.13.0 inadvertently introduced an error when the caller does actually
try to verify a signature, which is what we see here.

      --dkg


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-gpg-Avoid-error-diagnostics-with-override-session-ke.patch --]
[-- Type: text/x-diff, Size: 2006 bytes --]

From ae4d7761a15b82eb98b0bcc72af2ae2e8973e1f9 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Wed, 29 May 2019 17:56:01 -0400
Subject: [GPGME PATCH] gpg: Avoid error diagnostics with
 --override-session-key when verifying

* src/engine-gpg.c (gpg_decrypt): only send --no-keyring when we are
not verifying.

--

Without this change, the signature verification would fail.  This
problem was introduced in bded8ebc59c7fdad2617f4c9232a58047656834c in
an attempt to avoid an error when *not* verifying.  Clearly more test
suite coverage is needed to avoid introducing this sort of problem in
the future.

GnuPG-bug-id: 3464
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
 src/engine-gpg.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 5c335cb2..223404ed 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -1717,12 +1717,15 @@ gpg_decrypt (void *engine,
                                          strlen (override_session_key), 1);
           if (!err)
             {
-              /* We add --no-keyring because a keyring is not required
-               * when we are overriding the session key.  It would
+              /* When we are not trying to verify signatures as well,
+               * we add --no-keyring because a keyring is not required
+               * for decryption when overriding the session key.  It would
                * work without that option but --no-keyring avoids that
                * gpg return a failure due to a missing key log_error()
                * diagnostic.  --no-keyring is supported since 2.1.14. */
-              err = add_arg (gpg, "--no-keyring");
+
+              if (!(flags & GPGME_DECRYPT_VERIFY))
+                  err = add_arg (gpg, "--no-keyring");
               if (!err)
                 err = add_arg (gpg, "--override-session-key-fd");
               if (!err)
-- 
2.27.0


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

  reply	other threads:[~2020-07-02  5:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-24 22:03 Feature freeze for notmuch 0.30: June 1 David Bremner
2020-06-02  0:59 ` David Bremner
2020-06-16 12:05   ` David Bremner
2020-06-17  9:18     ` Dan Čermák
2020-06-17 11:53       ` Tomi Ollila
2020-06-17 12:49         ` Tomi Ollila
2020-06-17 23:55           ` crypto test failures on Fedora and OpenSUSE David Bremner
2020-06-20 15:45             ` David Bremner
2020-06-28 11:33               ` David Bremner
2020-07-02  5:06                 ` Daniel Kahn Gillmor [this message]
2020-07-02  8:28                   ` Dan Čermák
2020-07-02 18:00                   ` [PATCH 1/2] configure: can gpgme can verify signatures when decrypting with a session key? Daniel Kahn Gillmor
2020-07-02 18:00                     ` [PATCH 2/2] tests: mark sig verification known-broken with session keys on buggy gpgme Daniel Kahn Gillmor
2020-07-03  1:13                     ` [PATCH 1/2] configure: can gpgme can verify signatures when decrypting with a session key? David Bremner
2020-07-03 11:35                     ` David Bremner
2020-07-03 11:15     ` Feature freeze for notmuch 0.30: June 1 David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87366av72u.fsf@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=dan.cermak@posteo.net \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).