Re: [COSE] Proposal for multiple keys / signatures in CBOR Certificates

Michael Richardson <mcr+ietf@sandelman.ca> Mon, 26 September 2022 16:27 UTC

Return-Path: <mcr@sandelman.ca>
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 C57F8C14F728 for <cose@ietfa.amsl.com>; Mon, 26 Sep 2022 09:27:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.909
X-Spam-Level:
X-Spam-Status: No, score=-6.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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
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 WFoz4UJPYBHh for <cose@ietfa.amsl.com>; Mon, 26 Sep 2022 09:27:37 -0700 (PDT)
Received: from relay.sandelman.ca (relay.cooperix.net [176.58.120.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 55AECC14F613 for <cose@ietf.org>; Mon, 26 Sep 2022 09:27:36 -0700 (PDT)
Received: from dooku.sandelman.ca (unknown [89.246.252.107]) by relay.sandelman.ca (Postfix) with ESMTPS id 14C551F489; Mon, 26 Sep 2022 16:27:35 +0000 (UTC)
Received: by dooku.sandelman.ca (Postfix, from userid 179) id 741EB1A074B; Mon, 26 Sep 2022 18:27:32 +0200 (CEST)
From: Michael Richardson <mcr+ietf@sandelman.ca>
To: Derek Atkins <derek@ihtfp.com>, cose@ietf.org
In-reply-to: <cd7203f430896369ac39a6d435604447.squirrel@mail2.ihtfp.org>
References: <cd7203f430896369ac39a6d435604447.squirrel@mail2.ihtfp.org>
Comments: In-reply-to "Derek Atkins" <derek@ihtfp.com> message dated "Mon, 26 Sep 2022 10:19:14 -0400."
X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 27.1
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg="pgp-sha512"; protocol="application/pgp-signature"
Date: Mon, 26 Sep 2022 18:27:32 +0200
Message-ID: <131063.1664209652@dooku>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/_qjINGqFVdaT-JQez_069fcPxPA>
Subject: Re: [COSE] Proposal for multiple keys / signatures in CBOR Certificates
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.39
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: Mon, 26 Sep 2022 16:27:41 -0000

Derek Atkins <derek@ihtfp.com> wrote:
    > We are happily using the (currently draft) CBOR Certificates object in
    > our code, but we're getting closer to having a requirement where a

To be clear, you are talking about certificates encoded in CBOR, and for
which the signature is calculated over the CBOR. i.e. _Natively signed C509 certificates_

    > My straightforward proposal, which keeps some amount of backwards
    > compatibility (in the sense that the TBSCertificate still has the same
    > number of top-level entries), would be to modify this to allow either a
    > singleton or an array for subjectPublicKeyAlgorithm, subjectPublicKey,
    > issuerSignatureAlgorithm, and issuerSignatureValue.  At a higher level,
    > the restriction that both subjectPublicKeyAlgoritihm and
    > subjectPublicKey must contain the same number of items and in the same
    > order, and both issuerSignatureAlgorithm and issuerSignatureValue must
    > contain the same number of items and in the same order.

So, this might be backwards compatible to the draft, it would not be 1:1 with
X509 format certificates.  I guess that you are alright with this, but I
think for the community, that might be a big step.

    > The benefit of this approach is that all signatures cover all keys and
    > all SignatureAlgorithm identifiers, so you cannot go back and add a new
    > signature method (downgrade attack).

    > Another benefit of this approach is that it requires only minimal
    > updates to existing parsers.  While it is true that a parser that
    > expects a single entry would fail with the array with multiple
    > Ids/Keys/Signatures, I don't see this as a bad thing because, most
    > likely, the recipient would want to be able to validate both
    > signatures.

Agreed.

    > Oh... Having thrown this out there, I am offering to write it up if
    > there is interest, either as a modification to the existing CBOR-Certs
    > draft, or a companion draft.

If we were further along with cose-cbor-encoded-cert, then I'd want to see it
as a new document.  It does not seem that we are in that place yet.
Still, it might be kinder to the reviewers of the current document if it were
a new draft.

-- 
Michael Richardson <mcr+IETF@sandelman.ca>, Sandelman Software Works
 -= IPv6 IoT consulting =-