[Docs] [txt|pdf|xml|html] [Tracker] [Email] [Diff1] [Diff2] [Nits]

Versions: 00 01 02 03 draft-ietf-cose-x509

Network Working Group                                          J. Schaad
Internet-Draft                                            August Cellars
Intended status: Informational                         December 26, 2018
Expires: June 29, 2019


  CBOR Object Signing and Encryption (COSE): Headers for carrying and
                     referencing X.509 certificates
                       draft-schaad-cose-x509-03

Abstract

   The CBOR Encoded Message (COSE) structure syntax uses the COSE Key
   structure for placing keys in a message.  This document extends the
   way that keys can be identified and transported by providing
   parameters that refer to or contain X.509 certificates in messages
   and in the COSE Key structure.

   This document defines a set of hash algorithms for COSE.  These
   algorithms are needed in order to have X.509 certificates referred to
   by a thumbprint.

Contributing to this document

   The source for this draft is being maintained in GitHub.  Suggested
   changes should be submitted as pull requests at <https://github.com/
   cose-wg/X509>.  Instructions are on that page as well.  Editorial
   changes can be managed in GitHub, but any substantial issues need to
   be discussed on the COSE mailing list.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on June 29, 2019.





Schaad                    Expires June 29, 2019                 [Page 1]


Internet-Draft                 COSE X.509                  December 2018


Copyright Notice

   Copyright (c) 2018 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Requirements Terminology  . . . . . . . . . . . . . . . .   3
     1.2.  Open Questions  . . . . . . . . . . . . . . . . . . . . .   3
   2.  X.509 COSE Headers  . . . . . . . . . . . . . . . . . . . . .   3
   3.  X.509 certificates and static-static ECDH . . . . . . . . . .   6
   4.  Hash Algorithm Identifiers  . . . . . . . . . . . . . . . . .   7
     4.1.  SHA-2 256-bit Hash  . . . . . . . . . . . . . . . . . . .   7
     4.2.  SHA-2 256-bit Hash trucated to 64 bits  . . . . . . . . .   8
   5.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   8
     5.1.  COSE Header Parameter Registry  . . . . . . . . . . . . .   8
     5.2.  COSE Header Algorithm Parameter Registry  . . . . . . . .   8
     5.3.  COSE Algorithm Registry . . . . . . . . . . . . . . . . .   8
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .   9
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   9
     7.1.  Normative References  . . . . . . . . . . . . . . . . . .   9
     7.2.  Informative References  . . . . . . . . . . . . . . . . .   9
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  10

1.  Introduction

   In the process of writing [RFC8152] discussions where held on the
   question of X.509 certificates [RFC5280] and if there was a needed to
   provide for them.  At the time there were no use cases presented that
   appeared to have a sufficient set of support to include these
   headers.  Since that time a number of cases where X.509 certificate
   support is necessary have been defined.  This document provides a set
   of headers that will allow applications to transport and refer to
   X.509 certificates in a consistent manner.

   Some of the constrained device situations are being used where an
   X.509 PKI is already installed.  One of these situations is the 6tish



Schaad                    Expires June 29, 2019                 [Page 2]


Internet-Draft                 COSE X.509                  December 2018


   environment for enrollment of devices where the certificates are
   installed at the factory.  The [I-D.selander-ace-cose-ecdhe] draft
   was also written with the idea that long term certificates could be
   used to provide for authentication of devices and uses them to
   establish session keys.  A final scenario is the use of COSE as a
   messaging application where long term existence of keys can be used
   along with a central authentication authority.  The use of
   certificates in this scenario allows for key management to be used
   which is well understood.

   When [RFC8152] was written, there were no requirements for hash
   algorithms to be included in the algorithm registry.  The use of
   thumbprints to refer to X.509 certificates is defined in this
   document which requires the use of hash algorithms.  There have also
   been other working groups in the IETF that have expressed a
   requirement for hash algorithms to do have sections of content be
   provided by reference rather than including it in the main message.
   This document defines a set of hash algorithms for both of these
   purposes.

1.1.  Requirements Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP
   14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

1.2.  Open Questions

      Should we define an extended key usage?

      Are there any special certificate valiation text to be added?

      List of other hash algorithms to be added.

      Specific security considerations issues.

2.  X.509 COSE Headers

   The use of X.509 certificates allows for an existing trust
   infrastructure to be used with COSE.  This includes the full suite of
   enrollment protocols, trust anchors, trust chaining and revocation
   checking that have been defined over time by the IETF and other
   organizations.  The key structures that have been defined in COSE
   currently do not support all of these properties although some may be
   found in COSE Web Tokens (CWT) [RFC8392].




