[openpgp] Re: text vs. binary in an OpenPGP "Signed Message"
Daniel Huigens <d.huigens@protonmail.com> Sat, 22 February 2025 14:53 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 2EEDDC1D5C7C for <openpgp@ietfa.amsl.com>; Sat, 22 Feb 2025 06:53:03 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 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_BLOCKED=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, 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 D6cDfkVxHGf2 for <openpgp@ietfa.amsl.com>; Sat, 22 Feb 2025 06:52:59 -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 ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CE5D8C15152D for <openpgp@ietf.org>; Sat, 22 Feb 2025 06:52:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1740235976; x=1740495176; bh=ILYhadK/uU5qxIf+fejaxAXSLrsZV7AazYJnY2+QbCI=; 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:List-Unsubscribe:List-Unsubscribe-Post; b=Vq4KXOjPBDGVj21UPxe7DKvz/NjWziVhaNlcdJTCEBAHUN5KLPPSaWQ7lhXz2F+yf OJNWft7eIJwdhDLucZ6pFRRi02aNGZP9qj33Am4eMoCZ6tHHtMlMCvxMDYHSStn1et Qp33bgGf9DnsGvcqyeR3CRjhG7y8X21hlzAR7mvXa1HnC52HYPe+R0YPvFZvsb3dL/ tCi5akix0QDH9QkXknogcW+rCWdIeSBdfsAUy88uJFHh1akrrGJ7ZJPIk8HCpEtrlC azLIpOfO2co6gWU45meurAtmiENbJCq00crVeBH/a2mNElVTov4+FJf9PEj9FZHyc0 LWkcsJCWCyJ+A==
Date: Sat, 22 Feb 2025 14:52:52 +0000
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
From: Daniel Huigens <d.huigens@protonmail.com>
Message-ID: <lYp-4gNsTczU7F5uSButMLfg0LlynU_6FysWBbDk2n5ZHwVBbiIsrzlITQtn1sHC9tfpoVGvBOM5VfB-q1o82n4fZRr27HWh_8UKVl_YE0s=@protonmail.com>
In-Reply-To: <871pvq4yhe.fsf@fifthhorseman.net>
References: <871pvq4yhe.fsf@fifthhorseman.net>
Feedback-ID: 2934448:user:proton
X-Pm-Message-ID: 665f0c5cc4727f730252a907ad004b8f92a8e562
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Message-ID-Hash: 4XQML4RHXYRP7OMSRI4KGLG5UI6FS4Y6
X-Message-ID-Hash: 4XQML4RHXYRP7OMSRI4KGLG5UI6FS4Y6
X-MailFrom: d.huigens@protonmail.com
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: 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/kljUEz-lVZTBx_5NAmq0b7bQmuI>
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>
Hi dkg & all, In my opinion: On Saturday, February 22nd, 2025 at 01:25, Daniel Kahn Gillmor wrote: > - Is it a bug if a signer produces (c) or (d)? It's not forbidden by the spec so I wouldn't quite call it a bug but it's a strange thing to do for sure. > - Should a verifier reject (c) or (d) automatically as malformed? I'd argue no. > - If not, should a verifier that encounters (d) attempt to apply CRLF > line endings to the LITb? Yes. Both RFC9580 and RFC4880 say quite clearly that a text signature (...) is calculated over the text data with its line endings converted to <CR><LF>, both in section 5.2.1 and 5.2.4. Btw, this is why in our implementations "normalizing line endings" is an operation on bytes rather than text, and just means replacing instances of 0x0A not preceded by 0x0D with 0x0D 0x0A. Of course this only makes sense when assuming that the binary literal data packet contains UTF-8 encoded text, which RFC9580 requires in this case: > If the implementation is certain that the data is textual and is > encoded with UTF-8 (for example, if it will follow this Literal Data > packet with a Signature packet of type 0x01 (see Section 5.2.1), it > MAY set the format octet to u. Otherwise, it MUST set the format > octet to b. Btw2, I'm somewhat surprised that GnuPG does something different as I remember us (a long time ago) changing OpenPGP.js's implementation to conform better with both the spec and GnuPG's behavior; but I might be misremembering or perhaps GnuPG's behavior changed. Btw3, the interop test suite has some test cases about this [1][2]. Unfortunately they don't tell us much about GnuPG's behavior since the SOP layer doesn't seem to support inline-verify nor text signatures inside encrypted data, weirdly enough. Best, Daniel [1]: https://sequoia-pgp.gitlab.io/openpgp-interoperability-test-suite/results.html#Signed_messages [2]: https://sequoia-pgp.gitlab.io/openpgp-interoperability-test-suite/results.html#Signed__and_encrypted__messages
- [openpgp] text vs. binary in an OpenPGP "Signed M… Daniel Kahn Gillmor
- [openpgp] Re: text vs. binary in an OpenPGP "Sign… Daniel Huigens
- [openpgp] encrypting textual data with sop [was: … Daniel Kahn Gillmor
- [openpgp] Re: encrypting textual data with sop [w… Daniel Huigens
- [openpgp] Re: text vs. binary in an OpenPGP "Sign… Justus Winter
- [openpgp] Re: text vs. binary in an OpenPGP "Sign… Daniel Huigens
- [openpgp] Re: text vs. binary in an OpenPGP "Sign… Justus Winter
- [openpgp] Re: text vs. binary in an OpenPGP "Sign… Andrew Gallagher