[Rats] Re: CBOR tag-identified subordinates in EAT and CMW
Carl Wallace <carl@redhoundsoftware.com> Tue, 08 October 2024 19:14 UTC
Return-Path: <carl@redhoundsoftware.com>
X-Original-To: rats@ietfa.amsl.com
Delivered-To: rats@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1BB3EC1CAE68 for <rats@ietfa.amsl.com>; Tue, 8 Oct 2024 12:14:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 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, MIME_QP_LONG_LINE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=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 (1024-bit key) header.d=redhoundsoftware.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 mJmNNP8PbnB8 for <rats@ietfa.amsl.com>; Tue, 8 Oct 2024 12:14:53 -0700 (PDT)
Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8DF2AC18DB80 for <rats@ietf.org>; Tue, 8 Oct 2024 12:14:53 -0700 (PDT)
Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-7acd7d9dbefso599215185a.3 for <rats@ietf.org>; Tue, 08 Oct 2024 12:14:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhoundsoftware.com; s=google; t=1728414892; x=1729019692; darn=ietf.org; h=content-transfer-encoding:mime-version:in-reply-to:references :thread-topic:message-id:cc:to:from:subject:date:user-agent:from:to :cc:subject:date:message-id:reply-to; bh=SrspBXvTtWeE0GbwbVHXP3a0bfkmug0Nl3tLFnQsAPI=; b=FkZn3CBbDWPGn1ADBqzejV/lUfSY+ejKBsogZRHLFjjOts9t0qCCEidJLmStlVqkJp HXcHRMwIzvWFuHOXoBeJJmSnkYfztCVR8OY22Hs4myB+GOWo/7jFD7k41VSUkBAx+dy7 4XtRIsqSNr2L3ZVYJ4QJ4O6ohWMcbJEbV6IT8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728414892; x=1729019692; h=content-transfer-encoding:mime-version:in-reply-to:references :thread-topic:message-id:cc:to:from:subject:date:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SrspBXvTtWeE0GbwbVHXP3a0bfkmug0Nl3tLFnQsAPI=; b=HlN1nadE5f4wQ/n+efWNtfD0twRPAlemUTygT0bYb/ddsl7EMBB8sd6C8zj5ESMKeY UKIQRRA6oFEM9th4Q3RXnbPoyQS1f0kwmQ8mi6U1KJPEZTcSoqFzIqkXRAZWmBLdxq4z pA49Uqd8upXzTiQ2vbISEUXQU3DzKtDYMA793q2eSdskrNiTIl+VCeuHxrWIbgpdOxvQ S4tmdg3KQq2G+buxK4ESIU9d767za+wz3CoHBN980X3xGztc/YAxmCmng6uVCafbWSrf y3A5ap5PVLo1hQEbP7X0deLOowsjMzStz8B6pocUhH+ppuVtL9ijNFmrR8u0MgfSKHGx eMgQ==
X-Gm-Message-State: AOJu0YwlLU3qbIg4AGF7+mef9wWuPvzZ5FTAezdmbfFIByuBQfYLyPsv Yy4h7f6Ix0k1tbIL47M4fj4AkRZu6gxW53CJgwrQU9+Y4zFH6ushxRBISoQU5Q4=
X-Google-Smtp-Source: AGHT+IEcNzXLYBZNClShPYClxH0nqPHjM1hVmWkTi5XPFu+Dpl/p6j0JZZywxBIQuhJEL5GBQfn8hw==
X-Received: by 2002:a05:620a:2909:b0:7ac:9aa1:b64d with SMTP id af79cd13be357-7ae6f49d9e6mr2575923685a.57.1728414892132; Tue, 08 Oct 2024 12:14:52 -0700 (PDT)
Received: from [192.168.4.77] (pool-96-255-232-167.washdc.fios.verizon.net. [96.255.232.167]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7ae7562d7f7sm380115985a.46.2024.10.08.12.14.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2024 12:14:51 -0700 (PDT)
User-Agent: Microsoft-MacOutlook/16.89.24092813
Date: Tue, 08 Oct 2024 15:14:51 -0400
From: Carl Wallace <carl@redhoundsoftware.com>
To: Thomas Fossati <thomas.fossati@linaro.org>, "lgl island-resort.com" <lgl@island-resort.com>
Message-ID: <9AA78B88-5184-4E3F-A817-D0C048F9B852@redhoundsoftware.com>
Thread-Topic: [Rats] Re: CBOR tag-identified subordinates in EAT and CMW
References: <1BB895C9-6FCE-44E6-BDF5-F46CD36C8142@island-resort.com> <CA+1=6ydEzT68ame2MYapQAZ8xXKyf31e+1r4eR3Y+-ZpX=Kovw@mail.gmail.com>
In-Reply-To: <CA+1=6ydEzT68ame2MYapQAZ8xXKyf31e+1r4eR3Y+-ZpX=Kovw@mail.gmail.com>
Mime-version: 1.0
Content-type: text/plain; charset="UTF-8"
Content-transfer-encoding: quoted-printable
Message-ID-Hash: N3F5KZRNTPWD326AMF2WYIZNL5NHT37G
X-Message-ID-Hash: N3F5KZRNTPWD326AMF2WYIZNL5NHT37G
X-MailFrom: carl@redhoundsoftware.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-rats.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: rats <rats@ietf.org>
X-Mailman-Version: 3.3.9rc5
Precedence: list
Subject: [Rats] Re: CBOR tag-identified subordinates in EAT and CMW
List-Id: Remote ATtestation procedureS <rats.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/rats/v-5agDO-9ZMcTDj_uAxhoTU4GEI>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rats>
List-Help: <mailto:rats-request@ietf.org?subject=help>
List-Owner: <mailto:rats-owner@ietf.org>
List-Post: <mailto:rats@ietf.org>
List-Subscribe: <mailto:rats-join@ietf.org>
List-Unsubscribe: <mailto:rats-leave@ietf.org>
Inline... On 10/8/24, 9:16 AM, "Thomas Fossati" <thomas.fossati@linaro.org <mailto:thomas.fossati@linaro.org>> wrote: hi Laurence, On Mon, 7 Oct 2024 at 21:31, lgl island-resort.com <lgl@island-resort.com <mailto:lgl@island-resort.com>> wrote: > [snip] > > EAT should probably say “the contents of $EAT-CBOR-Tagged-Token MUST > be a CBOR tag”, but it doesn’t. We maybe should fix that before EAT > publication. [CW] Initially, I was wondering if the syntax from CMW should be adopted along the prose you suggest (since that would put CDDL teeth behind it) but I am not sure, as described below. If you are on it, maybe also a small typographical fix: s/$EAT-CBOR-Tagged-Token/$CBOR-Tagged-Token/ since the CBOR-tagged token is not necessarily itself a EAT. [CW] This seems reasonable. > EAT chose to bstr wrap to allow for easier decoding implementations. > An advantage of bstr-wrapping something is that you can skip over it > if you don’t know what its format is. That’s kind of important for > plug-in formats. > > CMW sort of defines the socket $cbor-tag for this > > cbor-CMW = cbor-record / cbor-collection / $cbor-tag > cbor-tag<tn, $fmt> = #6.<tn>(bytes .cbor $fmt) > > Three comments: > > 1) Is the plug-in socket $fmt or $cbor-tag? I don’t think this CDDL > will validate because $cbor-tag is not the same as cbor-tag. No, this is valid CDDL: $cbor-tag (the socket) is implemented by (the generic) cbor-tag<tn, $fmt> [CW] I think naming fmt with a $ prefix is confusing. It's not a type socket, it's just a parameter for that macro definition. For example, the following flips a coin to decide whether to create a CBOR-based or "native" (i.e., bstr-wrapped binary blob) format: ```sh cat << 'EOF' | cddl - g 1 start = $cbor-tag [CW] Similarly naming a socket "$cbor-tag" and a macro "cbor-tag" is a bit confusing. There's still nothing that compels one to only stuff CBOR tags into $cbor-tag though the common naming creates that impression. $cbor-tag /= cbor-tag<1668576819, cbor-thing> $cbor-tag /= cbor-tag<1668576818, non-cbor-thing> cbor-tag<tn, $fmt> = #6.<tn>(bytes .cbor $fmt) [CW] The .cbor control "indicates that the byte string carries a CBOR-encoded data item." The "non-cbor-thing" type passed as $fmt suggests the type is not CBOR encoded. How can that be used with the .cbor control? We need a means of tagging non-CBOR encoded stuff (for example, DER encoded data). Maybe we need a pair of definitions: cbor-tagged-cbor<tn, fmt> = #6.<tn>(bytes .cbor fmt) cbor-tagged-data<tn> = #6.<tn>(bytes) [CW] This could be coupled with the addition of some MUST statement a la what Laurence proposed for EAT to require only CBOR tags be used with the $cbor-tag socket. cbor-thing = bstr non-cbor-thing = { &(eat_nonce: 10) => bstr .size (8..64) } EOF ``` <snip> > 3) The bstr wrapping should be of the combination of tag number and > tag content. The way it is written now, it is mandating that the > content of a subordinate token must be a bstr. That won’t work for > UCCS, because its tag content is a map. [CW] If non-CBOR is handled separately, then the cbor-tagged-cbor could be simplified to: cbor-tagged-cbor<tn, fmt> = #6.<tn>(fmt) This is working as intended: in CBOR tag-based CMWs using TN(), the tag content is consistently a bstr. The CMW "frontend" removes the bstr header and the "real" message buffer is dispatched to the type-specific decoder based on the tag number. [CW] Handling CBOR types this way is fine too, of course. Note that CBOR-Token-Inside-CBOR-Token is also making the choice of requiring bstr-wrapping, though there is no outer typing information which makes the situation is a bit more shaky. (One may argue that the types can be derived from the outer eat_profile, but there are still potentially ambiguous cases. So, I think it's safer to fix EAT and require a tag when plugging into that socket as you said above.) Going back to CMW, that's the processing required for TN()-derived tags. For UCCS (which already defines its own), Section 3.2.1 applies, i.e.: if you have a tag already no extra tagging is needed. I think the bug here is that Section 3.2.1 does not provide its own CDDL snippet for the complementary set of CBOR tags (i.e., those that aren't TN()-derived.) [CW] I'm not quite sure what you mean here unless you mean avoiding the bstr wrapper around CBOR types. <snip>
- [Rats] CBOR tag-identified subordinates in EAT an… lgl island-resort.com
- [Rats] Re: CBOR tag-identified subordinates in EA… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… lgl island-resort.com
- [Rats] Re: CBOR tag-identified subordinates in EA… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… lgl island-resort.com
- [Rats] CBOR tag content encoding in CMW [was: Re:… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… Carl Wallace
- [Rats] Re: CBOR tag content encoding in CMW [was:… Carsten Bormann
- [Rats] Re: CBOR tag content encoding in CMW [was:… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… Carl Wallace
- [Rats] Re: CBOR tag content encoding in CMW [was:… Henk Birkholz
- [Rats] Re: CBOR tag-identified subordinates in EA… Henk Birkholz
- [Rats] Re: CBOR tag content encoding in CMW [was:… Carsten Bormann
- [Rats] Re: CBOR tag content encoding in CMW [was:… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… Smith, Ned
- [Rats] Re: CBOR tag-identified subordinates in EA… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… Smith, Ned
- [Rats] Re: CBOR tag-identified subordinates in EA… Carl Wallace
- [Rats] Re: CBOR tag-identified subordinates in EA… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… Smith, Ned
- [Rats] Re: CBOR tag-identified subordinates in EA… Thomas Fossati
- [Rats] Re: CBOR tag-identified subordinates in EA… Smith, Ned
- [Rats] Re: CBOR tag-identified subordinates in EA… lgl island-resort.com
- [Rats] Re: CBOR tag-identified subordinates in EA… Thomas Fossati