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

Russ Housley <housley@vigilsec.com> Mon, 26 September 2022 19:58 UTC

Return-Path: <housley@vigilsec.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 19E96C14CE27 for <cose@ietfa.amsl.com>; Mon, 26 Sep 2022 12:58:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.908
X-Spam-Level:
X-Spam-Status: No, score=-6.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=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
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 APbrYc8vXgMN for <cose@ietfa.amsl.com>; Mon, 26 Sep 2022 12:58:50 -0700 (PDT)
Received: from mail3.g24.pair.com (mail3.g24.pair.com [66.39.134.11]) (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 60748C14F74D for <cose@ietf.org>; Mon, 26 Sep 2022 12:58:50 -0700 (PDT)
Received: from mail3.g24.pair.com (localhost [127.0.0.1]) by mail3.g24.pair.com (Postfix) with ESMTP id 59C2A11145A; Mon, 26 Sep 2022 15:58:49 -0400 (EDT)
Received: from a860b60074bd.fios-router.home (pool-108-56-234-133.washdc.fios.verizon.net [108.56.234.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail3.g24.pair.com (Postfix) with ESMTPSA id 43EEF111605; Mon, 26 Sep 2022 15:58:49 -0400 (EDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\))
From: Russ Housley <housley@vigilsec.com>
X-Priority: 3 (Normal)
In-Reply-To: <8e1b9e998a68bf7db0bf8f1fa5fe2ea9.squirrel@mail2.ihtfp.org>
Date: Mon, 26 Sep 2022 15:58:48 -0400
Cc: cose@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <47134C6D-7492-42C4-8CB1-332537F656DC@vigilsec.com>
References: <cd7203f430896369ac39a6d435604447.squirrel@mail2.ihtfp.org> <1B05EE1E-398B-4D88-ADA4-89884813D784@vigilsec.com> <957512e0554c67559427f40c22e0f743.squirrel@mail2.ihtfp.org> <8e1b9e998a68bf7db0bf8f1fa5fe2ea9.squirrel@mail2.ihtfp.org>
To: Derek Atkins <derek@ihtfp.com>
X-Mailer: Apple Mail (2.3445.104.21)
X-Scanned-By: mailmunge 3.09 on 66.39.134.11
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/nkhR3xgZkjFiFTgSYPeO40A3QFM>
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 19:58:54 -0000

https://datatracker.ietf.org/doc/draft-ounsworth-pq-composite-keys/

https://datatracker.ietf.org/doc/draft-ounsworth-pq-composite-sigs/

These were discussed at IETF 114, and some updates are in the works.  There will be a call for adoption in the LAMPS WG after the next version gets posted.

Russ


> On Sep 26, 2022, at 1:01 PM, Derek Atkins <derek@ihtfp.com> wrote:
> 
> Russ,
> 
> I just perused the LAMPS archives for the last 6 weeks (back to August 12)
> and do not see anything related to multiple keys and/or multiple
> signatures in a certificate.  Or at least none of the conversations or
> document titles are obviously on that topic.
> 
> Could you please point me to the discussion thread?
> 
> Thank you,
> 
> -derek
> 
> PS: I will say up front that I do not care about X509 here, I only care
> about native C509 certs.  But I do agree that the semantics should carry
> over if at all possible.
> 
> On Mon, September 26, 2022 12:41 pm, Derek Atkins wrote:
>> Thanks, Russ.
>> 
>> I am happy to move conversation over there..
>> 
>> -derek
>> 
>> On Mon, September 26, 2022 12:34 pm, Russ Housley wrote:
>>> This topic is being discussed on the LAMPS mail list.  The C509
>>> certificate has a one-to-one alignment with the X.509 certificate (see
>>> RFC
>>> 5280 for the syntax).  The answer here needs to keep that alignment, so
>>> I
>>> hope we can have the discussion on one mail list.
>>> 
>>> Russ
>>> 
>>> 
>>>> On Sep 26, 2022, at 10:19 AM, Derek Atkins <derek@ihtfp.com> wrote:
>>>> 
>>>> Hi all,
>>>> 
>>>> We are happily using the (currently draft) CBOR Certificates object in
>>>> our
>>>> code, but we're getting closer to having a requirement where a device
>>>> needs to support multiple PK Methods (think PQC).  To that end, we are
>>>> looking at a way to extend CBOR Certificates to allow for multiple
>>>> subjectPublicKey and multiple signature entries.
>>>> 
>>>> As a reminder, the current C509 structure is:
>>>> 
>>>>   C509Certificate = [
>>>>      TBSCertificate,
>>>>      issuerSignatureValue : any,
>>>>   ]
>>>> 
>>>>   TBSCertificate = (
>>>>      c509CertificateType: int,
>>>>      certificateSerialNumber: CertificateSerialNumber,
>>>>      issuer: Name,
>>>>      validityNotBefore: Time,
>>>>      validityNotAfter: Time,
>>>>      subject: Name,
>>>>      subjectPublicKeyAlgorithm: AlgorithmIdentifier,
>>>>      subjectPublicKey: any,
>>>>      extensions: Extensions,
>>>>      issuerSignatureAlgorithm: AlgorithmIdentifier,
>>>>   )
>>>> 
>>>> 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.
>>>> 
>>>> In CDDL this would boil down to:
>>>> 
>>>>   C509Certificate = [
>>>>      TBSCertificate,
>>>>      issuerSignatureValue : any / [ any, +any ],
>>>>   ]
>>>> 
>>>>   TBSCertificate = (
>>>>      c509CertificateType: int,
>>>>      certificateSerialNumber: CertificateSerialNumber,
>>>>      issuer: Name,
>>>>      validityNotBefore: Time,
>>>>      validityNotAfter: Time,
>>>>      subject: Name,
>>>>      subjectPublicKeyAlgorithm: AlgorithmIdentifier / [
>>>> AlgorithmIdentier, +AlgorithmIdentifier ],
>>>>      subjectPublicKey: any / [ any, +any ],
>>>>      extensions: Extensions,
>>>>      issuerSignatureAlgorithm: AlgorithmIdentifier / [
>>>> AlgorithmIdentier, +AlgorithmIdentifier ],
>>>>   )
>>>> 
>>>> I'm not a CDDL expert, so I do acknowledge that this specification does
>>>> not restrict the validation requirements of equivalent array lengths.
>>>> But
>>>> I'm not sure how one would actually encode that into CDDL.
>>>> 
>>>> 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.
>>>> 
>>>> The only alternate approach would be an extension, but I'm not sure how
>>>> you could have multiple signatures using that approach.
>>>> 
>>>> Any comments/suggestions?
>>>> 
>>>> 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.
>>>> 
>>>> Thanks,
>>>> 
>>>> -derek
>>>> 
>>>> --
>>>>      Derek Atkins                 617-623-3745
>>>>      derek@ihtfp.com             www.ihtfp.com
>>>>      Computer and Internet Security Consultant
>>>> 
>>>> _______________________________________________
>>>> COSE mailing list
>>>> COSE@ietf.org
>>>> https://www.ietf.org/mailman/listinfo/cose
>>> 
>>> 
>> 
>> 
>> --
>>       Derek Atkins                 617-623-3745
>>       derek@ihtfp.com             www.ihtfp.com
>>       Computer and Internet Security Consultant
>> 
>> 
> 
> 
> -- 
>       Derek Atkins                 617-623-3745
>       derek@ihtfp.com             www.ihtfp.com
>       Computer and Internet Security Consultant
> 
> _______________________________________________
> COSE mailing list
> COSE@ietf.org
> https://www.ietf.org/mailman/listinfo/cose