Re: [Ace] DTLS profile - Open points

Olaf Bergmann <bergmann@tzi.org> Thu, 27 May 2021 11:18 UTC

Return-Path: <bergmann@tzi.org>
X-Original-To: ace@ietfa.amsl.com
Delivered-To: ace@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2B64B3A196E for <ace@ietfa.amsl.com>; Thu, 27 May 2021 04:18:56 -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, RCVD_IN_DNSWL_BLOCKED=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 O2oq_D6Eh7Ig for <ace@ietfa.amsl.com>; Thu, 27 May 2021 04:18:51 -0700 (PDT)
Received: from gabriel-2.zfn.uni-bremen.de (gabriel-2.zfn.uni-bremen.de [134.102.50.19]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 837663A196C for <ace@ietf.org>; Thu, 27 May 2021 04:18:51 -0700 (PDT)
Received: from wangari.tzi.org (p5b36f986.dip0.t-ipconnect.de [91.54.249.134]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by gabriel-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4FrQLJ2PkPz316V; Thu, 27 May 2021 13:18:48 +0200 (CEST)
From: Olaf Bergmann <bergmann@tzi.org>
To: Marco Tiloca <marco.tiloca@ri.se>
Cc: =?utf-8?Q?G=C3=B6ran?= Selander <goran.selander@ericsson.com>, Carsten Bormann <cabo@tzi.org>, Stefanie Gerdes <gerdes@tzi.de>, Ludwig Seitz <ludwig.seitz@combitech.com>, Daniel Migault <daniel.migault@ericsson.com>, Loganaden Velvindron <loganaden@gmail.com>, ace@ietf.org
References: <78BB5F64-D76D-4BCD-8048-FDB47248680B@ericsson.com> <87cztknt20.fsf@wangari> <87wnrsmdd2.fsf@wangari> <346d0a43-7202-5e15-c2cb-60c165e62dce@ri.se>
Date: Thu, 27 May 2021 13:18:44 +0200
Message-ID: <875yz4mnl7.fsf@wangari>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ace/d86c5W0Tot9QmD4FDIBS3i_Pdhk>
Subject: Re: [Ace] DTLS profile - Open points
X-BeenThere: ace@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Authentication and Authorization for Constrained Environments \(ace\)" <ace.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ace>, <mailto:ace-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ace/>
List-Post: <mailto:ace@ietf.org>
List-Help: <mailto:ace-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ace>, <mailto:ace-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 27 May 2021 11:18:56 -0000

Hi Marco,

On 2021-05-22, Marco Tiloca <marco.tiloca@ri.se> wrote:


> On 2021-05-21 15:21, Olaf Bergmann wrote:

>>>      a) Clarify that the elements of the structure in Figure 9 of Section
>>>      3.3.2 have to follow that exact order. This ensures that the
>>> result and
>>>      its following encoding are deterministic. This can't be taken for
>>>      granted from a CBOR implementation building a CBOR map.
>> I do not see why we would need to mandate this order. Although this
>> could help with optimized parsers, it violates Postel's theorem and
>> therefore should be avoided IMO.
>>
>> (That we indeed might have to say in the document is whether duplicate
>> keys are allowed. As we are just using data represenations from other
>> sources such as COSE and the CBOR-OAuth mappings, I would expect these
>> specs to define the restrictions on the deterministic CBOR; I did not
>> check that, though.)
>
> ==>MT
> I initially interpreted that, by using the elements retrieved from the
> received Token, the RS had to rebuild and store exactly the same 
> serialization that the client will have later built and sent on the
> wire as "psk_identity".
>
> That would have required C and RS to agree on a canonical format of
> the CBOR map in Figure 9, to be sure that the "psk_identity" in 
> ClientKeyExchange can match with the same "psk_identity" that the RS
> rebuilt and stored after receiving the Token.
>
> Now my RS is storing as local lookup-label only the "kid" (rather than
> the whole "psk_identity" to expect on the wire). If the RS does so and 
> actually relies on the "kid" only as a local lookup-label, I agree
> it's not necessary to have a fixed order of "kty" and "kid" into
> "COSE_Key".

Exactly: The kid included in cnf.COSE_Key is supposed to be the index
into your lookup table to retrieve a previously uploaded access token.

>>>      c) In Section 3.3.2, the text before Figure 9 says: "This
>>> structure then
>>>      is included as the only element in the "cnf" structure that is
>>> used as
>>>      value for "psk_identity" as shown in Figure 9."
>>>
>>>          I think it should be clarified what "is used" actually
>>> means. This
>>>      can be either:
>> Commit be8ac2c now clarifies that the serialized CBOR structure is put
>> into the psk_identity (option i).
>
> ==>MT
> I thought the CBOR serialization should refer to the most outer
> structure as the one used as value of "psk_identity", i.e. the map 
> including the "cnf" element, also called "cnf structure".
>
> Then, still following the same functional approach of option (i), I
> think the text should actually say:
>
> OLD:
> The CBOR serialization of this structure then is included ...
>
> NEW:
> This structure then is included as the only element in the `cnf`
> structure, whose CBOR serialization is used as value for
> `psk_identity` as shown in ...
>
>
> Correct? To be even more clear, it would help to include after Figure
> 9 also the actual serialization used in "psk_identity" for that, which 
> should be:
>
> 0xA1 08 A1 01 A2 01 04 02 48 3D027833FC6267CE
>
> <==

Thanks. I have updated the text as suggested and included the actual
serialization. (See [1]).

[1] https://github.com/ace-wg/ace-dtls-profile/commit/608350c6a23a563263292d8b0f94f631a162f345)

> it seems anyway possible in Californium to be compliant with the spec

Good to hear that.

Grüße
Olaf