Skip to content

Commit

Permalink
fix: CMW description (#143)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Fossati <[email protected]>
  • Loading branch information
thomas-fossati authored Nov 16, 2024
1 parent f86ca9f commit d3e052f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
4 changes: 2 additions & 2 deletions cddl/cmw-collection.cddl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
json-collection = {
? "__cmwc_t": ~uri / oid
+ &(label: text) => json-CMW / c2j-tunnel
+ &(label: text) => json-cmw / c2j-tunnel
}

cbor-collection = {
? "__cmwc_t": ~uri / oid
+ &(label: (int / text)) => cbor-CMW / j2c-tunnel
+ &(label: (int / text)) => cbor-cmw / j2c-tunnel
}
6 changes: 3 additions & 3 deletions cddl/cmw-start.cddl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
start = cmw

cmw = json-CMW / cbor-CMW
cmw = json-cmw / cbor-cmw

json-CMW = json-record / json-collection
cbor-CMW = cbor-record / cbor-collection / $cbor-tag
json-cmw = json-record / json-collection
cbor-cmw = cbor-record / cbor-collection / $cbor-tag
2 changes: 1 addition & 1 deletion cddl/eat-start.cddl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Claims-Set = {
"cmw" => json-CMW
"cmw" => json-cmw
* (int / text) => any
}
37 changes: 21 additions & 16 deletions draft-ietf-rats-msg-wrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,28 @@ defined in {{-rats-arch}}.
This document reuses the terms defined in {{Section 2 of -senml-cf}}
(e.g., "Content-Type").

# Conceptual Message Wrapper Encodings
# Conceptual Message Wrappers

A RATS Conceptual Message Wrapper (CMW) has a tree structure of leaves that contain payload messages associated with their content type.
The two leaf node types are:

1. A CMW using a CBOR or JSON record ({{type-n-val}});
1. A CMW based on CBOR tags ({{cbor-tag}}).
* A CMW using a CBOR or JSON record ({{type-n-val}});
* A CMW based on CBOR tags ({{cbor-tag}}).

Intermediate tree nodes are either:

1. A CMW "collection" type that holds together multiple CMW items ({{cmw-coll}});
1. A CMW "tunnel" type that allows transporting CBOR CMWs in JSON collections and vice-versa ({{cmw-tunnel}}).
* A CMW "collection" type that holds together multiple CMW items ({{cmw-coll}});
* A CMW "tunnel" type that allows transporting CBOR CMWs in JSON collections and vice-versa ({{cmw-tunnel}}).

The collected CDDL is in {{collected-cddl}}.
The following snippet outlines the productions associated with the top-level types.

~~~ cddl
{::include cddl/cmw-start.cddl}
~~~

The complete CDDL can be found in {{collected-cddl}}.

{{webtokens}} and {{x509}} describe the transport of CMWs using CBOR and JSON Web Tokens and PKIX messages, respectively.

This document only defines an encapsulation, not a security format.
It is the responsibility of the Attester to ensure that the CMW contents have the necessary security protection.
Expand All @@ -187,7 +195,6 @@ The format of the CMW record is shown in {{fig-cddl-record}}.
The JSON {{-json}} and CBOR {{-cbor}} representations are provided separately.
Both the `json-record` and `cbor-record` have the same fields except for slight differences in the types discussed below.


~~~ cddl
{::include cddl/cmw-record.cddl}
~~~
Expand Down Expand Up @@ -224,7 +231,6 @@ both Reference Values and Endorsements within the same `application/signed-corim
shared by different conceptual messages.
Future specifications may add new values to the `ind` field; see {{iana-ind-ext}}.


## CMW CBOR Tags {#cbor-tag}

CMW of type CBOR Tag derive their tag numbers from a corresponding CoAP Content-Format ID using the `TN()` transform defined in {{Appendix B of RFC9277}}.
Expand Down Expand Up @@ -277,7 +283,6 @@ Since the collection type is recursive, implementations may limit the allowed de
{: #fig-cddl-collection artwork-align="left"
title="CDDL definition of the CMW collection format"}


CMW itself provides no facilities for authenticity, integrity protection, or confidentiality.
It is the responsibility of the designer for each use case to determine the necessary security properties and implement them accordingly.
A secure channel (e.g., via TLS) or object-level security (e.g., using JWT) may suffice in some scenarios, but not in all.
Expand Down Expand Up @@ -347,7 +352,7 @@ func CMWTypeDemux(b []byte) (CMW, error) {
}
~~~

# Transporting CMW in COSE and JOSE Web Tokens
# Transporting CMW in COSE and JOSE Web Tokens {#webtokens}

To facilitate the embedding of CMWs and CMW collections in CBOR-based protocols and web APIs, this document defines two `"cmw"` claims for use with JSON Web Tokens (JWT) and CBOR Web Tokens (CWT).

Expand Down Expand Up @@ -542,6 +547,12 @@ The following example shows the use of the `"cmw"` JWT claim to transport a CMW
{::include cddl/eat-example-1.json}
~~~

# Collected CDDL {#collected-cddl}

~~~ cddl
{::include cddl/collected-cddl-autogen.cddl}
~~~

# Implementation Status

This section records the status of known implementations of the protocol
Expand Down Expand Up @@ -816,12 +827,6 @@ IANA is requested to assign an object identifier (OID) for the ASN.1 Module defi

--- back

## Collected CDDL {#collected-cddl}

~~~ cddl
{::include cddl/collected-cddl-autogen.cddl}
~~~

# Registering and Using CMWs

{{fig-howto-cmw}} describes the registration preconditions for using
Expand Down

0 comments on commit d3e052f

Please sign in to comment.