[openpgp] Re: text vs. binary in an OpenPGP "Signed Message"

Justus Winter <justus@sequoia-pgp.org> Mon, 03 March 2025 10:50 UTC

Return-Path: <justus@sequoia-pgp.org>
X-Original-To: openpgp@mail2.ietf.org
Delivered-To: openpgp@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 81B09588930 for <openpgp@mail2.ietf.org>; Mon, 3 Mar 2025 02:50:52 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level:
X-Spam-Status: No, score=-2.1 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (4096-bit key) header.d=sequoia-pgp.org
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fH3kz9QScpOJ for <openpgp@mail2.ietf.org>; Mon, 3 Mar 2025 02:50:51 -0800 (PST)
Received: from mailgate02.uberspace.is (mailgate02.uberspace.is [IPv6:2a00:d0c0:200:0:1c7b:a6ff:fee0:8ea4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 2D2975888C4 for <openpgp@ietf.org>; Mon, 3 Mar 2025 02:50:48 -0800 (PST)
Received: from harrington.uberspace.de (harrington.uberspace.de [185.26.156.85]) by mailgate02.uberspace.is (Postfix) with ESMTPS id E4675180BF9 for <openpgp@ietf.org>; Mon, 3 Mar 2025 11:50:46 +0100 (CET)
Received: (qmail 32715 invoked by uid 500); 3 Mar 2025 10:50:46 -0000
Authentication-Results: harrington.uberspace.de; auth=pass (plain)
Received: from unknown (HELO unkown) (::1) by harrington.uberspace.de (Haraka/3.0.1) with ESMTPSA; Mon, 03 Mar 2025 11:50:46 +0100
From: Justus Winter <justus@sequoia-pgp.org>
To: Daniel Huigens <d.huigens@protonmail.com>
In-Reply-To: <euodfAz9Ixsk9-TgcVJf0uTIC9txOTgvznS9ADAh3UsulwBcv04x_i-TkTbdwRhe-uAyvpfqtxnXTgWw4PeM_4WsQeN_xumpcOrEft9ixg0=@protonmail.com>
References: <871pvq4yhe.fsf@fifthhorseman.net> <87o6yiigut.fsf@europ.lan> <euodfAz9Ixsk9-TgcVJf0uTIC9txOTgvznS9ADAh3UsulwBcv04x_i-TkTbdwRhe-uAyvpfqtxnXTgWw4PeM_4WsQeN_xumpcOrEft9ixg0=@protonmail.com>
Date: Mon, 03 Mar 2025 11:50:45 +0100
Message-ID: <87ldtmie0q.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: BAYES_HAM(-2.998321) SIGNED_PGP(-2) MIME_GOOD(-0.2)
X-Rspamd-Score: -5.198321
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sequoia-pgp.org; s=uberspace; h=from:to:cc:subject:date; bh=T7fHYdYTF0hJ030/xE06ec46Y4/3ZMvJHrF4N4Bw9Qc=; b=brkbDf3eQrA5V8f6fgtMuSIjC2jGhO/0Kc8iTGL2yKBsxmvx5MgMyYn0oUXiT9wtzAAvjFdzGM KIrm0aMAEsPwXp0Dwp4nFVj3RePGH/aHh9woYj3BmjwW9SMQ3S9wKA6uX/nzVcCUGFRi5nuagUMT qUp35vdc4OWCSyUdWE3PdoM4ORCMavxwcs8+0MEg97WJRNIswIeefWfsxbzN+ttPLM6MFtEfR3YO tBf3bvvY+YCoHxVNp1lmR/DVPy0rwQsz46j0PsqLLoJj1kOLhU/HttT8cZG7Nt7msyrisWMq01tD dJxpoTamq2utCGL9uMQVutXqfE3YuJeWfTzMklT/RGI2BxAsmKzcsMnJ4UfK0cc2EjHagVCWZWmf IBakjT/jsVYReL514bCocujMzIln9KR9D+0rN7EPX1vvYy06QUBqfXy52PJ0PtD8N4dqReZ5nCf+ 2a9OPgL1S4Z9WUVkkgCYgeiq2mUU8TFGMmg3+oTEpEUpwtbyBjwcDIc5zn9Asyw2wCSz5giLFard I+tFpul3Rjai6GnccG+YNbcf5kUl/di0Oga+AFjs/cFh6Fr9+b0oyOCz3ZlPXxVSHsMJQxWJTJad 8X+isK0j7RHXYpRDQcXY/OGX6sEG90O4e/lkB9x7wHPgb/M9EDkbJnVuDMdy+Uhx7NaXnRR4TXny A=
Message-ID-Hash: ZWTXUHIUENB4PHMZ677CJM4L47TAKJAD
X-Message-ID-Hash: ZWTXUHIUENB4PHMZ677CJM4L47TAKJAD
X-MailFrom: justus@sequoia-pgp.org
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-openpgp.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Daniel Kahn Gillmor <dkg@fifthhorseman.net>, openpgp@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [openpgp] Re: text vs. binary in an OpenPGP "Signed Message"
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/tfAGWuMEt8-8m2kMzjbiesWa0hM>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Owner: <mailto:openpgp-owner@ietf.org>
List-Post: <mailto:openpgp@ietf.org>
List-Subscribe: <mailto:openpgp-join@ietf.org>
List-Unsubscribe: <mailto:openpgp-leave@ietf.org>

Daniel Huigens <d.huigens@protonmail.com> writes:

> Hi :)
>
> On Monday, March 3rd, 2025 at 10:49, Justus Winter wrote:
>> > - If not, should a verifier that encounters (d) attempt to apply CRLF
>> >   line endings to the LITb?
>> 
>> No.
>
> I'm confused by either the answer or the question :')
>
> When I answered yes, I meant, the verifier should normalize the line
> endings of the contents of the literal data packet before feeding it
> into the hash of the signature.
>
> I agree that it shouldn't affect the data returned to the application.

And Andrew writes:

> We need to be careful to distinguish between canonicalisation of the
> signature subject (i.e. the data on the wire that a receiver can read
> directly) and of the “type-specific data” that is passed into the
> signature hash function. The point of type 1 signatures is that the
> type-specific data is independent of which newline convention (if any)
> has been applied to the subject. So for the above question, perhaps we
> should clarify that the wire format of the subject SHOULD NOT be
> altered by the receiving implementation, but the type-specific data
> passed to the signature verification MUST still be normalised.

I think we are all in agreement.  Sorry if I was unclear.

Best,
Justus