Schaad                    Expires June 29, 2019                 [Page 3]


Internet-Draft                 COSE X.509                  December 2018


   It is not necessarily expected that constrained devices will fully
   support the evaluation and processing of X.509 certificates, it is
   perfectly reasonable for a certificate to be assigned to a device
   which it can then provide to a relying party along with a signature
   or encrypted message, the relying party not being a constrained
   device.

   Certificates obtained from any of these methods MUST still be
   validated.  This validation can be done via the PKIX rules in
   [RFC5280] or by using a different trust structure, such as a trusted
   certificate distributer for self-signed certificates.  The PKIX
   validation includes matching against the trust anchors configured for
   the application.  These rules apply to certificates of a chain length
   of one as well as longer chains.  If the application cannot establish
   a trust in the certificate, then it cannot be used.

   The header parameters defined in this document are:

   x5bag:  This header parameters contains a bag of X.509 certificates.
      The set of certificates in this header are unordered and may
      contain self-signed certificates.  The certificate bag can contain
      certificates which are completely extraneous to the message.  (An
      example of this would be to carry a certificate with a key
      agreement key usage in a signed message.)  As the certificates are
      unordered, the party evaluating the signature will need to do the
      necessary path building.  Certificates needed for any particular
      chain to be built may be absent from the bag.

      As this header element does not provide any trust, the header
      parameter can be in either a protected or unprotected header bag.

      This header parameter allows for a single or a bag of X.509
      certificates to be carried in the message.

      *  If a single certificate is conveyed, it is placed in a CBOR
         bstr.

      *  If multiple certificates are conveyed, a CBOR array of bstrs is
         used.  Each certificate being in it's own slot.

   x5chain:  This header parameter contains an ordered array of X.509
      certificates.  The certificates are to be ordered starting with
      the certificate containing the end-entity key followed by the
      certificate which signed it and so on.  There is no requirement
      for the entire chain to be present in the element if there is
      reason to believe that the relying party will already have it.





Schaad                    Expires June 29, 2019                 [Page 4]


Internet-Draft                 COSE X.509                  December 2018


      As this header element does not provide any trust, the header
      parameter can be in either a protected or unprotected header bag.

      This header parameter allows for a single or a bag of X.509
      certificates to be carried in the message.

      *  If a single certificate is conveyed, it is placed in a CBOR
         bstr.

      *  If multiple certificates are conveyed, a CBOR array of bstrs is
         used.  Each certificate being in it's own slot.

   x5t:  This header parameter provides the ability to identify an X.509
      certificate by a hash value.  The parameter is an array of two
      elements.  The first element is an algorithm identifier which is a
      signed integer or a string containing the hash algorithm
      identifier.  The second element is a binary string containing the
      hash value.

      As this header element does not provide any trust, the header
      parameter can be in either a protected or unprotected header bag.
      For interoperability, applications which use this header parameter
      MUST support the hash algorithm 'sha256', but can use other hash
      algorithms.

   x5u:  This header parameter provides the ability to identify an X.509
      certificate by a URL.  The referenced resource can be any of the
      following media types:

      *  application/pkix-cert [RFC2585]

      *  application/pkcs7-mime; smime-type="certs-only"
         [I-D.ietf-lamps-rfc5751-bis]

      *  application/x-pem-file [RFC7468] Should we support a PEM type?
         I cannot find a registered media type for one

      As this header element implies a trust relationship, the header
      parameter MUST be in the protected header bag.
      The URL provided MUST provide integrity protection and server
      authentication.  For example, an HTTP or CoAP GET request to
      retrieve a certificate MUST use TLS [RFC5246] or DTLS.  If the
      certificate does not chain to an existing trust anchor, the
      certificate MUST NOT be trusted unless the server is configured as
      trusted to provide new trust anchors.  This will normally be the
      situation when self-signed certificates are used.

   The header parameters used in the following locations:



Schaad                    Expires June 29, 2019                 [Page 5]


