Re: [openpgp] changing the trailer for hashed data in v5 OpenPGP signatures

Daniel Huigens <d.huigens@protonmail.com> Tue, 22 November 2022 18:33 UTC

Return-Path: <d.huigens@protonmail.com>
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 A5474C1526F7 for <openpgp@ietfa.amsl.com>; Tue, 22 Nov 2022 10:33:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.097
X-Spam-Level:
X-Spam-Status: No, score=-7.097 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-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=protonmail.com
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 eAv3A5JeJBAm for <openpgp@ietfa.amsl.com>; Tue, 22 Nov 2022 10:33:19 -0800 (PST)
Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch [185.70.40.134]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 94AE5C14F736 for <openpgp@ietf.org>; Tue, 22 Nov 2022 10:33:19 -0800 (PST)
Date: Tue, 22 Nov 2022 18:33:05 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1669141996; x=1669401196; bh=redZHSY6VZYvlCuvxy199TMh6UEJLVeD5O2ZXHGUzUU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=T7msB3+wl9nl5Gokj5i2bU17TYY3IxM6068wNPC8h2SFiST3w44rE2+7Rm6bivM0v JhQC5E0fg4hv9N5Xa+OGaF9CCeREw2J/AbG4BCnPDb08AFltpkOOMk4/gO5Mh7ZGrO fVM2Vf/LrFgPD2wV9JB7XvDEB9PBTHZzrqsVlb/KvL8BgOMlOV2XPb3TkDwaPhTqla 1NoalDpOZIhAnslxeW5TgljZBXLfLdcf+sWQxW6PgUaarjMLSqhE1BItSgUkMx4SZI jeeTlLljqXg1RRK6auo3j/Gz2hQlsw6ex/qOE+P+vd99BoZybPVTL4rsk1a6bR1VHh DPb0UeECyL9tw==
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
From: Daniel Huigens <d.huigens@protonmail.com>
Cc: openpgp@ietf.org
Message-ID: <MNQn3cNgS1ZKPPB6k00kb3-B0nh_fLD0a0yTm5lDCpgcY_HgcjkXEO8pdv-qCuwBU36Ft3azYlY1itNIB37edn6d95K5JuqycYMSsDHsubs=@protonmail.com>
In-Reply-To: <87r0xzzokm.fsf@fifthhorseman.net>
References: <87r0xzzokm.fsf@fifthhorseman.net>
Feedback-ID: 2934448:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/q7L8Itf-yxDBKNSb3QbWqmslyOE>
Subject: Re: [openpgp] changing the trailer for hashed data in v5 OpenPGP signatures
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: Tue, 22 Nov 2022 18:33:23 -0000

Hi dkg,

Yeah, I think your analysis is correct. And I also prefer just leaving
the length at 4 octets rather than the workaround of splitting up the
length into 2 x 4 octets.

I do think that, for robustness and to prevent similar issues in the
future, it may make sense to hash the signature version at the
beginning, in addition to the end. That way, in v7(?), we would be free
to change the trailer without such considerations, if we wanted.
(We'd have to make sure that you can always tell from the one-pass
signature packet or armor headers which version it is, though.)
But, maybe it's a bit late for that change / not worth it, we can also
leave it.

Best,
Daniel