[openpgp] Re: Specifying OpenPGP file extensions (and MIME type)?

Daniel Huigens <d.huigens@protonmail.com> Wed, 18 December 2024 15:56 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 4B863C14F703 for <openpgp@ietfa.amsl.com>; Wed, 18 Dec 2024 07:56:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.101
X-Spam-Level:
X-Spam-Status: No, score=-2.101 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-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
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 Wys0nqnNbNvt for <openpgp@ietfa.amsl.com>; Wed, 18 Dec 2024 07:56:10 -0800 (PST)
Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) (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 36992C14F696 for <openpgp@ietf.org>; Wed, 18 Dec 2024 07:56:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1734537368; x=1734796568; bh=DLC/XigCHBNC7GD8d2NEb2nSS0aDr7+PbxW4lBNJQ4E=; 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=BsqcHhrLDpb9klBmn3ZwSjWB4jfWTQtLCkNXLGaN7xtKb9Gp5CQafcjxa6HTkMiuk +fedkN4oPX6yx2rZPRgpu+Ufgmy/VDkYdLSe8OTQvZsL897FzP2+ncUYC3St5JiXUx t4kItcPXEqcTo6p6VicSSpbdKv9RgMVlDsQ+zs3WhIBrxLUxp9QqXyRHA937bByg02 xDNPnRADVexf+y1XPmoGo70iPQqgFXLYJ355kqor/J7B0kewGElsbCxG4gPcwZh1py DEd0k/mRmJMlIJaRyitm96KZUUqDPEjHEUFCYxZamlShonEt/Rr9b5YtTV8TZa7x9c F+41V2KNec1wQ==
Date: Wed, 18 Dec 2024 15:56:05 +0000
To: Andrew Gallagher <andrewg=40andrewg.com@dmarc.ietf.org>
From: Daniel Huigens <d.huigens@protonmail.com>
Message-ID: <Ts1QHIUYB28BAuFGcEAlziUv2P8z-9l3cvoIWqQP-LoGulOruNn15YUv1996s--1DZEm08nQZKwRoySSDxqzfkqW9FP1hL_nc0G9q3RE5pI=@protonmail.com>
In-Reply-To: <C2AE8233-3509-4717-AEC1-B9102669EE65@andrewg.com>
References: <WKLyA6liA56T21xXuqMWjCP4K0eTEfOMuz8oNLua_JiZwEhJJiXjl9Ed7h-HrI_jUYeST-UJ-hEdOsaDjUeGBvvZZkewDRphetWVjCkICLc=@protonmail.com> <87y10efgxp.fsf@fifthhorseman.net> <sYcaYzsrk48hcbpG3CtdEreiML_V637bHCcmag-3ERtwt8l_LeC9LE40D6-8o_F7x5sPyhw-YpfZfzs9jj4wwHqKsPCd9HAXBvBbTj3dSVc=@protonmail.com> <C2AE8233-3509-4717-AEC1-B9102669EE65@andrewg.com>
Feedback-ID: 2934448:user:proton
X-Pm-Message-ID: d415d715aecec5be80cd8b3c02296b99b907e3b6
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Message-ID-Hash: X5HKQV7SAKQUUCEJZ3OIEU4ACZKCKJHU
X-Message-ID-Hash: X5HKQV7SAKQUUCEJZ3OIEU4ACZKCKJHU
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: Daniel Kahn Gillmor <dkg@fifthhorseman.net>, openpgp <openpgp@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [openpgp] Re: Specifying OpenPGP file extensions (and MIME type)?
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/8s4-0zsaRmrNQ4rmO9QHj0ieohU>
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>

On Wednesday, December 18th, 2024 at 16:42, Andrew Gallagher wrote:

> I’d prefer to go in the other direction. Why do we have different grammars for messages and certificates? It prevents us from doing really simple stuff like appending a certificate to a message. If a message is a sequence of packets and a certificate is a sequence of packets - let’s just define an “OpenPGP packet sequence” and let the OpenPGP layer deal with the nuances of “message” vs “keyring” (certificate-ring?).

Hmm. I'm not sure I agree; if you want to put a certificate in a message
then you can just do that, put the certificate inside the (encrypted/
signed) message (e.g. as an attachment in the email context).
That seems cleaner to me.

There may be some sunk cost fallacy on my side as we spent a bunch of
effort in OpenPGP.js to make the parsing more strict / adhere to the
grammar more closely, e.g. `readMessage()` now throws if it includes a
key packet, and `readKey()` throws if it includes a data packet. While
this reduces flexibility in some sense, it also leads to better error
messages when you accidentally pass the wrong thing, for example.

Best,
Daniel