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

Justus Winter <justus@sequoia-pgp.org> Fri, 08 July 2022 10:51 UTC

Return-Path: <justus@sequoia-pgp.org>
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 8B0D6C14CF12 for <openpgp@ietfa.amsl.com>; Fri, 8 Jul 2022 03:51:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.903
X-Spam-Level:
X-Spam-Status: No, score=-6.903 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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
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 5b7ldzXrCHom for <openpgp@ietfa.amsl.com>; Fri, 8 Jul 2022 03:51:14 -0700 (PDT)
Received: from harrington.uberspace.de (harrington.uberspace.de [185.26.156.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2B5EAC14CF07 for <openpgp@ietf.org>; Fri, 8 Jul 2022 03:51:13 -0700 (PDT)
Received: (qmail 29341 invoked by uid 500); 8 Jul 2022 10:51:10 -0000
Authentication-Results: harrington.uberspace.de; auth=pass (plain)
From: Justus Winter <justus@sequoia-pgp.org>
To: Andrew Gallagher <andrewg@andrewg.com>, openpgp@ietf.org
In-Reply-To: <d0483dcb-025b-37c2-9a26-e42133b506ac@andrewg.com>
References: <d0483dcb-025b-37c2-9a26-e42133b506ac@andrewg.com>
Date: Fri, 08 Jul 2022 12:50:54 +0200
Message-ID: <87y1x3x4hd.fsf@europ.lan>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg="pgp-sha512"; protocol="application/pgp-signature"
X-Rspamd-Bar: ----
X-Rspamd-Report: MIME_GOOD(-0.2) SIGNED_PGP(-2) BAYES_HAM(-2.496932)
X-Rspamd-Score: -4.696932
Received: from unknown (HELO unkown) (::1) by harrington.uberspace.de (Haraka/2.8.28) with ESMTPSA; Fri, 08 Jul 2022 12:51:10 +0200
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/nlN2XNVq7G2Fen8POdyFkSXqSZQ>
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: Fri, 08 Jul 2022 10:51:18 -0000

Andrew Gallagher <andrewg@andrewg.com> writes:

> 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.

I wrote a test to explore how the different implementations behave:

  https://tests.sequoia-pgp.org/#Signature_digest_prefix

Every implementation I test sets the digest prefix correctly (GPGME's
support for gpg1.4 seems to be faulty, we see a lot of unexpected
failures for gpg1.4.)

Implementations that ignore bad digest prefixes:

  - Sequoia
  - PGPainless
  - PGPy
  - GnuPG (all versions)

Implementations that reject the signature if the digest prefix is wrong,
both in detached signatures as well as binding signatures:

  - dkgpg
  - GopenPGP
  - OpenPGP.js
  - RNP

Best,
Justus