Re: [Cbor] Review: draft-bormann-cbor-packed-00 & SUIT

Jim Schaad <ietf@augustcellars.com> Tue, 28 July 2020 17:19 UTC

Return-Path: <ietf@augustcellars.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A45BF3A0D79 for <cbor@ietfa.amsl.com>; Tue, 28 Jul 2020 10:19:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OXvEOw-mh2Gf for <cbor@ietfa.amsl.com>; Tue, 28 Jul 2020 10:19:03 -0700 (PDT)
Received: from mail2.augustcellars.com (augustcellars.com [50.45.239.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 03B3C3A0D61 for <cbor@ietf.org>; Tue, 28 Jul 2020 10:19:02 -0700 (PDT)
Received: from Jude (73.180.8.170) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 28 Jul 2020 10:18:53 -0700
From: Jim Schaad <ietf@augustcellars.com>
To: 'Brendan Moran' <Brendan.Moran@arm.com>, cbor@ietf.org
References: <5E28C6E2-DFEC-4AF5-96CE-75E8F0927818@arm.com>
In-Reply-To: <5E28C6E2-DFEC-4AF5-96CE-75E8F0927818@arm.com>
Date: Tue, 28 Jul 2020 10:18:51 -0700
Message-ID: <01d901d66503$2bbd93c0$8338bb40$@augustcellars.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_01DA_01D664C8.7F5F7F10"
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQKsAEWUoN/uCeZIyHWSgfhWse+x66dyBRBw
X-Originating-IP: [73.180.8.170]
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/3reqg5F8TGYjCxX57vkqsJKyP-s>
Subject: Re: [Cbor] Review: draft-bormann-cbor-packed-00 & SUIT
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jul 2020 17:19:06 -0000

 

 

From: CBOR <cbor-bounces@ietf.org> On Behalf Of Brendan Moran
Sent: Tuesday, July 28, 2020 8:25 AM
To: cbor@ietf.org
Subject: [Cbor] Review: draft-bormann-cbor-packed-00 & SUIT

 

I think that packed CBOR is a feature that’s very much needed. In fact, there’s a similar feature in SUIT. I’d rather get rid of SUIT’s deduplication system and use packed CBOR instead, but the timing may not work out. 

 

I’d like to reiterate some of things that were said in the discussion during the cbor meeting, and add some additional points.

 

The current encoding of #6.6([]) is not friendly to stream processing, nor to pull parsers. It is easier for this style of parser to have a dictionary first, followed by the rump. We could arrange to resolve this by replacing the rump in its entirety with a shared object reference, and encoding the actual rump as a shared object. This allows a pull parser to directly jump to the dictionary. If the “rump” is placed as the last shared object, a stream processor can use this abstraction to ensure that the rump is encountered only once the dictionary is received. So, this “concern” may be a no-op and may just require an implementation hint for addressing pull parsers.

 

 

SUIT has some peculiar requirements that might be relevant to the design of packed CBOR:

 

1. SUIT manifests would absolutely benefit from a mechanism to compress CBOR sequences. SUIT’s basic building block is arrays that are effectively multi-maps. Some of these multi-maps contain similar sequences of objects. It would be beneficial to be able to deduplicate the identical parts. 

 

2. SUIT would benefit from nested packed CBOR items. SUIT features elements that can be detached from each other in much the same way as COSE supports detached payloads. A SUIT envelope contains a manifest and zero or more severable (detached) elements. It would be preferable for packing to work like this: any element or sequence that appears at least once in the manifest and two or more times in the union of manifest and severable elements, should be placed in the dictionary for the manifest. Any element or sequence that appears two or more times in a severable element, but not in the manifest, should be placed in the severable element’s dictionary.

 

I believe that a suit-specific cbor packer could achieve this mechanism if nested packed CBOR data items were supported. SUIT does not appear to require more than a 





3. I suspect that SUIT would also benefit from domain-specific pre-shared dictionaries. I’d like to see some way of defining canonical dictionary merging: Are dictionaries concatenated? In which order are they concatenated? How should a domain-specific pre-shared dictionary be included in a signed context? By digest?

 

[Brendan] One of the questions that I have is the order of compressing and applying security operations.  If you are using a pull parser do you think it is going to be easier (we can talk about more secure later) to do the hashing on the compressed or uncompressed version.  This could be an even harder question to ask with the use of an external dictionary.  There is one potential benefit w/ COSE in that the hash of the dictionary could be included as external data.

 

Jim

 

 

 

Best Regards,

Brendan

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.