Re: [openpgp] Expected client behaviour ambiguity in signature verification

Jonathan McDowell <noodles@earth.li> Thu, 07 July 2022 18:55 UTC

Return-Path: <noodles@earth.li>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6BF52C159827 for <openpgp@ietfa.amsl.com>; Thu, 7 Jul 2022 11:55:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.105
X-Spam-Level:
X-Spam-Status: No, score=-2.105 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=earth.li
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4jIVphSkrBGO for <openpgp@ietfa.amsl.com>; Thu, 7 Jul 2022 11:55:44 -0700 (PDT)
Received: from the.earth.li (the.earth.li [IPv6:2a00:1098:86:4d:c0ff:ee:15:900d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3E0FFC15790C for <openpgp@ietf.org>; Thu, 7 Jul 2022 11:55:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=earth.li; s=the; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WVL5wdFfjT/qfzs5ZD1ja4bBfk+fieqsY9zEtV3otnM=; b=Hs24PM7oNYI9nfLtLr1ELxkcG1 PW20R0TsSSTETigyXsM4nq3AO9hkpcehkl2ZO1r5ERMfRfTtMA6udaVYlIE8tEbKUWcJ7esNcP4Oz H4dYNFQouprO8I0nlSI3efPCKukB5oyPCjDCzBKrYn073dNJWFuSpCv2mfxr3zLftLiJonAGo0T0n P4DOMFqIifPecJJYIe2Of/pHr53Q6iSobie7MQB78LPtJojZ/lBxsIxJqNQlfWEaD0IU3c54TtQco m3uti2TuXSSCKzlZmYl5mu7GbDle1Ooi9hn+0j9kczkEq20GwRDlBhsvSCHLZ6eHUydbPOiYsXCdd PPRvyEyg==;
Received: from noodles by the.earth.li with local (Exim 4.94.2) (envelope-from <noodles@earth.li>) id 1o9Wf7-00BNjo-0F for openpgp@ietf.org; Thu, 07 Jul 2022 19:55:41 +0100
Date: Thu, 07 Jul 2022 19:55:40 +0100
From: Jonathan McDowell <noodles@earth.li>
To: openpgp@ietf.org
Message-ID: <YscsLPg2I0Oaio8B@earth.li>
References: <d0483dcb-025b-37c2-9a26-e42133b506ac@andrewg.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="XVM07EU1ER2W19io"
Content-Disposition: inline
In-Reply-To: <d0483dcb-025b-37c2-9a26-e42133b506ac@andrewg.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/gypR_8PZwwoplNR2sWEyyprCIgw>
Subject: Re: [openpgp] Expected client behaviour ambiguity in signature verification
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Jul 2022 18:55:48 -0000

On Thu, Jul 07, 2022 at 07:39:33PM +0100, Andrew Gallagher wrote:
> It has been brought to my attention that some keys in the wild are not
> being served correctly by some keyservers, and I suspect that the reason
> is that only some OpenPGP implementations are performing the following
> test as specified in section 5.2.3 of RFC4880:
> 
> ```
> The concatenation of the data being signed and the signature data from
> the version number through the hashed subpacket data (inclusive) is hashed.
> The resulting hash value is what is signed.
> The high 16 bits (first two octets) of the hash are included in the
> Signature packet to provide a way to reject some invalid signatures
> without performing a signature verification.
> ```
> 
> I know that Protonmail/go-crypto *is* performing this test, and the key
> I have been supplied with fails on it - but processing the same key in
> both GnuPG and Sequoia throws no errors.
> 
> What should an implementation do in the case where these 16 bits are
> incorrectly set but the signature is otherwise valid? It is implied that
> failing hard on this test is allowed (otherwise why bother?) but it is
> not specified as MUST or even SHOULD.

I know the GitHub key has this problem. I ended up dropping the check
from onak as a result, but I'd be really interested to know what client
software is generating the incorrect keys.

J.

-- 
If I throw a stick, will you leave?