Internet-Draft                 COSE X.509                  December 2018


   o  COSE_Signature and COSE_Sign0 objects, in these objects they
      identify the key that was used for generating signature.

   o  COSE_recipient objects, in this location they may be used to
      identify the certificate for the recipient of the message.

   +---------+-------+---------------+---------------------------------+
   | Name    | Value | value type    | description                     |
   +---------+-------+---------------+---------------------------------+
   | x5bag   | TBD4  | COSE_X509     | An unordered bag of X.509       |
   |         |       |               | certificates                    |
   |         |       |               |                                 |
   | x5chain | TBD3  | COSE_X509     | An ordered chain of X.509       |
   |         |       |               | certificates                    |
   |         |       |               |                                 |
   | x5t     | TBD1  | COSE_CertHash | Hash of an X.509 certificate    |
   |         |       |               |                                 |
   | x5u     | TBD2  | uri           | URL pointing to an X.509        |
   |         |       |               | certificate                     |
   +---------+-------+---------------+---------------------------------+

                        Table 1: X.509 COSE Headers

   Below is an equivalent CDDL [I-D.ietf-cbor-cddl] description of the
   text above.

   COSE_X509 = bstr / [ 2*certs: bstr ]
   COSE_CertHash = [ hashAlg: (int / tstr), hashValue: bstr ]

3.  X.509 certificates and static-static ECDH

   The header parameters defined in the previous section are used to
   identify the recipient certificates for the ECDH key agreement
   algorithms.  In this section we define the algorithm specific
   parameters that are used for identifying or transporting the senders
   key for static-static key agreement algorithms.















Schaad                    Expires June 29, 2019                 [Page 6]


Internet-Draft                 COSE X.509                  December 2018


   +-----------+------+--------------+------------------+--------------+
   | Name      | Valu | Type         | Algorithm        | Description> |
   |           | e    |              |                  |              |
   +-----------+------+--------------+------------------+--------------+
   | static    | TBD  | COSE_CertHas | ECDH-            | Thumbprint   |
   | key X.509 |      | h            | SS+HKDF-256,     | for the      |
   | thumbprin |      |              | ECDH-            | senders      |
   | t         |      |              | SS+HKDF-512,     | X.509        |
   |           |      |              | ECDH-SS+A128KW,  | certificate  |
   |           |      |              | ECDH-            |              |
   |           |      |              | SS+AES192KW,     |              |
   |           |      |              | ECDH-SS+AES256KW |              |
   |           |      |              |                  |              |
   | static    | TBD  | uri          | ECDH-            | URL for the  |
   | key X.509 |      |              | SS+HKDF-256,     | senders      |
   | URL       |      |              | ECDH-            | X.509        |
   |           |      |              | SS+HKDF-512,     | certificate  |
   |           |      |              | ECDH-SS+A128KW,  |              |
   |           |      |              | ECDH-            |              |
   |           |      |              | SS+AES192KW,     |              |
   |           |      |              | ECDH-SS+AES256KW |              |
   |           |      |              |                  |              |
   | static    | TBD  | COSE_X509    | ECDH-            | static key   |
   | key X.509 |      |              | SS+HKDF-256,     | X.509        |
   | cert      |      |              | ECDH-            | certificate  |
   | chain     |      |              | SS+HKDF-512,     | chain        |
   |           |      |              | ECDH-SS+A128KW,  |              |
   |           |      |              | ECDH-            |              |
   |           |      |              | SS+AES192KW,     |              |
   |           |      |              | ECDH-SS+AES256KW |              |
   +-----------+------+--------------+------------------+--------------+

                   Table 2: Static ECDH Algorithm Values

4.  Hash Algorithm Identifiers

   The core COSE document did have a need for a standalone hash
   algorithm, and thus did not define any.  In this document, two hash
   algorithms are defined for use with the 'x5t' header parameter.

4.1.  SHA-2 256-bit Hash

   Define an algorithm identifier for SHA-256.








Schaad                    Expires June 29, 2019                 [Page 7]


Internet-Draft                 COSE X.509                  December 2018


4.2.  SHA-2 256-bit Hash trucated to 64 bits

   This hash function uses the SHA-2 256-bit hash function as in the
   previous section, however it truncates the result to 64-bits for
   transmission.  The fact that it is a truncated hash means that there
   is now a high likelihood that collisions will occur, thus this hash
   function cannot be used in situations where a unique items is
   required to be identified.  Luckily for the case of identifying a
   certificate that is not a requirement, the only requirement is that
   the number of potential certificates (and thus keys) to be tried is
   reduced to a small number.  (Hopefully that number is one, but it can
   not be assumed to be.)  After the set of certificates has been
   filtered down, the public key in each certificate will need to be
   tried for the operation in question.  The certificate can be
   validated either before or after it has been checked as working.  The
   trade-offs involved are:

   o  Certificate validation before using the key will imply that more
      network traffic may be required in order to fetch certificates and
      do revocation checking.

   o  Certificate validation after using the key means that bad keys can
      be used and, if not carefully checked, the result may be used
      prior to completing the certificate validation.  Using unvalidated
      keys can expose the device to more timing and oracle attacks as
      the attacker would be able to see if the key operation succeeded
      or failed as no network traffic to validate the certificate would
      ensue.

