Re: [COSE] [EXTERNAL] Re: [SCITT] SCITT receipts as COSE V2 countersignatures

Maik Riechert <Maik.Riechert@microsoft.com> Wed, 05 October 2022 14:21 UTC

Return-Path: <Maik.Riechert@microsoft.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BB4AEC14CF09; Wed, 5 Oct 2022 07:21:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.681
X-Spam-Level:
X-Spam-Status: No, score=-7.681 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.571, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=microsoft.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 oF1Acc2taAxZ; Wed, 5 Oct 2022 07:21:43 -0700 (PDT)
Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2094.outbound.protection.outlook.com [40.107.22.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7BCE4C14CF06; Wed, 5 Oct 2022 07:21:43 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oEXf/aoQN723LZLXl3YeLGMJr1sR5ImMbW+8B+DKvu3DgnPN6oG3EtbRO1wk/edLSzHYxglbVmVd6qPLMtUzUZYR0z8rW1xCcCclUwefP80c1a+JREl2cZCIDPH9cZe4X/JJr81GDoPx8vFyt5AhaWib6Y16HWIVdTQLNH1V+gEOgDwrR5Ym4ZPVOAnliAaDpnWwxXvMWX0qJQeVbi04e0uZ6yrpL+2KBj6mtLpdevWEXbRvZz0bonpahiuUIbzlZp7iPffs3R8Auwx94Khmb2IDMUlPWs+YI1baH39y8/AW5Jwna9iS4zv2gGYUAs+zmfzQR0WwBZtRO/ZiNIsPqQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DzZNOr9nGGQJbg7Z+5QfP5x02xmloeyQi6nzZn187Sk=; b=BdBGhgVVNp7K9QEt+8gud07vDLVZ9KrLoB3dnO+goA/pDE1+jnHgUEbXcFUELfxpDrypmn1JGD6ggYAp4lUOzLJeb0p9qjRkyQXOrsUg91Ak8Oh4fJPDAOdY+C0564lA9KikdgcZH8CqV4rQV6Q8SnfYqxsfiljmPWClapruKf7vYoIP2+VMQRHMU/dsujME99EwXqdyXs2pSbe1MDBcc+IunN3QHvHBr6xH/TuzwQjLwJKgTH5GSiCHgBVTtlu0hh3eRqE7o0diw2dcLixmEWreYP+AEK8BDrP3P8/+oEwUy5yO7+jwIOBK9OvqBUoUyTuOgryTGJCgB+rOCjrj/A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DzZNOr9nGGQJbg7Z+5QfP5x02xmloeyQi6nzZn187Sk=; b=hWXfpheX5CIcXD5psmzw02XOpZgG65dHUpj+3AioOosgyi51O73EZO3Tl0xWiNFVVznSZ6bUn/msv2fdHd3L7jpCe4EMbcMV7cH+TR35TL58crMC3fvWKGeaAeluc/9YUF4BCh4lXEsN+ZFcXiv2UU+ZBXRm8kifVYAZWJS946c=
Received: from AS8PR83MB0501.EURPRD83.prod.outlook.com (2603:10a6:20b:29e::19) by PAXPR83MB0536.EURPRD83.prod.outlook.com (2603:10a6:102:246::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.8; Wed, 5 Oct 2022 14:21:37 +0000
Received: from AS8PR83MB0501.EURPRD83.prod.outlook.com ([fe80::7052:852a:b126:ad0a]) by AS8PR83MB0501.EURPRD83.prod.outlook.com ([fe80::7052:852a:b126:ad0a%7]) with mapi id 15.20.5709.008; Wed, 5 Oct 2022 14:21:37 +0000
From: Maik Riechert <Maik.Riechert@microsoft.com>
To: Ilari Liusvaara <ilariliusvaara@welho.com>, "scitt@ietf.org" <scitt@ietf.org>, "cose@ietf.org" <cose@ietf.org>
Thread-Topic: [EXTERNAL] Re: [SCITT] [COSE] SCITT receipts as COSE V2 countersignatures
Thread-Index: AdjX6LJ5TrwWRs3zTZyjrkQEFr/qtwAtQSUAAAbGy5A=
Date: Wed, 05 Oct 2022 14:21:37 +0000
Message-ID: <AS8PR83MB050167B726A6F871DFD3446FF75D9@AS8PR83MB0501.EURPRD83.prod.outlook.com>
References: <AS8PR83MB05017C84CBB825904F03C2C5F75A9@AS8PR83MB0501.EURPRD83.prod.outlook.com> <Yz1PukiRfPryoHA4@LK-Perkele-VII2.locald>
In-Reply-To: <Yz1PukiRfPryoHA4@LK-Perkele-VII2.locald>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=042c2a99-97ab-461c-97c0-c5d192b0dff0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-10-05T12:48:52Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AS8PR83MB0501:EE_|PAXPR83MB0536:EE_
x-ms-office365-filtering-correlation-id: 6a850e05-4bba-4419-61b7-08daa6dcea27
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: FoL8fpd742eZQ78R++NIB5aD9FHTAgehAGIH1jsyCTy8S/7edPbgZ17ezQGUSL1D4i147QX7mGFV29GKaN7UEiY1kYl/8J4UQbXwOntsLS9epDM8yomkB6qFU7+QqaA44/t817qj3c7/0G4o6XEToA+2Y0wtsHKtMojHfZaZ6dOeWDRwhDwzTei3TmZ0N6eW3rSiUk4hzRSqYN2ZyxMzHxklc5pkppQ09WIWDVV+dTV0PlW2PAf5hB3rUt67lMJpOHKRDuzQwx42I31tkZ23kmyQ11LzZZfzEmchBpSdh0BoFZcfzvuFeWotenzKrZp8Wfwh20VGoF4m3NIHcZX1wL9r6apN06cRSubptEAFegDvjY6Cez//NAMi0KDfI5s9/gxM4URhbit6uXT2fTHb7XZBqVHAMx/8RnPwwEyJDlG7+arZ7a9EiGV55PBb9EpMQlH8HGRw3ap35QFiTGkNV/VdgA5nxVodfbSEpnT8gsFUqhxvOf4PsJCoQlqgpLwDl/MWLq6g59qlaHzmlejq9QhbR4xGOlSF9zrjBU8QuSvJP5nQuiMUwPpsKgqb+HekD+JqtTJ9g7HRoj+HIL71kx9hi/ieOe8zmbB0vcxmnErULO44UZ71e48iuQd1MWtm2kpmaPfuGL4Sr9osBcJ5Rv9Dy/NWhk6YM7AKOOBHnA79rGyX5nKgBg9+rl4z2oKHE2+AXlejUaJAtTt5fqh0tGBSkYTJW2j1oXSuXdsbeA2ZpF8iZdYEH8ClVcEHa8VHoQdQ4OizVLIjCEVsxE/h1tFfjE/AP/htFzE2ydTrDvLNrvbS7VxaXF/vf7wXuoEvyVu4bDb2ieatZ1Dv0X3NnaZ4dTDPTNxFbp/t3mb0yYcBxpiST1m3JGg1+FEioHU0
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR83MB0501.EURPRD83.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(376002)(346002)(136003)(39860400002)(396003)(451199015)(55016003)(38070700005)(8676002)(8990500004)(41300700001)(33656002)(2906002)(86362001)(9686003)(122000001)(82950400001)(26005)(7696005)(82960400001)(53546011)(38100700002)(6506007)(66556008)(10290500003)(478600001)(71200400001)(316002)(966005)(66476007)(8936002)(66446008)(66946007)(30864003)(52536014)(110136005)(5660300002)(76116006)(64756008)(186003)(83380400001)(66899015); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: HWvMkt+c0Z0pOUxnsXSEpTLCoJ8Fq+pgv1M3xQ/WbAGRGLAJbNjkq2IMKEzI1bgqy/wY6pjpUNng1gAFSt2W6NjyluVtK9dnG7FltZ+K6M21dl1u58hUhm3YsuCG6Lt6GUUha6I8KM7iilSm4ot9KKXJpqSluOj9FAn7PUxpfPMAIKbm8uX8xqGNF2lRlzSu9MLOfrKEcEz9C8f3EoXLsO4h1AdCVrb74MLU3np+b/lV+u4iYK74Palb+/5uRp9Rk4636mbaG7vgCG/JM1Ji6j48nqRzftwCBb0KPhl0DQbuS8rtlvAwyrKT5O9epM9+I4NgnfDvrB+ZcJxkh1P57s6FC5o8G4carYv1+bW8JskKmGvJJerAsnftNGU58+Mvy3vRAEsfPzxeh460/5kBZ0bwK6rfrNOV7b31wsSInRN8u1YFevoZR2Kdti8p97hG2VXDoXl2iD8D48VdBprYPKkRR3jmYS95re2voTgog/sEWzm6QLemW/Fo+eox/QGDTxStT5HeO/Jv54I2dNRUSeqwBPEDOylB7Qp9SHhfXuVM24nkMkljjeQ1MYmZlFxs9Ltoi77QUjJ1yuq5XJCK+D90QPEL4cqjI46b3gdYmFFoDdnEK/GYTgvPECQmGyTfWoeTqAAV55l8Wh4nJp5nYD3eL3f3V0RklXP6750vGq23c6malbbx1XqSTb0O9Rxo6Ls2K5QsyGLBzi1iFK3hOG0wwLMLYanXOn4+DZ07686ir7mRrIzwFmzUctKel76Di0+Nv0yLnct1nc4ZYXwIKLrs/56wwBl1gW0MfpoFgdDQkjEnRd/czEcHWjXFKhtAdlKAcSmAwvoJJ4ecUzDaMxBQc6nPVKbfeY5nRz7dw6X24XXjsw1Be9eNguYOd9sdGYXHoGcHxxR0dvY3C3WqT/s9H1pQ74hAAP0+yzZEsJm+jdN4mRJqxGzuntVAncyLDuq610HklM9bFqeifFzmxTgZXuX2R7LvqPZyVyPI95qZLXycrp+/CaRo+IAE86yiBydvlxo1ValWePDZdkIoPcFLfvoTk3I582WfRKGe7iLPCy/Igi9IuVhLZ90ZjggoIUsTL6IJWt5QRGR0364aUWkJjPuLzpwg8a32m+id8qHWN/ioyrDmiDOfJwj+zqY6Ul30M/xwb9Jj/3TZi0g2WNNdvhcorD/DWbLNbBKXqUrWsUj0Gas771xBorUcINC4nZL+X/ZI52VxFRQDsEwhA2qQ2J8ZQHkcxFLuSbgW76rG6IChTRy4ABkDTNfn9NOOcnO4pNAfLMIZp5+EKA7INtUkvDluy5yyWFlBdY78wXi15EeKucCViq1eoGKVUMWf9yMcgquF+q+6BWqPt3LYDe9c8pCC6jBZKcU4DUjd4GEddFgtYldKRFV3mwoUJWkQVYcntL8lMzpCagvnG58IfSPJbwk8VmRggXjNyIRp4lSFURu0JGHqcw7lahz5up0HufCCorHgYvnPnbrBRTk0tXr0JUWaAORW0KVZZjD+nO1H/6Iwulbu9zHpmxePfMQvrMEs/u4/zZYucZ1HxbFt3ZMolZdi38jlwoY9x3nzMNcWn+gI6QIPMO4Zh57GyxeW
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AS8PR83MB0501.EURPRD83.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6a850e05-4bba-4419-61b7-08daa6dcea27
X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2022 14:21:37.7343 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: j9gCGwKLWMljDTkTsONd/AgGt7rjEO1Axp49duQsGm7EQVRaKF4nCiOseR7xg586rcFVCfvkUw6Lz/BGKetoFw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR83MB0536
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/8dujVzQ6CuWVCFYqxweZR5wkO1M>
Subject: Re: [COSE] [EXTERNAL] Re: [SCITT] SCITT receipts as COSE V2 countersignatures
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 05 Oct 2022 14:21:44 -0000

Let me address your points in a question/answer style (hopefully covering your points well enough).

Q: Is this all application-specific?
In the current spec (https://www.ietf.org/archive/id/draft-birkholz-scitt-receipts-01.html) we tried to have a minimal generic top-level structure (3.) and then depending on the "tree algorithm" an inner application-specific / tree-specific structure, currently with a single one defined to support CCF-compatible implementations. 

Q: Is a COSE algorithm always a cryptographic primitive?
Likely. I'm assuming this is where some of the pushback comes from, as we would regard SCITT-CCF-ES256 as a cryptographic primitive in that sense, even though it is not.

Q: Why not use COSE_Sign1 to sign the Merkle tree root?
In an ideal world, this would be my preference as well. This issue is that existing ledger/log implementations, as far as I know, don't allow to change how the root is signed, and typically they sign the root hash directly, not as COSE_Sign1 or other envelope.

Q: Why put common/root-type attributes in the leaf protected header?
You're right, this is unexpected and can be regarded as a little wasteful. I consider it a compromise resulting from the constraint that the root is not signed with its own protected header, or that at least we can't generally expect that. Moving the root-type metadata into the leaf (like service_id) duplicates it across leaves.

Q: Why use X.509 with COSE?
Yes, COSE is more common in constrained environments which may or may not use X.509, but in general I don't see this as an issue given https://datatracker.ietf.org/doc/html/draft-ietf-cose-x509-08.

Q: What exactly is in inclusion_proof?
In CCF, an inclusion proof is the sequence of (hash, direction)-tuples which is just another style that doesn't rely on knowing the tree size and leaf number.

Q: Do leaves get signed individually?
No, at least not in CCF, and to the best of my knowledge also not in certificate transparency. In CCF, a node signs the root, and that node's certificate is endorsed by the service. There's no double signing or unwrapping needed during verification.

Q: Why is this a countersignature?
Good question. We were looking at SCITT as a "notary public" that applies some checks on the signed document (signature verification and other acceptance policies), files it (store in a transparency log), and applies its own signature as confirmation that this happened. I would conceptually regard this as a countersignature.
Whether this should be a COSE V2 countersignature (with new signature algorithm) is another question. It may not be a good idea, and a new structure that we call receipt can conceptually still be a countersignature but technically be something new that supports the semantics of SCITT better. In either case, we would still allow the outcome to be embedded in the unprotected header of the original signed document. 


In general, the goal is to allow various implementations of SCITT, not all of which will be based on CCF. Trying to find a balance between application-specific parts and common structures is the challenge here.

-----Original Message-----
From: SCITT <scitt-bounces@ietf.org> On Behalf Of Ilari Liusvaara
Sent: Mittwoch, 5. Oktober 2022 10:35
To: scitt@ietf.org; cose@ietf.org
Subject: [EXTERNAL] Re: [SCITT] [COSE] SCITT receipts as COSE V2 countersignatures

[You don't often get email from ilariliusvaara@welho.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

On Tue, Oct 04, 2022 at 12:00:27PM +0000, Maik Riechert wrote:
> Hi all,
>
> In the SCITT community call yesterday we had a discussion on receipts
> (https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdat
> atracker.ietf.org%2Fdoc%2Fhtml%2Fdraft-birkholz-scitt-receipts-01&amp;
> data=05%7C01%7CMaik.Riechert%40microsoft.com%7Cdce4f9f3fd5142f84d4408d
> aa6b4e609%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638005594257681
> 553%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTi
> I6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&amp;sdata=F9oh12NDgaTxCTh0Mn%
> 2FieWkGQ6PxSre5%2FDk%2FSm9k%2BiY%3D&amp;reserved=0)
> and whether they should be represented as standard COSE V2 
> countersignatures (https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdatatracker.ietf.org%2Fdoc%2Fhtml%2Fdraft-ietf-cose-countersign&amp;data=05%7C01%7CMaik.Riechert%40microsoft.com%7Cdce4f9f3fd5142f84d4408daa6b4e609%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638005594257681553%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&amp;sdata=mdN%2Bu%2FaH5vOyUDC%2BevklTmg1TwznSSiTXMmYzG8j%2BkA%3D&amp;reserved=0).
>
> The current receipt format's CDDL is as follows:
>
> [
>   service_id: tstr
>   contents: any
> ]
>
> where `contents` depends on the "tree" algorithm (with the requirement 
> that it has to contain a protected header somewhere in it) identified 
> via parameters associated to the service_id. Currently there is only a 
> single tree algorithm (based on a CCF ledger implementation) where the 
> CDDL is as follows:
>
> [
>     signature: bstr
>     node_certificate: bstr
>     inclusion_proof: [+ ProofElement]
>     leaf_info: [
>      internal_hash: bstr
>      internal_data: bstr
>      protected: bstr .cbor {
>        issuedAt: uint
>      }
>     ]
>   ]

As note, the "node_certificate" seems to be defined as X.509 certificate. X.509 is enormously complex. And furthemore, the draft looks to be using X.509 keys for signing with COSE, which is very questionable thing to do.

And then looking at the structures, it looks like this only allows for two-length certificate chain? If so, this thing looks like it could be simplified a lot.

And from presence of inclusion_proof field, I presuem this is intended to be some sort of synchronous batch signature. However, the inclusion proof looks odd: This seems to be modelled after Certificate Transparency. However, in addition to node hashes, CT needs leaf index and tree size to construct its inclusiong proof.
[+ ProofElement] would look to be just node hashes.


> In order to support more schemes around key discovery (e.g., DID), it 
> makes sense to move the protected header to the front and make it part 
> of the common top-level structure:

I do not see how this makes sense. The protected header is leaf attributes, which belong together with the leaft itself. While top- level structure would seem to be about the the root.


> The new `contents` would then look like this:
>
<...>
>
> If you then squint a bit more, you can re-imagine this as a COSE V2
> countersignature:

I do not see this being any kind of countersignature. To me it looks like a normal signature on constructed piece of data.

It might be useful to use detached signatures: Have enough information in unsigned receipt to construct the to-be-signed for the tree root signature, and then sepearatedly store the protected headers for the root signature and the signature value for the root signature.

Yes, this allows malleability with root used, but I do not see that is a problem. I don't think that could even be eliminated without signing each leaf separatedly (Certificate Transparency does not eliminate it even with leaf signatures).


> For the CCF tree algorithm, this would equate to `alg` being a new 
> identifier (e.g., "SCITT-CCF-ES256") and the signature being the 
> `contents` structure wrapped as bstr.

Is this application-specific versions of algorithms? I do not see how this could lead to anything else than enormous amounts of excess complexity. Application-specific signature algorithm is already plenty bad, this seems much worse than that.

And I can say that, if I was a DE, I definitely would not approve this.


> Russ raised concerns that carrying all of the additional bits in the 
> signature bytes may be hard to justify when it comes to registration 
> of the new signature algorithm in COSE's IANA registry. There seems to 
> be precedent though, for example 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdata
> tracker.ietf.org%2Fdoc%2Fhtml%2Frfc8778&amp;data=05%7C01%7CMaik.Rieche
> rt%40microsoft.com%7Cdce4f9f3fd5142f84d4408daa6b4e609%7C72f988bf86f141
> af91ab2d7cd011db47%7C1%7C0%7C638005594257681553%7CUnknown%7CTWFpbGZsb3
> d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7
> C2000%7C%7C%7C&amp;sdata=U142Mic9YK9TH24bmWsJNz29t3TIgNh%2FSFixO58hYlA
> %3D&amp;reserved=0 where for Leighton-Micali the signature value (see 
> 2.2) is a structure containing a leaf number, an LM-OTS signature, a 
> type code indicating a subalgorithm, and a tree path from leaf to 
> root.

I do not see that as a precedent: Only the cryptographic primitive sees the substrucutre. Anything above, be it COSE or anything else does not see there being any substructure.


> We discussed two alternatives: 1. Keeping it a separate format 
> specific to SCITT. 2. Establishing receipts as new COSE message type, 
> though this may be more challenging.

What I think would be a third option, a message containing roughly the following. But I would not be surprised if I was missing something why nothing like this could work:


- protected headers from root COSE_Signature0
- attached COSE_Signature0 over node COSE_Key (using headers if
  needed)
- Root timestamp
- Tree size
- Leaf pseudo-index (left/right choices on path from root, these might
  not be unique: E.g. p-i 3 in RFC 9162 s. 2.1.5.)
- Inclusion proof hashes
- leaf protected headers (including timestamp and possible hash salt)
- leaf data
- signature from root COSE_Signature0


To recover the data for root signature:

- Any extra attributes are already in protected headers.
- Root timestamp from dedicated field.
- Tree size from dedicated field.
- The root hash can be computed from leaf hash and proof hashes, with
  leaf pseudo-index telling if to combine left or right in each step.
- Leaf hash can be calculated from leaf protected headers and leaf
  data.
- Key can be obtained by verifying the signature on node key and
  unwrapping the signature.


This does not use countersignatures or multi-signatures, only the most basic COSE signature mode. It is essentially a simplified form of Certificate Transparency (e.g., dropping leaf signatures by assuming synchronous root signing). Consistency proofs work like in CT.



-Ilari

--
SCITT mailing list
SCITT@ietf.org
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Fscitt&amp;data=05%7C01%7CMaik.Riechert%40microsoft.com%7Cdce4f9f3fd5142f84d4408daa6b4e609%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638005594257681553%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&amp;sdata=3Rp2aB7Ma99RjW3ZHuJpIpQ1uXt8cLwwdXz8cFbKaaw%3D&amp;reserved=0