[jose] To be covered topic? draft-tschofenig-jose-cose-guidance

Ken Takayama <ken.takayama.ietf@gmail.com> Thu, 25 July 2024 03:55 UTC

Return-Path: <ken.takayama.ietf@gmail.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0817EC1DA1F8; Wed, 24 Jul 2024 20:55:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.108
X-Spam-Level:
X-Spam-Status: No, score=-7.108 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 jzVqncI7bD3r; Wed, 24 Jul 2024 20:55:40 -0700 (PDT)
Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9571CC14F5E6; Wed, 24 Jul 2024 20:55:40 -0700 (PDT)
Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3d92e65752dso821470b6e.1; Wed, 24 Jul 2024 20:55:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721879740; x=1722484540; darn=ietf.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=dYXv1R3YMujBtQSVfux4zEktvGR5OqKTvn0Tiw0kGwc=; b=A3EcGAcCEZG5dlwAPLIxgIEw3T1ZjHrsMkzcnf0TOKt3H6WX5MX7FsizANvyfeLk6J pdEr6IUE+9GN92ZAPSezap86AXm7N8HjJJmNmWplke7lUPr2qsyfjetpIQTqUH2Fs/Gz a5Y1tMiG4IvGvqzpJyxjunAMILAonW7CBSzLpDC9Y1Un/tXU8eabtJ6S3vXrLF45Qykr UgMwQiuN7lqSqdaP4W7iBXoJwrhfe+uRQfQW6ql5iciAaDvYcQ0fR6nErWO5p18gYk08 Y4TjViPbgELiwP5sT+H3utngl7+KHVYKNQVqKXyt5f57wrpcj0LpfsmzrTmKdDHOM8HG aTxQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721879740; x=1722484540; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dYXv1R3YMujBtQSVfux4zEktvGR5OqKTvn0Tiw0kGwc=; b=Ci2xxrM4Z3Qtp2cQmNzO9TynPbgEvgrghrqRVv+7mG88KXUXLwruV06akvYqmG7zNB k7CKfO1KGZQWy5TCUu9TaQRtfuihcznzgflK8A80KCQcXZtBIiEckN6y9i0a8kUcFKWf QybWmtPKtx4QVBJOYl53DzDy99gxVo9wJLMtUXV6qmM/Zs5kqksvdehkG4tj7fL8r+Du LWbJsQtFUk7LVznRcpBt6ltIlrGTnzJe1eCr+huMst42R4sLq2qpxT5VeCSZMF7rzfHn D1stfG+xkjAzfCnJEi4v7gMTBbHtk0bw36ECnT0q6l8MJ4+/u8VHkgrGF3xF4xG7qUY8 1FYA==
X-Forwarded-Encrypted: i=1; AJvYcCXR+0l3TOBXuYyOdr4WJaSbhT9byXOzKyic9vZBcmFSKpalbUYtebuamaSyR6Qxewnp2y4tbENH8c7btsAs
X-Gm-Message-State: AOJu0YzAbaUJKJi68c/kEwS0O8WDRURLAUljSjytpR7svDAu0q2YIMAw ucKJ2eMf8JfNi+9sQTbczqE20nqc2xdL8DctQhyYxGBej7E/vvLK4c6lk6vDGJYTxMT475HV+ZM Wlk9UkaPrQKqyjt+f7y8tjXDnWiaP5ar2
X-Google-Smtp-Source: AGHT+IFY/f6uH9IRbl7cUrmG8pOjqxROg3Ek7Sl6FPvv3xb6Mm5tuPPlefQL6gio0uWA770x1ijzoC13HCrFqcIRH4I=
X-Received: by 2002:a05:6808:159c:b0:3d9:dbe9:7cee with SMTP id 5614622812f47-3db09db0b40mr1923061b6e.14.1721879738810; Wed, 24 Jul 2024 20:55:38 -0700 (PDT)
MIME-Version: 1.0
From: Ken Takayama <ken.takayama.ietf@gmail.com>
Date: Thu, 25 Jul 2024 12:55:27 +0900
Message-ID: <CAOZByRDn4+NkJis=B10SvNb28cvn2KKFg1ZLOwCE2oCw=Y7bQQ@mail.gmail.com>
To: jose@ietf.org, cose <cose@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID-Hash: TR5ERMMKVSDYIOHAVGPNBYNHAPVARQOZ
X-Message-ID-Hash: TR5ERMMKVSDYIOHAVGPNBYNHAPVARQOZ
X-MailFrom: ken.takayama.ietf@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-jose.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Hannes Tschofenig <hannes.tschofenig@gmx.net>, lhazlewood@gmail.com, yaronf.ietf@gmail.com
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [jose] To be covered topic? draft-tschofenig-jose-cose-guidance
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/aJDBb6seBYkq3pMKOGMlJ_OtJOY>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Owner: <mailto:jose-owner@ietf.org>
List-Post: <mailto:jose@ietf.org>
List-Subscribe: <mailto:jose-join@ietf.org>
List-Unsubscribe: <mailto:jose-leave@ietf.org>

Dear JOSE and COSE folks, especially the authors,

When I read this document, I feel that only key identification is covered.
Here I listed several topics that might be better to be covered,
hoping some of them are helpful to you.


## Guidance for Protocol Designers

[JOSE, COSE] Cryptographic algorithm choice
- start from RECOMMENDED+ algorithms (for JOSE), then RECOMMENDED, Optional, ...
- asymmetric vs symmetric
  - sign vs mac
  - key distribution and content encryption algorithms
- reference: draft-ietf-suit-mti

[COSE] Rough code size of the library (and depending ones)
- they may help protocol designers to choose supported algorithms,
especially for COSE to be used in constrained devices

[JOSE?, COSE] Deterministic KDF input
- it is just a binary in the final state, but strongly affects
interoperability and security
- RFC 7518 JWA (JSON Web Algorithms) is more clear but AlgorithmID of
COSE_KDF_Context in RFC 9053 is ambiguous
- we may need to make it clear that each values of KDF input is from
the JOSE/COSE message, or decided by protocol designers, senders or
recipients

[JOSE, COSE] jwt/cwt vs uccs
- reference: draft-ietf-cose-uccs


## Recommendations for JOSE/COSE Implementers

These recommendations are mainly for library implementers because
- most implementers of senders and recipients want to use libraries
because they don't want to encode/decode JOSE nor COSE messages
- since library users have less knowledge of the payload wrapper, the
library interfaces should be designed carefully and provide some
security mechanisms

I assume that the library functions take three arguments to
encode/decode the messages: payload or COSE/JOSE message, key or its
material, and KDF input filled by the senders and recipients.

[JOSE, COSE] Implement alg parameter for jwk and COSE_Key
- encourage/force the users to use it to avoid misuse of the key
inside the library

[JOSE, COSE] Disable Prohibited/Deprecated algs by default
- enable them only with explicit request from the users
  - e.g. flag arguments, splitted functions, compiler options, etc.
- warn users the risk of using them, and navigate users to RFC 9459 for COSE

[JOSE, COSE] Construct KDF input inside the library as much as it can
- keydatalen, AlgorithmID and SuppPubInfo are derived from the JOSE
message, and Z (?) and SuppPrivInfo are filled by the library
- AlgorithmID, keyDataLength and protected are derived from the COSE message

Best,
Ken