5.  IANA Considerations

5.1.  COSE Header Parameter Registry

   IANA is requested to register the new COSE Header items in Table 1 in
   the "COSE Header Parameters" registry.

5.2.  COSE Header Algorithm Parameter Registry

   IANA is requested to register the new COSE Header items in Table 2 in
   the "COSE Header Algorithm Parameters" registry.

5.3.  COSE Algorithm Registry

   IANA is requested to register the following algorithms in the "COSE
   Algorithms" registry.






Schaad                    Expires June 29, 2019                 [Page 8]


Internet-Draft                 COSE X.509                  December 2018


   +------------+-------+--------------------+-----------+-------------+
   | Name       | Value | Description        | Reference | Recommended |
   +------------+-------+--------------------+-----------+-------------+
   | SHA-256    | TBD   | SHA-2 256-bit Hash | [This     | Yes         |
   |            |       |                    | Document] |             |
   |            |       |                    |           |             |
   | SHA-256/64 | TBD   | SHA-2 256-bit Hash | [This     | No          |
   |            |       | trucated to        | Document] |             |
   |            |       | 64-bits            |           |             |
   +------------+-------+--------------------+-----------+-------------+

6.  Security Considerations

   There are security considerations:

      Self-signed certificates and Trust Anchors

7.  References

7.1.  Normative References

   [I-D.schaad-cose-rfc8152bis-struct]
              Schaad, J., "CBOR Object Signing and Encryption (COSE) -
              Structures and Process", draft-schaad-cose-rfc8152bis-
              struct-00 (work in progress), August 2018.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC5280]  Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
              Housley, R., and W. Polk, "Internet X.509 Public Key
              Infrastructure Certificate and Certificate Revocation List
              (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008,
              <https://www.rfc-editor.org/info/rfc5280>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

7.2.  Informative References

   [I-D.ietf-cbor-cddl]
              Birkholz, H., Vigano, C., and C. Bormann, "Concise data
              definition language (CDDL): a notational convention to
              express CBOR and JSON data structures", draft-ietf-cbor-
              cddl-06 (work in progress), November 2018.



Schaad                    Expires June 29, 2019                 [Page 9]


Internet-Draft                 COSE X.509                  December 2018


   [I-D.ietf-lamps-rfc5751-bis]
              Schaad, J., Ramsdell, B., and S. Turner, "Secure/
              Multipurpose Internet Mail Extensions (S/MIME) Version 4.0
              Message Specification", draft-ietf-lamps-rfc5751-bis-12
              (work in progress), September 2018.

   [I-D.selander-ace-cose-ecdhe]
              Selander, G., Mattsson, J., and F. Palombini, "Ephemeral
              Diffie-Hellman Over COSE (EDHOC)", draft-selander-ace-
              cose-ecdhe-10 (work in progress), September 2018.

   [RFC2585]  Housley, R. and P. Hoffman, "Internet X.509 Public Key
              Infrastructure Operational Protocols: FTP and HTTP",
              RFC 2585, DOI 10.17487/RFC2585, May 1999,
              <https://www.rfc-editor.org/info/rfc2585>.

   [RFC5246]  Dierks, T. and E. Rescorla, "The Transport Layer Security
              (TLS) Protocol Version 1.2", RFC 5246,
              DOI 10.17487/RFC5246, August 2008,
              <https://www.rfc-editor.org/info/rfc5246>.

   [RFC7468]  Josefsson, S. and S. Leonard, "Textual Encodings of PKIX,
              PKCS, and CMS Structures", RFC 7468, DOI 10.17487/RFC7468,
              April 2015, <https://www.rfc-editor.org/info/rfc7468>.

   [RFC8152]  Schaad, J., "CBOR Object Signing and Encryption (COSE)",
              RFC 8152, DOI 10.17487/RFC8152, July 2017,
              <https://www.rfc-editor.org/info/rfc8152>.

   [RFC8392]  Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig,
              "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392,
              May 2018, <https://www.rfc-editor.org/info/rfc8392>.

Author's Address

   Jim Schaad
   August Cellars

   Email: ietf@augustcellars.com












Schaad                    Expires June 29, 2019                [Page 10]


Html markup produced by rfcmarkup 1.129d, available from https://tools.ietf.org/tools/rfcmarkup/