[Lake] CDDL in EDHOC RFC 9528

"Sipos, Brian J." <Brian.Sipos@jhuapl.edu> Wed, 16 October 2024 12:41 UTC

Return-Path: <Brian.Sipos@jhuapl.edu>
X-Original-To: lake@ietfa.amsl.com
Delivered-To: lake@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8E477C14F5FA for <lake@ietfa.amsl.com>; Wed, 16 Oct 2024 05:41:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.105
X-Spam-Level:
X-Spam-Status: No, score=-2.105 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, 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 (2048-bit key) header.d=jhuapl.edu
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 pP2owxhMv7i7 for <lake@ietfa.amsl.com>; Wed, 16 Oct 2024 05:41:55 -0700 (PDT)
Received: from aplegw02.jhuapl.edu (aplegw02.jhuapl.edu [128.244.251.169]) by ietfa.amsl.com (Postfix) with ESMTP id 27FE0C157937 for <lake@ietf.org>; Wed, 16 Oct 2024 05:41:54 -0700 (PDT)
Received: from pps.filterd (aplegw02.jhuapl.edu [127.0.0.1]) by aplegw02.jhuapl.edu (8.18.1.2/8.18.1.2) with ESMTP id 49GC1avJ014300 for <lake@ietf.org>; Wed, 16 Oct 2024 08:41:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jhuapl.edu; h=content-type : date : from : message-id : mime-version : subject : to; s=JHUAPLDec2018; bh=AhQ/ZCF9PXsBPcczcLIoKJ4WGxzPfmV7q5i18WYcQjo=; b=GTXwyS0HQWNyicySVjct9bbiE2zDX68d99IA6W7mlvWa/a3+GxWrFQ2X7S0oNbLU+A62 /MaWp+LkTYqyy7EunEkbWIRWVJzY3DgLecu8y3WH1w+4bvPJMrJdFnnRXJ0RIMWThlUR A/xYdYqyX1Sv4aVumi/593ku7trGr4HEfc8kW/dqrx1u26iAp3wEA0vsTwti3PGmK6hb OKAtdEe/IF3R0ylYzXWiHQnvHDJurF0SA5Ptk05T7iZycaoMilcx4XpHwNXDwdTOq9vg u8HhKHcROFjcQbgEz+/jhUHQz7Npkk7r8h55vApw4mcZhHz5FouIVJdFlBTl1GeZNSd+ gQ==
Received: from aplex20.dom1.jhuapl.edu (aplex20.dom1.jhuapl.edu [10.114.162.5]) by aplegw02.jhuapl.edu (PPS) with ESMTPS id 427nb0by9q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <lake@ietf.org>; Wed, 16 Oct 2024 08:41:53 -0400
Received: from APLEX21.dom1.jhuapl.edu (10.114.162.6) by APLEX20.dom1.jhuapl.edu (10.114.162.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 16 Oct 2024 08:41:53 -0400
Received: from APLEX21.dom1.jhuapl.edu ([fe80::20d7:9545:f01e:9b2]) by APLEX21.dom1.jhuapl.edu ([fe80::20d7:9545:f01e:9b2%5]) with mapi id 15.02.1544.011; Wed, 16 Oct 2024 08:41:53 -0400
From: "Sipos, Brian J." <Brian.Sipos@jhuapl.edu>
To: "lake@ietf.org" <lake@ietf.org>
Thread-Topic: CDDL in EDHOC RFC 9528
Thread-Index: AdsfyLvtAJW5fNKfRgOMqNCNiayP0Q==
Date: Wed, 16 Oct 2024 12:41:52 +0000
Message-ID: <81f2c377a6194222861b92e7371916cc@jhuapl.edu>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-originating-ip: [10.114.162.18]
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="SHA1"; boundary="----=_NextPart_000_0069_01DB1FA7.3ED33470"
MIME-Version: 1.0
X-CrossPremisesHeadersFilteredBySendConnector: APLEX20.dom1.jhuapl.edu
X-OrganizationHeadersPreserved: APLEX20.dom1.jhuapl.edu
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-16_10,2024-10-15_01,2024-09-30_01
Message-ID-Hash: UYF3MBBGGFFJ6SVVPVGSLOBQXSDO5I73
X-Message-ID-Hash: UYF3MBBGGFFJ6SVVPVGSLOBQXSDO5I73
X-MailFrom: Brian.Sipos@jhuapl.edu
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [Lake] CDDL in EDHOC RFC 9528
List-Id: Lightweight Authenticated Key Exchange <lake.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/lake/dDnAlC-Ju12LJJezrB5vtiK9nNc>
List-Archive: <https://mailarchive.ietf.org/arch/browse/lake>
List-Help: <mailto:lake-request@ietf.org?subject=help>
List-Owner: <mailto:lake-owner@ietf.org>
List-Post: <mailto:lake@ietf.org>
List-Subscribe: <mailto:lake-join@ietf.org>
List-Unsubscribe: <mailto:lake-leave@ietf.org>

All,

I have recently started work on an embedding of EDHOC which uses EAD to
negotiate some parameters along with the normal mutual authentication
sequencing. In doing so I have run into what it seems are typos in the CDDL
rules for EDHOC in Appendix C.2 [1]. Some of these seem like simple typos
and some are more complex. Two CDDL processing tools I'm trying to use are
both CLI, one from Rust crate [1] and one from a Ruby gem [2], so these and
the CDDL spec are my references for what is correct. I can write these up as
errata on RFC 9528 but want to check with the WG first.

 

The first set I ran into is the simple non-framed multiplicities for the EAD
similar t

    EAD_1 = 1* ead

where it seems like it should be of the form

    EAD_1 = (1* ead)

 

Another is the lack of a type within the `PLAINTEXT_2` group for the field
`C_R` which just seems like a simple omission.

 

Finally, there is the use of a type `map` within the ID_CRED_x fields, which
is not actually defined anywhere for CDDL. So I added a local definition

    map = #5

I'm not sure if that is the best way to handle this situation. Another
alternative would be something more CDDL-like

    { * any => any }

I don't think the two differ in what they will match but maybe the second
form is more tool-friendly?

 

As a suggestion for readability, I also think it's helpful to have a couple
of shared-type rules to make it obvious where different fields really do
share the same type. One for connection IDs (shared between `C_I` and `C_R`)
and one for credential IDs (shared between `ID_CRED_I` and `ID_CRED_R`) as
the following

    id_conn = bstr / -24..23

    id_cred = map / bstr / -24..23

 

Thanks for any feedback,

Brian S.

 

[1] https://www.rfc-editor.org/rfc/rfc9528.html#appendix-C.2

[2] https://crates.io/crates/cddl

[3] https://rubygems.org/gems/cddl