Re: [COSE] tstr values for kty, alg, crv, etc.

Jeremy O'Donoghue <jodonogh@qti.qualcomm.com> Tue, 10 August 2021 10:35 UTC

Return-Path: <jodonogh@qti.qualcomm.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 838733A0DB6 for <cose@ietfa.amsl.com>; Tue, 10 Aug 2021 03:35:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=qti.qualcomm.com
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 UdkJaoy24LLe for <cose@ietfa.amsl.com>; Tue, 10 Aug 2021 03:35:30 -0700 (PDT)
Received: from esa.hc3962-90.iphmx.com (esa.hc3962-90.iphmx.com [216.71.142.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 93C9C3A0DBF for <cose@ietf.org>; Tue, 10 Aug 2021 03:35:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qccesdkim1; t=1628591730; x=1629196530; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=zGCDd7l962U+RLXaJMRSl8s7KHIc9Fio1Tnb18fPX3c=; b=b+0YjaLv+Z2kEGXI/5XAsfJ0E1Tk96iQFYQZoAo6xvxiZ4sQ2kXEFHq6 iYjiBUYu5sHhRX2k7if4Cnr56zx1G8ucBkiKXU8bGxHhbhB95mG4rSEuH M+6te4EX0RiB2o/bEE0teZUl9GQHHBFeiAFR8535fsYRdQrmAVgC6jz9d g=;
Received: from mail-bn1nam07lp2044.outbound.protection.outlook.com (HELO NAM02-BN1-obe.outbound.protection.outlook.com) ([104.47.51.44]) by ob1.hc3962-90.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2021 10:35:28 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=APt97kfM8o/r9n1J1CLVZ/V0iE5dzJwvy74nlQZ31YB9mTUfDvldx0HWmPQJXVm2WllLnbIK8lJ6XNgpydmQUxTjwXEibwxBlKvyy/DTg/3ITbt848O10CPNJji1eKCjNmyr1Sq3YL+8KPgbWPpuce5ydMZj3DDpqRgmc8cOwHOAQgMQ4JebgGP8wEItfh7o/nDx+PBexPwNTdt3RdW3iDcEazTpHy2EihrL9feiP6uNF2zUVayDWaBLf4hL5wr906PaCvnSLYBstiqJTXLUv2GgVO8FpteN/FZYhCWTCbUoW8xAWNm5Oyh1s1KiUPYF1gW6tA0ykEjTwz/x1n7dQA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zqwm89lk1+DYjIXBhKKjDKg5sMTzc/UVwsYMV3/aIfE=; b=eHCKqYNc2hFEafcydcysHHovo09zJrEnhKJPVn0+YSKJNH0G9RJZF5u7+PMMxoeF4EvlZ61ijCFhIbAxdeKKlczR7BDyVF55eHkAGEy7q3gnWIkR7+RD/+WY9h7+TPSxclRBZe8JQ3JL6oCn66jcVMwYGoo0ZPd2/b+IGQOvaHQsMawP6HMh2Fcn6Bxf67CssZxyJUsV17gKDK43i6/GH+WgGFV1q5Wp8hvMTklUXmaLCbtpK+noElxJd4PEandls61Z/JAcRDlar8WE7IuPRlFIk0aHkBAcfJAyzhRLwFPSTMj9pHS4LklENMDxDw5nj2d4iRBgyR+HqTVZtAMJYw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=qti.qualcomm.com; dmarc=pass action=none header.from=qti.qualcomm.com; dkim=pass header.d=qti.qualcomm.com; arc=none
Received: from SA1PR02MB8349.namprd02.prod.outlook.com (2603:10b6:806:1e4::19) by SA2PR02MB7673.namprd02.prod.outlook.com (2603:10b6:806:143::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Tue, 10 Aug 2021 10:35:26 +0000
Received: from SA1PR02MB8349.namprd02.prod.outlook.com ([fe80::b0de:4d7f:8026:700e]) by SA1PR02MB8349.namprd02.prod.outlook.com ([fe80::b0de:4d7f:8026:700e%9]) with mapi id 15.20.4394.023; Tue, 10 Aug 2021 10:35:26 +0000
From: Jeremy O'Donoghue <jodonogh@qti.qualcomm.com>
To: Laurence Lundblade <lgl@island-resort.com>, Michael Richardson <mcr+ietf@sandelman.ca>
CC: Carsten Bormann <cabo@tzi.org>, AJITOMI Daisuke <ajitomi@gmail.com>, "cose@ietf.org" <cose@ietf.org>
Thread-Topic: [COSE] tstr values for kty, alg, crv, etc.
Thread-Index: AQHXinNJ0EA1kX2PHkyA9AVXlK/fr6tl6gmAgALHMQCAAJRSAIAAPC8AgAIXGYCAAAqKgIAA4LEi
Date: Tue, 10 Aug 2021 10:35:26 +0000
Message-ID: <SA1PR02MB83499E7A77BA35BC28D8DC53F2F79@SA1PR02MB8349.namprd02.prod.outlook.com>
References: <CAFWvErXkR1vVNQFjn+rVCe8jaJ7DspBUq5kVJdGzonBU98Ctbw@mail.gmail.com> <78EB5028-71BD-4034-A9B3-340E206F1F90@tzi.org> <10529.1628538225@localhost>, <CE55A0F1-96FA-4298-BF2E-731B9E49F485@island-resort.com>
In-Reply-To: <CE55A0F1-96FA-4298-BF2E-731B9E49F485@island-resort.com>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: island-resort.com; dkim=none (message not signed) header.d=none;island-resort.com; dmarc=none action=none header.from=qti.qualcomm.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 7b8a4fbf-5935-4d7d-2f58-08d95bea9115
x-ms-traffictypediagnostic: SA2PR02MB7673:
x-microsoft-antispam-prvs: <SA2PR02MB7673E2AA5E856DE7164153ADF2F79@SA2PR02MB7673.namprd02.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: rkqoaUYXmhaYvaQP0Wlp8AYRX1CKtlN7RMB4s08DL0AEMS+2khG3v9Mk6IEH5ByumYc+Vmw0fQAY3ji4u2S3qnXDa5PbX4I2eUXMU1Awm8kKwYUzbF7M+IN0z9MjHBhPCtGhCmBohDqiFROj0O+Y4Fgz3bESnZ+ce2kUFGunKGC5wI2LW8+akpXgO+/8LKDXvWZDY9vkkvy4kijC4SDBUgO/KTj+bXGzR9jDZHoCvHB8VSC1jPdYTXZblCVLHr492++nB/wgZIIu2dvcPilvKyvxBOp7IEO8QJSqcS/jUUkmNcRWurRKKIshha9qJ3q4tgYmAImZweHmgrT4PX1NNdKJlmkBD/EBo7vBAg2CT6HZd6FGMYN4sOedXxFtOMweJ6ZnMdzsJZbY5pkv910f39+JJG1IFy1UU/7PvvzIGwWRDz1nIE2mm1Om9920PZeSw6x3cvNbeQ59iduHpQSz+/27ARW007gLXQ1j+NoH768LJTuA+wCvGU1USMFXIvStTg8pe8UTzQQqjNlMZg7N3lEy2wCvLed+rBnZKmjKZAZCgh1YxcJBZV/pgVWJhI3zofsQDMx1eXxRxLpwPOjhG33K4Yag3oZaHZp7dfkMgOHg4JqdRRSeIJEQUuviavuAiDzvThzx5JxWbZzPaIyxJy3IbA1Oo+YJq8YqRMT43Xw6RI3jriPlss8Wlx/hqBBl7pImDfBsa3a15QlZIjX5JQ==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR02MB8349.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(66446008)(66556008)(64756008)(66476007)(91956017)(76116006)(66946007)(9686003)(478600001)(55016002)(2906002)(71200400001)(33656002)(4326008)(86362001)(38070700005)(5660300002)(6506007)(53546011)(8676002)(316002)(8936002)(110136005)(7696005)(54906003)(122000001)(38100700002)(52536014)(186003); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 3SEzBiyqN6H+TDs9BRf+ndOu6tb6UsCzIJ2WxmR7q2xpSiL9NJkrdO9593BdOGDZhHI21Rtn56zMYrHj9Eyo2zEmrjNanr9aaUUEaSAW4TfwQ9/Raf2ngByxrvbjpRK4AIEG8ygh3u6VYg31zPbSJY8xwcOpb3oNhQGS1D4+sgzbk63dwF5F60LYAksvVw7sIvLU8urNBEc8v0uvOBk6rKI9iuujfRLzDnjEAAh9CMHgoxMEx3hIus+w6azMn8htoWHCodEU/O1Jcm1x0FXtgZqE/59EtHw3jrS9c877Trj7OAJiOkiIyZT8tAXCiaY+JO30LA7m3gjnGuhpr9gt9ANdXlqKo3jZ0Ae33Zny+Tf/CqsssPLaKhNlTtZYgRmu8NTHYngwMEIS60Xcc3cG69iFqjSNPBQJ/gydepThHBN61IduEt6Ae/YgQdfZXGFKEBVaO85u6yvhfmCWwZsxVCgv8R9l0F4t2S2NcEkHM7pxHMDW5KhoQgq9+dF+x87dzZzwBI7x6jhiSa01Fq1MKX0xr+ze0zZwBM7fFNRpJLDtzDe6Uvo0wb7kHmdxqRIk1foeB5WMSvJzFF1YHGdENOjfKHZJwDRc1g4LvKr/CkRxkKpzXoaUCxfg1mnLya4qcKhr7vscDYNSC94X+c7DbwjiFdGUkO0BkN+P/s3z3lA4SgmLrdmmT7bLtH56LrCxvjVyupqCJ3E/BYJDFf6+J69wQ54eO559fcqaC6p9vo456vdOuqQqzwwBU8GIqZHF6NUSPqvKqXwjs5uqlCSolpldx19KxBTa1LQhIx3Nnf80RzuVm+PwKuYB1aa6vEUDWMButi37JsKX8EJFQyO8z1PQZt5fxvEGg7YYX8lHV4GBnldeUmJi92OW4cLt+9lVLkISFbXf7r4snkCFBCUEGvqFuBoKHHX5LXPOKDdZoVWetf+HZx51F5iZ4FTk0aNdSny/hRPYD/dTI+VQ/Bkfe2TalVz/G9+tjt5xZEbC4QEUg4ctZwcl0vSV0JbyEViMjt/HMT1vXyk1vp0EphFyWQUhGGnz0kujqKw8mEbU9MK8wD3jnjy4cuIliVeztg46TezKKI8O1LvQKxibd3WkCr3zVrxjfuXzV3dAlR2nbw42PBELjcrU3M83jsvzZBeuFrFMSce9NdHThdlHKM1m7dTO8CWJt5mr9axzwPg6BgNTFiPtl5BflS+bNn1+lvE3PrSCqLGXOZJ9dD7PU1VKj+1+wH0L9bOUjsPQk7rSLNZSjvdGemjQND+ycyDE7IoInmZIhGLAzWplYBNFzJK4SKwkBJvQxp7ZNTSaqRkIpQ3weMfVXUCwaVLxlQCPjsAtoJEoNsaP+tsb4eqpNuYNqfWfhACVI1UYvTa22FO+OP5kcCsd/8A8nzIkYdvc65QcF8ytofcNJmz0R0uFlC8JBg==
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_SA1PR02MB83499E7A77BA35BC28D8DC53F2F79SA1PR02MB8349namp_"
MIME-Version: 1.0
X-OriginatorOrg: qti.qualcomm.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR02MB8349.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7b8a4fbf-5935-4d7d-2f58-08d95bea9115
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Aug 2021 10:35:26.2502 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 98e9ba89-e1a1-4e38-9007-8bdabc25de1d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: d0ZQrUNhdWRulJLOzo4JlLRKMRnCOSWZ+s9EM/qsf32WinWDeMk4H5nNqWL9cvWRGiFLysDLFLkDVZdfv2OhSRfVwiGr1u0YphYuHkVjShA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7673
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/6Aolsp8fJRI8oxqHBr2MG8C-jVA>
Subject: Re: [COSE] tstr values for kty, alg, crv, etc.
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Aug 2021 10:35:37 -0000

On 09/08/2021, 21:21, "Laurence Lundblade" <lgl@island-resort.com> wrote:
On Aug 9, 2021, at 12:43 PM, Michael Richardson <mcr+ietf@sandelman.ca<mailto:mcr+ietf@sandelman.ca>> wrote:


Carsten Bormann <cabo@tzi.org<mailto:cabo@tzi.org>> wrote:

This discussion is all a bit short sighted to me. Sure, we can advise
against registering text labels now. But COSE has a long life with many
applications before it, some of which may be outside what you are
thinking about now. What’s the rush on disabling these?

I understood that some people think that we can encode the map key for 'kty'
as both 'kty' and also 1.

(section 7 of RFC8152)
[ditto alg and I think key_ops]

I'm not convinced the document says that.

[JOD] The document does not say that, but it requires careful reading to realise that this is not so.

I can certainly say that *I* made an error in my effort to implement a COSE library, and I am reasonably experienced in reading and interpreting standards text, so I believe it is an error others might make. The error was not “encode the map key as “kty” and also 1. That is completely clear from the CDDL. It was that it was not apparent without careful reading that the “Name” column in (for example) COSE Algorithms is descriptive only and the “value” column is the one containing allowed normative values.

I am prepared to accept that a reasonable outcome here is that “people should read the standards more carefully”, or even that “Jeremy should read standards more carefully”. It does seem that we are too late in document publishing process to do anything about this.

Agreed.

The CDDL allows only 1, 2, 3,...for the params defined in COSE, but allows tstr for future params.



   label = int / tstr



   COSE_Key = {

       1 => tstr / int,          ; kty

       ? 2 => bstr,              ; kid

       ? 3 => tstr / int,        ; alg

       ? 4 => [+ (tstr / int) ], ; key_ops

       ? 5 => bstr,              ; Base IV

       * label => values

   }

Essentially, I think anyone trying to register tstr COSE identifier or label should be asked if they really want to do that, is it really necessary to use a tstr instead of an int:  Are you just doing it because you are used to JSON? You know that most implementations don’t support tstr, right?

Also, to be clear, you don't register both a tstr and an int for a particular item. There are two ways of doing this, but not for an individual item. Having tstr ‘foo’ and int 42 both referring to the same item would actually require two registrations and would be the worst thing to do.

[JOD] Document doesn’t state that you do not register both a tstr and an int value. I do agree that you should not.

Perhaps a good way forward is Expert Review (whether with Standards Action or not) does not approve tstr values unless there is a very compelling reason why use of an integer is unreasonable or impossible. This, as I understand things, does not require any specification change, since it looks to be exactly within the scope of the existing Expert Review instructions.

Best regards
Jeremy