From: Simon Hirscher Date: Mon, 23 Sep 2013 23:23:32 +0000 (+0200) Subject: Re: [BUG] Decryption fails if message was signed with an unknown key X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=529b7f9cfb4b0f8814390a6f16d350c06d4c68c8;p=notmuch-archives.git Re: [BUG] Decryption fails if message was signed with an unknown key --- diff --git a/df/a7105427285169d38f280949987b21e10b6703 b/df/a7105427285169d38f280949987b21e10b6703 new file mode 100644 index 000000000..1920844f5 --- /dev/null +++ b/df/a7105427285169d38f280949987b21e10b6703 @@ -0,0 +1,142 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 3EEE7431FBC + for ; Mon, 23 Sep 2013 16:24:16 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.363 +X-Spam-Level: +X-Spam-Status: No, score=0.363 tagged_above=-999 required=5 + tests=[RDNS_DYNAMIC=0.363] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id a5Bs8cbVvl2z for ; + Mon, 23 Sep 2013 16:24:11 -0700 (PDT) +Received: from cloudia.org (lvps176-28-19-116.dedicated.hosteurope.de + [176.28.19.116]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 60925431FB6 + for ; Mon, 23 Sep 2013 16:24:11 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=mime-version:in-reply-to:references:from:date:message-id:subject:to + :content-type:content-transfer-encoding; + bh=z1RLu2Zm1FYnMMxstEwHh3BXS/9pKG/AmeZn6G9+1W8=; + b=eySy24lJM+YlprFzB1oJkmDtyXAl8f5a8Bbw1X+/lFzOvT5/SJP+IZwQFuE+gagpR/ + mf1puluJQFs7qpV10LOM0O5UEeidlYo0ozRkQrjri4ZwB56+UIiIIhHOh5SiF+1zM5QW + 5GvqpuXL2YWCvnv/yJfi6XcwbgpCoFD+gEznlYfZyFmZLcxWOaln54ahqaly1g1IJ7ry + t+SeTVVgBgDX6fP0oI8R/ho+VtseOVE4Vegm4xbqUjB5/KWeNoZkHvovwZK9cTjCLkN5 + /A6RixmpzCBuPYc2hEN9BrLW611NtGed6zYojVkF+R7gbhYaQ/PSdcwW+8qAA48vYsDa + uCag== +X-Received: by 10.112.51.166 with SMTP id l6mr21852036lbo.5.1379978642770; + Mon, 23 Sep 2013 16:24:02 -0700 (PDT) +MIME-Version: 1.0 +In-Reply-To: <52289D36.2060006@fifthhorseman.net> +References: + + <52289D36.2060006@fifthhorseman.net> +From: Simon Hirscher +Date: Tue, 24 Sep 2013 01:23:32 +0200 +Message-ID: + +Subject: Re: [BUG] Decryption fails if message was signed with an unknown key +To: notmuch +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable +X-Mailman-Approved-At: Tue, 24 Sep 2013 03:47:39 -0700 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 23 Sep 2013 23:24:16 -0000 + +Hi Daniel, + +First of all, sorry for the delay =E2=80=93 I had locked myself out from +everything digital to study for my exams. + +On Thu, Sep 5, 2013 at 5:03 PM, Daniel Kahn Gillmor + wrote: +> I just tried to replicate this, and i do not see this misbehavior. I'm +> using notmuch 0.16-1 on a debian testing/unstable system. + +I'm using notmuch 0.15.2 on Ubuntu 12.04. Maybe the bug got fixed +somehow in the meantime? If you really can't reproduce the bug (see +below) I will build the newest version from source (as well as send +you the output of notmuch show --format=3Draw id:xyz@example.com | +devel/printmimestructure). + +> A) how does it know that there was a signature if the message was +> encrypted? normal PGP/MIME messages contain a single OpenPGP chunk that +> contains signatures wrapped inside the encryption, so that an observer +> can't tell whether there is a signature or not (or who made the signature= +) + +That's a good question. I suppose that although GnuPG successfully +decrypts the message, notmuch somehow discards the decrypted content +because the signature verification failed. As I said: GnuPG is +perfectly able to decrypt the message if I do it manually. + +> B) the date of the message is the unix epoch date (1970-01-01), and the +> date of the signature appears to be the unix epoch date as well. this +> seems suspicious and likely to be false. how are these messages being +> generated? + +I'm sorry, that was just me being ultra paranoid. :) + +> C) you appear to be using gnupg 2.0.17. the latest version of the +> 2.0.x line of gpg is 2.0.21. maybe you can upgrade your gpg +> installation and try again? + +> D) you have the mingw32 version of gpg. Does this mean you're running +> notmuch on windows? + +No, as far as I can see this was the sender's GPG version. I'm using +GnuPG 1.4.11 on Ubuntu. + +> E) i'd be curious to see what printmimestructure looks like on the +> message in question. if you've got a decent shell and the notmuch +> source code, you should be able to do: +> +> [=E2=80=A6] +> +> if you can clarify any of the above, i'd appreciate it. +> +> Also, if you can, you're welcome to send a signed/encrypted message +> using the same framework that generated the problematic message directly +> to me (my OpenPGP fingerprint is +> 0EE5BE979282D80B9F7540F1CCD2ED94D21739E9), and i'd be happy to take a +> look at it. + +Well, so far the problematic messages have always come from my +contacts, i.e. I didn't generate them myself. But I just tried out the +following in order to reproduce the bug: I created a fresh dummy key +pair, sent a signed and encrypted email (via Emacs' +mml-secure-message-sign-encrypt) in the dummy's name to my regular +email address and checked whether I could open that email. Of course I +could =E2=80=93 because I had both, the recipient's private key (for +decryption) and the sender's public key (for signature verification). +Then I removed the dummy key pair from my key ring =E2=80=93 and voil=C3=A0= +: +notmuch failed at decrypting the message (or at least told me there +was a decryption error, as described in my previous mail). + +Now, in order for you to test that behavior I'm going to send you a +signed and encrypted message because that should exactly reproduce the +bug, as long as you don't import my key (id EBACABE5 / +http://simonhirscher.de/public_key.asc) for signature verification. + +Best, + +Simon