Re: [openpgp] Put Signature in an Email's Header

Bart Butler <bart+ietf@pm.me> Thu, 10 August 2023 04:57 UTC

Return-Path: <bart+ietf@pm.me>
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 96131C14CE55 for <openpgp@ietfa.amsl.com>; Wed, 9 Aug 2023 21:57:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.995
X-Spam-Level:
X-Spam-Status: No, score=-1.995 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, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_MIME_MALF=0.01, 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=pm.me
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 TMc-W_ZLEL6c for <openpgp@ietfa.amsl.com>; Wed, 9 Aug 2023 21:57:36 -0700 (PDT)
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 7E834C14CE54 for <openpgp@ietf.org>; Wed, 9 Aug 2023 21:57:36 -0700 (PDT)
Date: Thu, 10 Aug 2023 04:57:21 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1691643453; x=1691902653; bh=BNGYFL2gWYfMLYv7yrmkSSk9weq8yOSQ53SkT37I8xk=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=iVG50UaL8j98dT3B3YMZuCnlzgYgKp+TeS6oDnCMk5iCY4U+TU5EwJ+XPqV8xfmkn pJA4Uruusq5B9XlVfgG5JKB66MKAMCca6uGkNOXrhLj8dEIJBgRgfor5V5xcS84RfG On/vBPsnB/4kObH2+EIF3akPVVU0663ChAQ3btWYhUQjOE0JkAsPtd8S4EUSsmSwaX SS1sThDvvGZZ/S3YCrozWKCdw0rtp9gOEWGFh3lDcqBQYqt1K8xdcvPD0LQN036O+g UjAExgjpLtb0B6FVWYrIcWE4fa5WCO0R48zNI6r7V1WfLPiGHuEEC+eH9YIEsAHJJ+ dFzupJ7GhvKrw==
To: "openpgp\\@ietf.org" <openpgp@ietf.org>
From: Bart Butler <bart+ietf@pm.me>
Message-ID: <tRZRo921VOFJoLvZr2x339zTS1UNiy2_3HfjFffLQXVLSfokJkcjjReebHFWWlVnlhHJxqcxdbjz37lJp_NgBbnLGOC9n8s1PGi88ACH2sA=@pm.me>
In-Reply-To: <f83eda56-e695-4dfd-827d-4a7a57368a8b@kuix.de>
References: <48be3fcf-cdce-9ef4-655b-63b6dddf9310@kuix.de> <87a5v1j4xo.fsf@wheatstone.g10code.de> <db447915-fc25-4759-879e-b64020c0ec0e@kuix.de> <87zg31hoee.fsf@wheatstone.g10code.de> <ba560bb0-0fa5-40a2-b70d-83f36859e17e@metacode.biz> <87v8dphmec.fsf@wheatstone.g10code.de> <17a06888-8516-457f-8ef3-85b7c77ce2f6@kuix.de> <srngUaHAVOOvcLAVlV4Dzd70XCfUJfCOYoWkVIMWpIhurQ_0c7aTBHAKPanjhbaYxBSMDZ8BawhaLKKkfcP5lUWVT6TwkSjkhEvG8P3tigA=@pm.me> <f83eda56-e695-4dfd-827d-4a7a57368a8b@kuix.de>
Feedback-ID: 5683226:user:proton
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha256"; boundary="------f43bb82aff1ec4cbc6267bbd5af776ca3a0d6615bd68ec2f8b22efc9a6ec0702"; charset="utf-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/3ZkqNJvY4RLc5SUkMc2gbZPhLtc>
Subject: Re: [openpgp] Put Signature in an Email's Header
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: Thu, 10 Aug 2023 04:57:40 -0000

Yes, the idea was to have one multipart/mixed section and have potentially N signature headers inserted between marker position 1 and 2. There would be no modification or MTA insertion of anything else below marker position 2.

But after looking at your examples and thinking about it I think the encapsulation approach you suggested would be better, as then there’s a clear line between what is signed and what isn’t and I think that would be much cleaner and easier on implementors as we could maintain the existing logic from PGP/MIME for computing signature data over whole MIME sections. I think an additional MIME layer is a strength here.

On Wed, Aug 9, 2023 at 10:56 AM, Kai Engert <kaie@kuix.de> wrote:
On 08.08.23 19:06, Bart Butler wrote:
> Why not take a page out of DKIM’s book and just put the signature
> header(s) in the protected headers directly, maybe at the top,
> except exclude only that header from the signed data if present? Seems
> like that would also be backwards compatible with existing PGP/MIME if
> you wanted to sign both ways as well.

You mean like the following?

The app creating the message would take this as the input for signature
calculation:

Content-Type: multipart/mixed; boundary="prot-hdr";
protected-headers="v1"
<all protected headers>
--prot-hdr
payload
--prot-hdr--

Then the signature is inserted ...

<outer headers>
Content-Type: multipart/mixed; boundary="prot-hdr";
protected-headers="v1"
-- marker-position 1
Header-Signature: micalg=pgp-sha256;
protocol="application/pgp-signature"; sigdata=
wsF5BAABCAAjFiEEIdFuZ...
=9HqM
-- marker-position 2
<all protected headers>
-- marker-position 3
--prot-hdr
payload
--prot-hdr--

If "multipart/mixed protected-headers" is the outermost content-type,
are MTAs allowed to add additional headers at
marker positions 1, 2 or 3 ?

Then it would ambiguous for the receiver to decide which data to use as
input for the signature verification.

Kai