Re: [openpgp] text signatures

"Neal H. Walfield" <neal@walfield.org> Fri, 02 December 2022 15:59 UTC

Return-Path: <neal@walfield.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 40811C14F606; Fri, 2 Dec 2022 07:59:00 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.198
X-Spam-Level:
X-Spam-Status: No, score=-4.198 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_NONE=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 T0gSdJpV7jUj; Fri, 2 Dec 2022 07:58:58 -0800 (PST)
Received: from mail.dasr.de (mail.dasr.de [202.61.250.5]) (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 9B493C14F73A; Fri, 2 Dec 2022 07:58:58 -0800 (PST)
Received: from p5de92f23.dip0.t-ipconnect.de ([93.233.47.35] helo=forster.huenfield.org) by mail.dasr.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <neal@walfield.org>) id 1p18RE-0003kp-9p; Fri, 02 Dec 2022 16:58:56 +0100
Received: from grit.huenfield.org ([192.168.20.9] helo=grit.walfield.org) by forster.huenfield.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <neal@walfield.org>) id 1p18RD-001voP-D5; Fri, 02 Dec 2022 16:58:55 +0100
Date: Fri, 02 Dec 2022 16:58:55 +0100
Message-ID: <87bkol4x1c.wl-neal@walfield.org>
From: "Neal H. Walfield" <neal@walfield.org>
To: Daniel Huigens <d.huigens=40protonmail.com@dmarc.ietf.org>
Cc: IETF OpenPGP WG <openpgp@ietf.org>
In-Reply-To: <DoVNV3lGG-ohQLhfXZW5zx49v5_y8QHxza1uhOXUhjpY_bhVEX8B1hd8OG-ZHx1--EiV0039t-Oz9zTUBEGROaaHWWBp8ejfXhZzXFMIjc0=@protonmail.com>
References: <87mt8b5dmk.wl-neal@walfield.org> <DoVNV3lGG-ohQLhfXZW5zx49v5_y8QHxza1uhOXUhjpY_bhVEX8B1hd8OG-ZHx1--EiV0039t-Oz9zTUBEGROaaHWWBp8ejfXhZzXFMIjc0=@protonmail.com>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset="US-ASCII"
X-SA-Exim-Connect-IP: 192.168.20.9
X-SA-Exim-Mail-From: neal@walfield.org
X-SA-Exim-Scanned: No (on forster.huenfield.org); SAEximRunCond expanded to false
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/l7htCpcKfhuXeWwSHLrJTByzGwg>
Subject: Re: [openpgp] text 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: Fri, 02 Dec 2022 15:59:00 -0000

On Mon, 28 Nov 2022 20:39:02 +0100,
Daniel Huigens wrote:
> Yeah, I tend to agree. I also brought this up in the MR where this
> change was proposed [1], and we subsequently discussed it in the DT,
> where I suggested to change the proposed text from "is encoded" to
> "MUST be encoded" in order to signal that this is a new instruction
> that only applies to new signatures, and that those indeed MUST be
> UTF-8 encoded

Would it make sense to add a warning to the text that older software
may not have performed the encoding when hashing the signature data?
Then, for historical v3 and v4 signatures, an OpenPGP implementation
could create two hash contexts, one where only line ending
normalization is performed, and another where both line ending and
UTF-8 conversions are performed?

>  (which reflects the new guidance for literal data packets
> in [2] to the same effect).

I find the change to the literal data packet easier to accept than the
above change, since there is a clear break.


Perhaps the change to how signatures are computed in 5.2.4 should only
apply to v5 signatures, since it represents a change in semantics.


> My intention with that (not speaking for
> dkg or the rest of the DT, though) was that for existing signatures,
> it shouldn't apply, but actually the quoted section is general to both
> signing and verification, so probably that intention isn't captured
> by the final text, and it should be changed again.
> 
> Since the literal data packet already says that text data MUST be UTF-8,
> maybe this guidance is redundant, in that case, and can just be removed?
> We might still need some guidance for detached signatures; e.g. we could
> state in section 11.4 that detached text signatures MUST be over UTF-8
> encoded text (and similarly for clearsigned messages as well?)
> 
> Or, from the other direction, we could say that when creating signatures
> the implementation may only set the signature type to text if it's
> confident that it's signing UTF-8 encoded text?

My understanding of the current text in 5.2.4. is that the signing and
verification routines have to do the conversion to UTF-8 on the fly,
i.e., the signed data may not actually be encoded with UTF-8, and the
converted data is not necessarily emitted.  That, of course, implies
that the implementation somehow knows the correct encoding, which I
don't think is always true.


I'd be for requiring that text signatures (signature type 0x1) made by
v5 key be over UTF-8 data.  Otherwise, they should be considered
invalid.

Neal