RFC 9148

EST-coaps: Enrollment over Secure Transport with the Secure Constrained Application Protocol

๐Ÿ“… published April 2022, from ietf

RFC 9148: EST-coaps: Enrollment over Secure Transport with the Secure Constrained Application Protocol ๐ŸŽ€

  • Stream: Internet Engineering Task Force (IETF) ๐ŸŒธ
  • Category: Standards Track โœจ
  • Date: April 2022 ๐Ÿ“…
  • ISSN: 2070-1721
  • Authors:
    • P. van der Stok (Consultant) ๐Ÿ’œ
    • P. Kampanakis (Cisco Systems) ๐Ÿ’…
    • M. Richardson (SSW) ๐Ÿฆ‹
    • S. Raza (RISE Research Institutes of Sweden) ๐Ÿงš
  • Obsoletes / Updates: none listed in the header, so this one isn't replacing or updating any other RFC ๐Ÿ™ˆ

Abstract

Okay so, Enrollment over Secure Transport (EST) is the certificate provisioning protocol that runs over HTTPS ๐Ÿ”. A lot of low-resource devices use the lightweight Constrained Application Protocol (CoAP) for their message exchanges ๐Ÿ“. This document explains how to carry EST payloads over secure CoAP (called EST-coaps) ๐Ÿฆ‹. The result is that constrained devices can use the EST functionality they already know for provisioning certificates โœจ.


Status of This Memo

This is an Internet Standards Track document. ๐Ÿ’–

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It went through public review and got approved for publication by the Internet Engineering Steering Group (IESG). ๐Ÿ‘‘ Want more on Internet Standards? Check Section 2 of RFC 7841 ๐Ÿ“š.

Want the latest on this document's status, any errata, or how to send feedback? Head to https://www.rfc-editor.org/info/rfc9148 ๐ŸŒˆ.


Copyright (c) 2022 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) as they stand on the date this document was published. Read these carefully, bestie, because they spell out your rights and restrictions for this document ๐Ÿ“œ. Any Code Components pulled out of this document must include the Revised BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Revised BSD License describes ๐Ÿซถ.


Table of Contents

   1.  Introduction
   2.  Terminology
   3.  DTLS and Conformance to RFC 7925 Profiles
   4.  Protocol Design
     4.1.  Discovery and URIs
     4.2.  Mandatory/Optional EST Functions
     4.3.  Payload Formats
     4.4.  Message Bindings
     4.5.  CoAP Response Codes
     4.6.  Message Fragmentation
     4.7.  Delayed Responses
     4.8.  Server-Side Key Generation
   5.  HTTPS-CoAPS Registrar
   6.  Parameters
   7.  Deployment Limitations
   8.  IANA Considerations
     8.1.  Content-Formats Registry
     8.2.  Resource Type Registry
     8.3.  Well-Known URIs Registry
   9.  Security Considerations
     9.1.  EST Server Considerations
     9.2.  HTTPS-CoAPS Registrar Considerations
   10. References
     10.1.  Normative References
     10.2.  Informative References
   Appendix A.  EST Messages to EST-coaps
     A.1.  cacerts
     A.2.  enroll / reenroll
     A.3.  serverkeygen
     A.4.  csrattrs
   Appendix B.  EST-coaps Block Message Examples
     B.1.  cacerts
     B.2.  enroll / reenroll
   Appendix C.  Message Content Breakdown
     C.1.  cacerts
     C.2.  enroll / reenroll
     C.3.  serverkeygen
   Acknowledgements
   Contributors
   Authors' Addresses

1. Introduction โœจ

So, "Classical" Enrollment over Secure Transport (EST) [RFC7030] is the thing used for authenticated/authorized endpoint certificate enrollment (and optionally key provisioning) through a Certification Authority (CA) or Registration Authority (RA) ๐ŸŽ€. EST carries its messages over HTTPS ๐Ÿ”.

This document defines a brand-new transport for EST based on the Constrained Application Protocol (CoAP), because some Internet of Things (IoT) devices use CoAP instead of HTTP ๐Ÿฆ‹. So this spec uses DTLS [RFC6347] and CoAP [RFC7252] in place of TLS [RFC8446] and HTTP [RFC7230] ๐Ÿ’….

EST responses can be relatively large ๐Ÿ˜ญ, so this specification also uses CoAP Block-Wise Transfer [RFC7959]. That gives you a fragmentation mechanism for EST messages at the CoAP layer ๐Ÿงฉ.

This document also profiles EST so it only supports certificate-based client authentication. Neither HTTP Basic nor Digest authentication (as described in Section 3.2.3 of [RFC7030]) is supported ๐Ÿšซ. No cap, that's a strict vibe ๐Ÿ’€.

2. 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. ๐ŸŒŸ

Lowkey, a ton of the concepts in this document come straight from [RFC7030]. That means a lot of the text is directly traceable back to [RFC7030] ๐Ÿซถ.

3. DTLS and Conformance to RFC 7925 Profiles โœจ

okay bestie, this section is all about how EST-coaps lines up with the low-resource device profiles in [RFC7925] ๐Ÿฆ‹ EST-coaps can carry certificates and private keys ๐Ÿ”‘ Certificates show up as responses to (re-)enrollment requests or requests for a trusted certificate list. Private keys can show up as responses to a server-side key generation request, as described in Section 4.4 of [RFC7030] (and subsections) and discussed in Section 4.8 of this document.

EST-coaps depends on a secure transport mechanism that secures the exchanged CoAP messages ๐Ÿ”’ DTLS is one such protocol. No other changes are necessary for the secure transport of EST messages, so that part is giving simple ๐Ÿ’–

          +------------------------------------------------+
          |    EST request/response messages               |
          +------------------------------------------------+
          |    CoAP for message transfer and signaling     |
          +------------------------------------------------+
          |    Secure Transport                            |
          +------------------------------------------------+

                  Figure 1: EST-coaps Protocol Layers

In accordance with Sections 3.3 and 4.4 of [RFC7925], the mandatory cipher suite for DTLS in EST-coaps is TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 [RFC7251] ๐Ÿ‘‘ Curve secp256r1 MUST be supported [RFC8422], and this curve is equivalent to the NIST P-256 curve. After the publication of [RFC7748], support for Curve25519 will likely be required in the future by (D)TLS profiles for the Internet of Things [RFC7925]. the future is coming, bestie ๐ŸŒˆ

DTLS 1.2 implementations must use the Supported Elliptic Curves and Supported Point Formats Extensions in [RFC8422]. Uncompressed point format must also be supported ๐ŸŽ€ DTLS 1.3 [RFC9147] implementations are a little different from DTLS 1.2 because they do not support point format negotiation. Instead they go with a single point format for each curve. Thus, support for DTLS 1.3 does not mandate point format extensions and negotiation. Also, in DTLS 1.3, the Supported Elliptic Curves extension has been renamed to Supported Groups ๐Ÿงš

CoAP was designed to avoid IP fragmentation, and DTLS is used to secure CoAP messages. However, fragmentation is still possible at the DTLS layer during the DTLS handshake, even when using Elliptic Curve Cryptography (ECC) cipher suites ๐Ÿ’€ If fragmentation is necessary, "DTLS provides a mechanism for fragmenting a handshake message over a number of records, each of which can be transmitted separately, thus avoiding IP fragmentation" [RFC6347]. that's the DTLS glow-up ๐Ÿ“

The EST-coaps client authenticates the EST-coaps server using certificate authentication in the DTLS handshake. The EST-coaps client MUST be configured with at least an Implicit Trust Anchor database ๐Ÿงธ That lets it authenticate the server the first time, before it updates its trust anchor (Explicit TA) [RFC7030].

The authentication of the EST-coaps client MUST be with a client certificate in the DTLS handshake. This can either be:

  • A previously issued client certificate (e.g., an existing certificate issued by the EST CA). This could be a common case for simple re-enrollment of clients ๐Ÿ”
  • A previously installed certificate (e.g., manufacturer IDevID [IEEE802.1AR] or a certificate issued by some other party). IDevID's are expected to have a very long life, as long as the device, but under some conditions could expire. In that case, the server MAY authenticate a client certificate against its trust store, even though the certificate is expired (Section 9) ๐Ÿฅน

EST-coaps supports the certificate types and TAs that are specified for EST in Section 3 of [RFC7030] โœจ

As described in Section 2.1 of [RFC5272], proof-of-identity refers to a value that can be used to prove that an end entity or client is in possession of, and can use, the private key corresponding to the certified public key. Channel-binding information can also link proof-of-identity with an established connection ๐Ÿ”— Connection-based proof-of-possession is OPTIONAL for EST-coaps clients and servers. When proof-of-possession is desired, a set of actions are required regarding the use of tls-unique, described in Section 3.5 of [RFC7030]. The tls-unique information consists of the contents of the first Finished message in the (D)TLS handshake between server and client [RFC5929]. The client adds the Finished message as a challengePassword in the attributes section of the PKCS #10 CertificationRequest [RFC5967]. That proves the client is indeed in control of the private key at the time of the (D)TLS session establishment ๐Ÿ•ต๏ธโ€โ™€๏ธ

In the case of handshake message fragmentation, and if proof-of-possession is desired, the Finished message added as the challengePassword in the Certificate Signing Request (CSR) is calculated as specified by (D)TLS. We summarize it here for convenience. For DTLS 1.2, in the event of handshake message fragmentation, the hash of the handshake messages used in the Message Authentication Code (MAC) calculation of the Finished message must be computed on each reassembled message, as if each message had not been fragmented (Section 4.2.6 of [RFC6347]). The Finished message is calculated as shown in Section 7.4.9 of [RFC5246] ๐Ÿงฎ

For (D)TLS 1.3, Appendix C.5 of [RFC8446] describes the lack of channel bindings similar to tls-unique. [TLS13-CHANNEL-BINDINGS] can be used instead to derive a 32-byte tls-exporter binding from the (D)TLS 1.3 master secret. It uses a PRF negotiated in the (D)TLS 1.3 handshake, the label "EXPORTER-Channel-Binding" with no terminating NUL, the ClientHello.random and ServerHello.random, and a zero-length context string ๐Ÿง When proof-of-possession is desired, the client adds the tls-exporter value as a challengePassword in the attributes section of the PKCS #10 CertificationRequest [RFC5967], to prove that the client is indeed in control of the private key at the time of the (D)TLS session establishment.

In a constrained CoAP environment, endpoints can't always afford to set up a DTLS connection for every EST transaction ๐Ÿ˜ฉ So an EST-coaps DTLS connection MAY remain open for sequential EST transactions, which was NOT the case with [RFC7030]. For example, if a /crts request is followed by a /sen request, both can use the same authenticated DTLS connection. However, when a /crts request is included in the set of sequential EST transactions, some additional security considerations apply regarding the use of the Implicit and Explicit TA database, as explained in Section 9.1 โš ๏ธ

Heads up: a /crts request in a sequence of EST transactions brings extra security considerations about the Implicit and Explicit TA databases. Read Section 9.1 before you go wild with connection reuse ๐Ÿ™ˆ

Given that after a successful enrollment, a new EST transaction is more likely to not happen for a significant amount of time, the DTLS connections SHOULD only be kept alive for EST messages that are relatively close to each other ๐Ÿ•ฐ๏ธ These could include a /sen immediately following a /crts when a device is getting bootstrapped. In some cases, like NAT rebinding, keeping the state of a connection is not possible when devices sleep for extended periods of time. On those occasions, [RFC9146] negotiates a connection ID that can eliminate the need for a new handshake and its additional cost. Or, DTLS session resumption provides a less costly alternative to redoing a full DTLS handshake ๐Ÿ’œ

4. Protocol Design โœจ

EST-coaps uses CoAP to transfer EST messages, aided by Block-Wise Transfer [RFC7959], so it can avoid IP fragmentation ๐Ÿงฉ The use of blocks for the transfer of larger EST messages is specified in Section 4.6. Figure 1 shows the layered EST-coaps architecture ๐Ÿฐ

The EST-coaps protocol design follows the EST design very closely. The supported message types in EST-coaps are:

  • CA certificate retrieval, needed to receive the complete set of CA certificates ๐Ÿ“œ
  • Simple enroll and re-enroll, for a CA to sign client identity public keys โœ๏ธ
  • Certificate Signing Request (CSR) attribute messages, which inform the client of the fields to include in a CSR ๐Ÿ“
  • Server-side key generation messages, to provide a client identity private key when the client chooses so ๐Ÿ—๏ธ

While [RFC7030] permits a number of the EST functions to be used without authentication, this specification requires that the client MUST be authenticated for all functions. no skipping the auth, bestie ๐Ÿšซ

4.1. Discovery and URIs โœจ

okay so EST-coaps is built for low-resource networks with tiny packets ๐Ÿฃ, and an install can go one of two ways. (1) A rigid one, where the address and supported functions of the EST server(s) are already known. (2) A flexible one, where the EST server and its functions need to be discovered ๐Ÿ”.

For both, saving header space is a big deal, so this document specifies short EST-coaps URIs. They're shorter than the ones in [RFC7030]. Two example EST-coaps resource path names:

coaps://example.com:<port>/.well-known/est/<short-est>
coaps://example.com:<port>/.well-known/est/ArbitraryLabel/<short-est>

The short-est strings are defined in Table 1. ArbitraryLabels are usually defined and used by EST CAs to route client requests to the right certificate profile ๐ŸŽ€. Implementers should consider using short labels to minimize transmission overhead, so keep those labels bestie-sized ๐Ÿ’….

The EST-coaps server URIs you get through discovery of the EST-coaps resource(s) look like this ๐Ÿ‘€:

coaps://example.com:<port>/<root-resource>/<short-est>
coaps://example.com:<port>/<root-resource>/ArbitraryLabel/<short-est>

Figure 5 in Section 3.2.2 of [RFC7030] lists the operations and corresponding paths EST supports. Table 1 is the cheat sheet that maps each EST URI path to its shorter EST-coaps version ๐Ÿฆ‹:

        +=================+==============================+
        | EST             | EST-coaps                    |
        +=================+==============================+
        | /cacerts        | /crts                        |
        +-----------------+------------------------------+
        | /simpleenroll   | /sen                         |
        +-----------------+------------------------------+
        | /simplereenroll | /sren                        |
        +-----------------+------------------------------+
        | /serverkeygen   | /skg (PKCS #7)               |
        +-----------------+------------------------------+
        | /serverkeygen   | /skc (application/pkix-cert) |
        +-----------------+------------------------------+
        | /csrattrs       | /att                         |
        +-----------------+------------------------------+
                Table 1: Short EST-coaps URI Path

The /skg message is the EST /serverkeygen equivalent, where the client asks for a certificate in PKCS #7 format plus a private key ๐Ÿ”‘. If the client would rather have a single application/pkix-cert certificate instead of PKCS #7, it makes an /skc request. In both cases (i.e., /skg, /skc), a private key MUST be returned.

Clients and servers MUST support the short resource EST-coaps URIs. No exceptions, periodt ๐Ÿ’–.

In the context of CoAP, the presence and location of (the path to) the EST resources are discovered by sending a GET request to "/.well-known/core" with a resource type (RT) parameter set to "ace.est*" [RFC6690]. The example below shows discovery over CoAPS of where the EST-coaps resources live. Linefeeds are only there for readability โœจ.

  REQ: GET /.well-known/core?rt=ace.est*

  RES: 2.05 Content
</est/crts>;rt="ace.est.crts";ct="281 287",
</est/sen>;rt="ace.est.sen";ct="281 287",
</est/sren>;rt="ace.est.sren";ct="281 287",
</est/att>;rt="ace.est.att";ct=285,
</est/skg>;rt="ace.est.skg";ct=62,
</est/skc>;rt="ace.est.skc";ct=62

The first three lines of that discovery response, describing ace.est.crts, ace.est.sen, and ace.est.sren, MUST be returned if the server supports resource discovery. The last three lines are only included if the matching EST functions are implemented (see Table 2). The Content-Formats in the response let the client request one that the server supports. These are the values you'd send in the client request with an Accept Option ๐Ÿงš.

Discoverable port numbers can come back in the response payload too. Here's an example for a non-default CoAPS server port 61617. Linefeeds are only for readability again ๐ŸŒธ.

  REQ: GET /.well-known/core?rt=ace.est*

  RES: 2.05 Content
<coaps://[2001:db8:3::123]:61617/est/crts>;rt="ace.est.crts";
              ct="281 287",
<coaps://[2001:db8:3::123]:61617/est/sen>;rt="ace.est.sen";
              ct="281 287",
<coaps://[2001:db8:3::123]:61617/est/sren>;rt="ace.est.sren";
              ct="281 287",
<coaps://[2001:db8:3::123]:61617/est/att>;rt="ace.est.att";
              ct=285,
<coaps://[2001:db8:3::123]:61617/est/skg>;rt="ace.est.skg";
              ct=62,
<coaps://[2001:db8:3::123]:61617/est/skc>;rt="ace.est.skc";
              ct=62

The server MUST support the default /.well-known/est root resource. The server SHOULD support resource discovery when it supports non-default URIs (like /est or /est/ArbitraryLabel) or ports. The client SHOULD use resource discovery when it is unaware of the available EST-coaps resources ๐Ÿ”๐Ÿ’œ.

Throughout this document, the example root resource of /est is used ๐ŸŽ€.


4.2. Mandatory/Optional EST Functions

This specification contains a set of required-to-implement functions, optional functions, and not-specified functions. The unspecified functions are deemed too expensive for low-resource devices in payload and calculation times ๐Ÿ™ˆ.

Table 2 specifies whether each EST-coaps function is mandatory-to-implement or optional. Discovery of the existence of optional functions is described in Section 4.1 ๐Ÿ‘‘.

          +=================+==========================+
          | EST Functions   | EST-coaps Implementation |
          +=================+==========================+
          | /cacerts        | MUST                     |
          +-----------------+--------------------------+
          | /simpleenroll   | MUST                     |
          +-----------------+--------------------------+
          | /simplereenroll | MUST                     |
          +-----------------+--------------------------+
          | /fullcmc        | Not specified            |
          +-----------------+--------------------------+
          | /serverkeygen   | OPTIONAL                 |
          +-----------------+--------------------------+
          | /csrattrs       | OPTIONAL                 |
          +-----------------+--------------------------+
               Table 2: List of EST-coaps Functions

4.3. Payload Formats

EST-coaps is designed for low-resource devices, so it does not need to send Base64-encoded data ๐Ÿ™…โ€โ™€๏ธ. Simple binary is more efficient (30% smaller payload for DER-encoded ASN.1) and well supported by CoAP. So the payload for a given media type follows the ASN.1 structure of that media type and is transported in binary format ๐Ÿ’….

The Content-Format (the HTTP Content-Type equivalent) of the CoAP message decides which EST message rides in the CoAP payload ๐ŸŽ. The media types in the HTTP Content-Type header field (Section 3.2.4 of [RFC7030]) are specified by CoAP's Content-Format Option (12). The combination of URI-Path and Content-Format in EST-coaps MUST map to an allowed combination of URI and media type in EST. The required Content-Formats for these request and response messages are defined in Section 8.1, and the CoAP response codes are defined in Section 4.5 ๐Ÿ“‹.

Content-Format 287 can be used in place of 281 to carry a single certificate instead of a PKCS #7 container in a /crts, /sen, /sren, or /skg response. Content-Format 281 MUST be supported by EST-coaps servers. Servers MAY also support Content-Format 287. It's up to the client whether it supports only Content-Format 281, only 287, or both ๐Ÿซถ. The client uses a CoAP Accept Option in the request to express its preferred response Content-Format. If an Accept Option is not included in the request, the client isn't expressing any preference, and the server SHOULD choose format 281.

Content-Format 286 is used in /sen, /sren, and /skg requests, and 285 is used in /att responses ๐ŸŒˆ.

A representation with Content-Format identifier 62 contains a collection of representations along with their respective Content-Formats. The Content-Format identifies the media type application/multipart-core specified in [RFC8710] ๐Ÿฆ‹. For example, a collection containing two representations in response to an EST-coaps server-side key generation /skg request could include a private key in PKCS #8 [RFC5958] with Content-Format identifier 284 (0x011C) and a single certificate in a PKCS #7 container with Content-Format identifier 281 (0x0119). That collection would look like [284,h'0123456789abcdef', 281,h'fedcba9876543210'] in diagnostic Concise Binary Object Representation (CBOR) notation. The serialization of that CBOR content would be:

   84                  # array(4)
   19 011C             # unsigned(284)
   48                  # bytes(8)
      0123456789ABCDEF # "\x01#Eg\x89\xAB\xCD\xEF"
   19 0119             # unsigned(281)
   48                  # bytes(8)
      FEDCBA9876543210 # "\xFE\xDC\xBA\x98vT2\x10"
           Figure 2: Multipart /skg Response Serialization

When the client makes an /skc request, the certificate returned with the private key is a single X.509 certificate (not a PKCS #7 container) with Content-Format identifier 287 (0x011F) instead of 281. In cases where the private key is encrypted with Cryptographic Message Syntax (CMS) (as explained in Section 4.8), the Content-Format identifier is 280 (0x0118) instead of 284. The Content-Formats used in the response are summarized in Table 3 ๐Ÿ“.

         +==========+==================+==================+
         | Function | Response, Part 1 | Response, Part 2 |
         +==========+==================+==================+
         | /skg     | 284              | 281              |
         +----------+------------------+------------------+
         | /skc     | 280              | 287              |
         +----------+------------------+------------------+
           Table 3: Response Content-Formats for /skg and
                                /skc

The key and certificate representations are DER-encoded ASN.1 in their binary form. An example is shown in Appendix A.3 โœจ.

4.4. Message Bindings โœจ

okay so this is where we figure out how EST-coaps messages actually look on the wire ๐Ÿฆ‹ bestie, the vibe is "CoAP but make it EST" ๐Ÿ’…

  • EST-coaps servers sometimes need to give delayed responses ๐Ÿ•ฐ๏ธ, which come after an immediately returned empty ACK or an ACK carrying response code 5.03, as explained in Section 4.7. So it is RECOMMENDED for implementers to send EST-coaps requests in Confirmable (CON) CoAP messages ๐Ÿ’œ.
  • The CoAP Options used are Uri-Host, Uri-Path, Uri-Port, Content-Format, Block1, Block2, and Accept ๐ŸŽ€. These are the Options that carry the HTTP fields from the EST REST messages. The Uri-host and Uri-Port Options can be left out of the CoAP message sent on the wire ๐Ÿ™ˆ. When they're left out, they're logically assumed to be the transport protocol destination address and port, respectively. Explicit Uri-Host and Uri-Port Options are typically used when an endpoint hosts multiple virtual servers and uses the Options to route requests accordingly ๐Ÿงš. Other CoAP Options should be handled in accordance with [RFC7252].
  • EST URLs are HTTPS based (https://) ๐Ÿ”’. In CoAP, these are assumed to be translated to CoAPS (coaps://) โœจ.

Table 1 gives you the mapping from the EST URI path to the EST-coaps URI path, and Appendix A has some practical examples of EST messages translated to CoAP ๐ŸŒธ. Go look, they're cute.

4.5. CoAP Response Codes ๐Ÿ“

Section 5.9 of [RFC7252] and Section 7 of [RFC8075] spell out how HTTP response codes map to CoAP response codes ๐Ÿ—บ๏ธ. The success code for an EST-coaps GET request (/crts, /att) is 2.05 ๐ŸŽ‰. Similarly, 2.04 is used for a successful response to EST-coaps POST requests (/sen, /sren, /skg, /skc) ๐Ÿ’–.

EST uses HTTP 204 or 404 responses when a resource isn't available for the client ๐Ÿ™ƒ. In EST-coaps, 2.04 is used in response to a POST (/sen, /sren, /skg, /skc), and 4.04 is used when the resource isn't available for the client ๐Ÿ’€.

HTTP response code 202 with a Retry-After header field in [RFC7030] has no equivalent in CoAP ๐Ÿ˜ญ. EST uses HTTP 202 with Retry-After for delayed server responses. Section 4.7 explains how EST-coaps handles delayed messages with 5.03 responses that carry a Max-Age Option โณ.

Also, EST's HTTP 400, 401, 403, 404, and 503 status codes have their CoAP equivalents 4.00, 4.01, 4.03, 4.04, and 5.03 in EST-coaps ๐Ÿง. Table 4 sums up the EST-coaps response codes, bestie ๐Ÿ‘‘.

+=============+=========================+==========================+
| Operation   | EST-coaps Response Code | Description              |
+=============+=========================+==========================+
| /crts, /att | 2.05                    | Success.  Certs included |
|             |                         | in the response payload. |
+-------------+-------------------------+--------------------------+
|             | 4.xx / 5.xx             | Failure.                 |
+-------------+-------------------------+--------------------------+
| /sen, /skg, | 2.04                    | Success.  Cert included  |
| /sren, /skc |                         | in the response payload. |
+-------------+-------------------------+--------------------------+
|             | 5.03                    | Retry in Max-Age Option  |
|             |                         | time.                    |
+-------------+-------------------------+--------------------------+
|             | 4.xx / 5.xx             | Failure.                 |
+-------------+-------------------------+--------------------------+

                 Table 4: EST-coaps Response Codes

4.6. Message Fragmentation ๐Ÿงฉ

DTLS only defines fragmentation for the handshake, not for secure data exchange (DTLS records) ๐Ÿซถ. [RFC6347] says that to avoid IP fragmentation, which involves error-prone datagram reconstitution, invokers of the DTLS record layer should size DTLS records so that they fit within any Path MTU estimates obtained from the record layer ๐Ÿ“. On top of that, invokers living on 6LoWPAN (IPv6 over Low-Power Wireless Personal Area Networks) over IEEE 802.15.4 networks [IEEE802.15.4] are recommended to size CoAP messages so each DTLS record fits within one or two IEEE 802.15.4 frames ๐Ÿฆ‹.

That's not always possible in EST-coaps, and it's kind of a lot ๐Ÿ˜ฉ. Even though ECC certificates are small, they can vary a lot based on signature algorithms, key sizes, and Object Identifier (OID) fields. For 256-bit curves, common Elliptic Curve Digital Signature Algorithm (ECDSA) cert sizes are 500-1000 bytes, which can fluctuate further based on the algorithms, OIDs, Subject Alternative Names (SANs), and cert fields ๐ŸŒˆ. For 384-bit curves, ECDSA certificates get bigger and can sometimes reach 1.5KB ๐Ÿ“ˆ. And sometimes the EST cacerts response from the server includes multiple certificates that add up to large payloads ๐Ÿ“ฆ.

Section 4.6 of [RFC7252] (CoAP) describes the possible payload sizes: "if nothing is known about the size of the headers, good upper bounds are 1152 bytes for the message size and 1024 bytes for the payload size" ๐Ÿ“. Section 4.6 of [RFC7252] also suggests that IPv4 implementations may want to limit themselves to more conservative IPv4 datagram sizes, such as 576 bytes ๐Ÿงธ. Even with ECC, EST-coaps messages can still exceed MTU sizes on the Internet or 6LoWPAN [RFC4919] (Section 2 of [RFC7959]) ๐Ÿšจ. So EST-coaps needs to be able to fragment messages into multiple DTLS datagrams ๐Ÿ”ฅ.

To do fragmentation in CoAP, [RFC7959] specifies the Block1 Option for fragmenting the request payload and the Block2 Option for fragmenting the return payload of a CoAP flow ๐ŸŽ€. As Section 1 of [RFC7959] explains, block-wise transfers should be used in Confirmable CoAP messages to avoid making lost blocks worse ๐Ÿ™Œ. EST-coaps servers MUST implement Block1 and Block2 ๐Ÿง. EST-coaps clients MUST implement Block2. EST-coaps clients MUST implement Block1 only if they're expecting to send EST-coaps requests with a packet size that exceeds the path MTU ๐Ÿช„.

[RFC7959] also defines Size1 and Size2 Options to give size information about the resource representation in a request and response ๐Ÿ“. The EST-coaps client and server MAY support Size1 and Size2 Options ๐Ÿ’ซ.

Examples of fragmented EST-coaps messages are in Appendix B ๐ŸŒŸ.

4.7. Delayed Responses โณ

Server responses can sometimes get delayed, and that's totally a vibe ๐Ÿ˜Œ. According to Section 5.2.2 of [RFC7252], a slow server can acknowledge the request and respond later with the requested resource representation ๐Ÿข. In particular, a slow server can respond to an EST-coaps enrollment request with an empty ACK with code 0.00 and then send the certificate to the client after a short delay ๐Ÿ’Œ. If the certificate response is large, the server will need more than one Block2 block to transfer it ๐Ÿ“ฆ.

Figure 3 shows this situation ๐Ÿ‘€. The client sends an enrollment request that uses N1+1 Block1 blocks. The server uses an empty 0.00 ACK to announce the delayed response, which comes later in 2.04 messages containing N2+1 Block2 Options. The first 2.04 is a Confirmable message that the client acknowledges. From then on, the client acknowledges all subsequent Block2 blocks ๐Ÿซง. The notation of Figure 3 is explained in Appendix B.1 ๐Ÿ“–.

POST [2001:db8::2:1]:61616/est/sen (CON)(1:0/1/256)
                   {CSR (frag# 1)} -->
   <-- (ACK) (1:0/1/256) (2.31 Continue)
POST [2001:db8::2:1]:61616/est/sen (CON)(1:1/1/256)
                   {CSR (frag# 2)} -->
   <-- (ACK) (1:1/1/256) (2.31 Continue)
                  .
                  .
                  .
POST [2001:db8::2:1]:61616/est/sen(CON)(1:N1/0/256)
                   {CSR (frag# N1+1)}-->
   <-- (0.00 empty ACK)
                  |
   ... Short delay before the certificate is ready ...
                  |
   <-- (CON) (1:N1/0/256)(2:0/1/256)(2.04 Changed)
                   {Cert resp (frag# 1)}
                                              (ACK)          -->
POST [2001:db8::2:1]:61616/est/sen (CON)(2:1/0/256)          -->
   <-- (ACK) (2:1/1/256) (2.04 Changed) {Cert resp (frag# 2)}
                  .
                  .
                  .
POST [2001:db8::2:1]:61616/est/sen (CON)(2:N2/0/256)          -->
   <-- (ACK) (2:N2/0/256) (2.04 Changed) {Cert resp (frag# N2+1)}

            Figure 3: EST-coaps Enrollment with Short Wait

If the server is very slow (for example, manual intervention is required, which would take minutes) ๐ŸŒ, it SHOULD respond with an ACK containing response code 5.03 (Service unavailable) and a Max-Age Option. That tells the client how long it SHOULD wait before sending another request to get the content โฐ. After a delay of Max-Age, the client SHOULD resend the identical CSR to the server ๐Ÿ”. As long as the server keeps responding with 5.03 (Service Unavailable) and a Max-Age Option, the client keeps delaying for Max-Age and resending the enrollment request until the server responds with the certificate, or until the client abandons the request due to policy or other reasons ๐Ÿซ .

Figure 4 shows this scenario ๐ŸŽฌ. A client sends an enrollment request that uses N1+1 Block1 blocks to send the CSR to the server. The server needs N2+1 Block2 blocks to respond, but it also needs a long delay (minutes) to provide the response ๐Ÿ•ฐ๏ธ. So the server uses a 5.03 ACK response with a Max-Age Option. The client waits for a period of Max-Age each time it gets the same 5.03 response, and it retransmits the enrollment request until it receives a certificate in a fragmented 2.04 response ๐Ÿ’….

POST [2001:db8::2:1]:61616/est/sen (CON)(1:0/1/256)
                   {CSR (frag# 1)}  -->
  <-- (ACK) (1:0/1/256) (2.31 Continue)
POST [2001:db8::2:1]:61616/est/sen (CON)(1:1/1/256)
                   {CSR (frag# 2)}  -->
  <-- (ACK) (1:1/1/256) (2.31 Continue)
                  .
                  .
                  .
POST [2001:db8::2:1]:61616/est/sen(CON)(1:N1/0/256)
                   {CSR (frag# N1+1)}-->
  <-- (ACK) (1:N1/0/256) (5.03 Service Unavailable) (Max-Age)
                  |
                  |
  ... Client tries again after Max-Age with identical payload ...
                  |
                  |
POST [2001:db8::2:1]:61616/est/sen(CON)(1:0/1/256)
                   {CSR (frag# 1)}-->
  <-- (ACK) (1:0/1/256) (2.31 Continue)
POST [2001:db8::2:1]:61616/est/sen (CON)(1:1/1/256)
                   {CSR (frag# 2)}  -->
  <-- (ACK) (1:1/1/256) (2.31 Continue)
                  .
                  .
                  .
POST [2001:db8::2:1]:61616/est/sen(CON)(1:N1/0/256)
                   {CSR (frag# N1+1)}-->
                  |
   ... Immediate response when certificate is ready ...
                  |
  <-- (ACK) (1:N1/0/256) (2:0/1/256) (2.04 Changed)
                   {Cert resp (frag# 1)}
POST [2001:db8::2:1]:61616/est/sen (CON)(2:1/0/256)           -->
  <-- (ACK) (2:1/1/256) (2.04 Changed) {Cert resp (frag# 2)}
                  .
                  .
                  .
POST [2001:db8::2:1]:61616/est/sen (CON)(2:N2/0/256)          -->
  <-- (ACK) (2:N2/0/256) (2.04 Changed) {Cert resp (frag# N2+1)}

            Figure 4: EST-coaps Enrollment with Long Wait

4.8. Server-Side Key Generation โœจ

okay so sometimes the private key gets made on the server instead of the client ๐Ÿ” and that's totally a thing! it can be the safer move when the long-lived random private key that identifies the client should be created at the server, or when the client doesn't have many resources to spare for making a random key, or when security policy says the certificate's public and private keys have to be generated and controlled centrally ๐Ÿ’… and no matter who makes the key, proper random numbers are a must in protocols like (D)TLS (Section 9.1) ๐ŸŽฒ

when a client asks for server-side key generation, it's asking the server or proxy to make the private key and the certificate, and they get sent back to the client in the server-side key generation response ๐ŸŽ€ the server handles the CSR the same way it would handle any enroll or re-enroll CSR, the only difference is that the server MUST ignore the public key values and signature in the CSR ๐Ÿ™ˆ those fields are only in the request so existing code for making and parsing these requests can be reused, no extra drama ๐Ÿ’–

the client's /skg request wants a certificate in a PKCS #7 container plus a private key in two application/multipart-core elements ๐Ÿงš the /skc request is the lighter version, just one application/pkix-cert certificate and a private key. the private key Content-Format the client wants is shown in the PKCS #10 CSR request. if the request has SMIMECapabilities and DecryptKeyIdentifier or AsymmetricDecryptKeyIdentifier, the client is expecting Content-Format 280 for the private key, and then that key gets encrypted symmetrically or asymmetrically per [RFC7030] ๐Ÿ”’ how the symmetric key or asymmetric keypair gets set up is out of scope for this spec, so we're leaving that one alone ๐Ÿ™Œ and an /skg or /skc request with a CSR that has no SMIMECapabilities expects an application/multipart-core with an unencrypted PKCS #8 private key with Content-Format 284 ๐Ÿ“

the EST-coaps server-side key generation response comes back as Content-Format application/multipart-core [RFC8710] with a CBOR array holding four items (Section 4.3) ๐ŸŒˆ the two representations (each one is two CBOR array items) don't have to show up in any particular order, because each one has its own Content-Format ID in front of it, so it's giving flexible ๐Ÿ’œ depending on the request, the private key can be in unprotected PKCS #8 format [RFC5958] (Content-Format 284), or it can be tucked inside CMS SignedData (Content-Format 280) ๐Ÿฆ‹ the SignedData sits in the outermost container and gets signed by whoever made the private key, which could be the EST server or the EST CA โœ๏ธ SignedData inside the Enveloped Data doesn't need extra signing, as explained in Section 4.4.2 of [RFC7030] โœจ

the TL;DR on the encryption bits: with symmetric encryption, the encrypted key goes in the encryptedKey attribute of a KEKRecipientInfo structure ๐Ÿ—๏ธ if the asymmetric encryption key works for transport key operations, the private key gets encrypted with a symmetric key, and that symmetric key gets encrypted with the client-defined (in the CSR) asymmetric public key and carried in an encryptedKey attribute inside a KeyTransRecipientInfo structure ๐Ÿ’Œ and if the asymmetric encryption key is good for key agreement, the private key gets encrypted with a symmetric key again, but this time that symmetric key is encrypted with the client-defined (in the CSR) asymmetric public key and carried in a recipientEncryptedKeys attribute inside a KeyAgreeRecipientInfo ๐ŸŽ

[RFC7030] recommends adding extra encryption on the returned private key ๐Ÿฅบ for this spec, clients and servers that choose to support server-side key generation MUST support unprotected (PKCS #8) private keys (Content-Format 284) ๐ŸŒธ symmetric or asymmetric encryption of the private key (CMS EnvelopedData, Content-Format 280) SHOULD be supported for deployments where end-to-end encryption is needed between the client and a server ๐Ÿ” those cases could include setups where an entity between the client and the CA terminates the DTLS connection (Registrar in Figure 5) ๐Ÿ‘€ and even though [RFC7030] strongly recommends that clients ask for CMS encryption on top of the TLS channel's protection, this document doesn't make that recommendation ๐Ÿ™…โ€โ™€๏ธ CMS encryption can still be used when the use case mandates it ๐Ÿ’…


5. HTTPS-CoAPS Registrar ๐ŸŒ

real talk, the EST server won't always live inside the CoAP boundary ๐Ÿก it can sit outside the constrained network, in which case it supports TLS/HTTP instead of CoAPS. so in those setups, EST-coaps is used by the client inside the CoAP boundary, and TLS carries the EST messages outside that boundary ๐Ÿ›ฐ๏ธ a Registrar at the edge is required to operate between the CoAP environment and the external HTTP network, as shown in Figure 5 ๐ŸŽ€

                                       Constrained Network
      .------.                         .----------------------------.
      |  CA  |                         |.--------------------------.|
      '------'                         ||                          ||
         |                             ||                          ||
      .------.  HTTP   .------------------.  CoAPS  .-----------.  ||
      | EST  |<------->|EST-coaps-to-HTTPS|<------->| EST Client|  ||
      |Server|over TLS |   Registrar      |         '-----------'  ||
      '------'         '------------------'                        ||
                                       ||                          ||
                                       |'--------------------------'|
                                       '----------------------------'

        Figure 5: EST-coaps-to-HTTPS Registrar at the CoAP Boundary

the EST-coaps-to-HTTPS Registrar MUST terminate EST-coaps on the downstream side and start EST connections over TLS on the upstream side ๐Ÿ™Œ the Registrar MUST authenticate and optionally authorize the client requests, while it MUST be authenticated by the EST server or CA ๐Ÿ›ก๏ธ the trust relationship between the Registrar and the EST server SHOULD be pre-established so the Registrar can proxy these connections for lots of different clients ๐Ÿซถ

when Proof-of-Possession (POP) linking is enforced, the tls-unique or tls-exporter value of the session (for DTLS 1.2 and DTLS 1.3, respectively) is used to prove the client has the private key matching the public key and that it was used to set up the connection, as explained in Section 3 ๐Ÿ”‘ the POP linking info gets lost between the EST-coaps client and the EST server when a Registrar is in the middle ๐Ÿ˜ญ the EST server can tell a Registrar is there from its TLS client certificate, which includes the id-kp-cmcRA extended key usage (EKU) extension [RFC6402] ๐Ÿ‘‘ as Section 3.7 of [RFC7030] explains, "EST server SHOULD apply authorization policy consistent with an RA client ... the EST server could be configured to accept POP linking information that does not match the current TLS session because the authenticated EST client RA has verified this information when acting as an EST server" ๐Ÿง

Table 1 has the URI mappings between EST-coaps and EST that the Registrar MUST adhere to ๐Ÿ“‹ Section 4.5 of this specification and Section 7 of [RFC8075] define the mappings between EST-coaps and HTTP response codes, which tell the Registrar how it MUST translate CoAP response codes from/to HTTP status codes ๐Ÿ” the mapping from CoAP Content-Format to HTTP Content-Type is defined in Section 8.1 ๐Ÿท๏ธ and a conversion from CBOR major type 2 to Base64 encoding MUST take place at the Registrar ๐Ÿฌ if CMS end-to-end encryption is used for the private key, the encrypted CMS EnvelopedData blob MUST be converted at the Registrar to binary CBOR type 2 on the way down to the client ๐Ÿ“ฆ this is only a format conversion, so no decryption of the CMS EnvelopedData is needed ๐Ÿ™…โ€โ™€๏ธ

there's a possible deviation from the Table 1 mappings: clients using server-side key generation might prefer that the enrolled keys get generated by the Registrar when the CA doesn't support server-side key generation ๐Ÿคทโ€โ™€๏ธ in that case, the Registrar is responsible for generating a new CSR signed by a new key, which gets returned to the client along with the certificate from the CA ๐ŸŽŸ๏ธ and in these cases the Registrar MUST use random number generation with proper entropy ๐ŸŽฒโœจ

because big messages get fragmented into blocks, an EST-coaps-to-HTTP Registrar MUST reassemble the blocks before translating the binary content to Base64 and then relaying the message upstream ๐Ÿงฉ and the EST-coaps-to-HTTP Registrar MUST support resource discovery according to the rules in Section 4.1 ๐Ÿ—บ๏ธ


6. Parameters โš™๏ธ

this section covers the transmission parameters described in Sections 4.7 and 4.8 of [RFC7252] ๐Ÿ“ก EST doesn't impose any unique values on the CoAP parameters in [RFC7252], but the CoAP parameter values can affect what the EST parameter values should be ๐Ÿง 

implementations should follow the default CoAP configuration parameters [RFC7252] ๐ŸŽ€ but depending on the scenario, retransmissions and timeouts can also happen on other networking layers, governed by their own configuration parameters ๐ŸŒ€ when a server parameter changes, the parameter values in the communicating endpoints MUST be adjusted as necessary ๐Ÿ”ง examples of how that could happen include higher-layer congestion protocols, provisioning agents, and configurations included in firmware updates ๐Ÿš€

here are some specific parameters, mainly from Table 2 in [RFC7252], that are worth knowing about ๐Ÿฅฐ

  • NSTART: controls the number of simultaneous outstanding interactions a client keeps going with a given server ๐Ÿ™‹โ€โ™€๏ธ an EST-coaps client is expected to control at most one interaction with a given server, which is the default NSTART value defined in [RFC7252] 1๏ธโƒฃ
  • DEFAULT_LEISURE: only matters in multicast scenarios and is outside the scope of EST-coaps ๐Ÿ™ˆ
  • PROBING_RATE: specifies the rate of resending Non-confirmable messages ๐Ÿข in the rare situations where Non-confirmable messages are used, the default PROBING_RATE value defined in [RFC7252] applies ๐Ÿ’ซ

last but not least, the Table 3 parameters in [RFC7252] are mainly derived from Table 2, so changing parameters in one table would affect the parameters in the other ๐Ÿ”— bestie, keep that in mind!! ๐Ÿ˜ญ


7. Deployment Limitations ๐Ÿšง

EST-coaps paves the way for constrained devices to use EST in constrained networks, which is so iconic ๐Ÿฆ‹ but some classes of devices [RFC7228] won't have enough resources to handle the payloads that come with EST-coaps ๐Ÿฅฒ the spec is meant to make sure EST works for networks of constrained devices that choose to limit their communications stack to DTLS/CoAP ๐Ÿ’œ it's up to the network designer to decide which devices run the EST protocol and which ones don't ๐Ÿง‘โ€๐Ÿ’ป


8. IANA Considerations ๐ŸŽ€

8.1. Content-Formats Registry ๐Ÿ“ฆ

okay so IANA registered the following Content-Formats from Table 5 in the "CoAP Content-Formats" subregistry inside the "CoRE Parameters" registry [CORE-PARAMS] ๐ŸŽ€ they were registered in the IETF Review or IESG Approval range (256-9999), which is giving very official vibes ๐Ÿ’…

      +=================================+=====+====================+
      | Media Type                      |  ID | Reference          |
      +=================================+=====+====================+
      | application/pkcs7-mime; smime-  | 280 | [RFC7030]          |
      | type=server-generated-key       |     | [RFC8551] RFC 9148 |
      +---------------------------------+-----+--------------------+
      | application/pkcs7-mime; smime-  | 281 | [RFC8551] RFC 9148 |
      | type=certs-only                 |     |                    |
      +---------------------------------+-----+--------------------+
      | application/pkcs8               | 284 | [RFC5958]          |
      |                                 |     | [RFC8551] RFC 9148 |
      +---------------------------------+-----+--------------------+
      | application/csrattrs            | 285 | [RFC7030] RFC 9148 |
      +---------------------------------+-----+--------------------+
      | application/pkcs10              | 286 | [RFC5967]          |
      |                                 |     | [RFC8551] RFC 9148 |
      +---------------------------------+-----+--------------------+
      | application/pkix-cert           | 287 | [RFC2585] RFC 9148 |
      +---------------------------------+-----+--------------------+

                    Table 5: New CoAP Content-Formats

8.2. Resource Type Registry ๐Ÿท๏ธ

IANA also registered the following Resource Type (rt=) Link Target Attributes from Table 6 in the "Resource Type (rt=) Link Target Attribute Values" subregistry under the "Constrained RESTful Environments (CoRE) Parameters" registry โœจ

     +==============+===================================+===========+
     | Value        | Description                       | Reference |
     +==============+===================================+===========+
     | ace.est.crts | This resource depicts the support | RFC 9148  |
     |              | of EST GET cacerts.               |           |
     +--------------+-----------------------------------+-----------+
     | ace.est.sen  | This resource depicts the support | RFC 9148  |
     |              | of EST simple enroll.             |           |
     +--------------+-----------------------------------+-----------+
     | ace.est.sren | This resource depicts the support | RFC 9148  |
     |              | of EST simple reenroll.           |           |
     +--------------+-----------------------------------+-----------+
     | ace.est.att  | This resource depicts the support | RFC 9148  |
     |              | of EST GET CSR attributes.        |           |
     +--------------+-----------------------------------+-----------+
     | ace.est.skg  | This resource depicts the support | RFC 9148  |
     |              | of EST server-side key generation |           |
     |              | with the returned certificate in  |           |
     |              | a PKCS #7 container.              |           |
     +--------------+-----------------------------------+-----------+
     | ace.est.skc  | This resource depicts the support | RFC 9148  |
     |              | of EST server-side key generation |           |
     |              | with the returned certificate in  |           |
     |              | application/pkix-cert format.     |           |
     +--------------+-----------------------------------+-----------+

         Table 6: New Resource Type (rt=) Link Target Attributes

8.3. Well-Known URIs Registry ๐ŸŒ

IANA added an additional reference to the est URI in the "Well-Known URIs" registry ๐Ÿฆ‹

  • URI Suffix: est
  • Change Controller: IETF
  • References: [RFC7030] RFC 9148
  • Status: permanent
  • Related Information:
  • Date Registered: 2013-08-16
  • Date Modified: 2020-04-29

9. Security Considerations ๐Ÿ”๐Ÿ’€

9.1. EST Server Considerations ๐Ÿ›ก๏ธ

okay so the security considerations in Section 6 of [RFC7030] are only partially valid for this document ๐Ÿ™ˆ bc HTTP Basic Authentication is not supported, the stuff about using passwords doesn't apply. The other portions of the security considerations in [RFC7030] continue to apply ๐Ÿ’…

modern security protocols need random numbers to be available during the protocol run, like for nonces and ephemeral (EC) Diffie-Hellman key generation. this capability to generate random numbers is also needed when the constrained device generates the private key (the one that corresponds to the public key enrolled in the CSR). when server-side key generation is used, the constrained device depends on the server to generate the private key randomly, but it still needs locally generated random numbers for use in security protocols, as explained in Section 12 of [RFC7925] โœจ also, the transport of keys generated at the server is inherently risky ๐Ÿ˜ญ for those deploying server-side key generation, analysis SHOULD be done to establish whether server-side key generation increases or decreases the probability of digital identity theft.

it is important to note that, as pointed out in [PsQs], sources contributing to the randomness pool used to generate random numbers on laptops or desktop PCs (things like mouse movement, timing of keystrokes, or air turbulence on the movement of hard drive heads) are not available on many constrained devices. other sources have to be used or dedicated hardware has to be added. selecting hardware for an IoT device that is capable of producing high-quality random numbers is therefore important [RSA-FACT] ๐Ÿ”ฅ

as discussed in Section 6 of [RFC7030], it is

RECOMMENDED that the Implicit Trust Anchor database used for EST server authentication be carefully managed to reduce the chance of a third-party CA with poor certification practices from being trusted. Disabling the Implicit Trust Anchor database after successfully receiving the Distribution of CA certificates response ([RFC7030], Section 6) limits any vulnerability to the first TLS exchange.

alternatively, in a case where a /sen request immediately follows a /crts, a client MAY choose to keep the connection authenticated by the Implicit TA open for efficiency reasons (Section 3) ๐Ÿฆ‹ a client that interleaves EST-coaps /crts request with other requests in the same DTLS connection SHOULD revalidate the server certificate chain against the updated Explicit TA from the /crts response before proceeding with the subsequent requests. if the server certificate chain does not authenticate against the database, the client SHOULD close the connection without completing the rest of the requests. the updated Explicit TA MUST continue to be used in new DTLS connections ๐Ÿšจ

in cases where the Initial Device Identifier (IDevID) used to authenticate the client is expired, the server MAY still authenticate the client because IDevIDs are expected to live as long as the device itself (Section 3) ๐Ÿงš in such occasions, checking the certificate revocation status or authorizing the client using another method is important for the server to raise its confidence that the client can be trusted.

in accordance with [RFC7030], TLS cipher suites that include "_EXPORT_" and "_DES_" in their names MUST NOT be used ๐Ÿ™…โ€โ™€๏ธ more recommendations for secure use of TLS and DTLS are included in [BCP195] ๐ŸŒธ

as described in Certificate Management over CMS (CMC), Section 6.7 of [RFC5272], "For keys that can be used as signature keys, signing the certification request with the private key serves as a POP on that key pair". in (D)TLS 1.2, the inclusion of tls-unique in the certificate request links the proof-of-possession to the (D)TLS proof-of-identity. this implies but does not prove that only the authenticated client currently has access to the private key ๐Ÿ‘€

what's more, CMC POP linking uses tls-unique as it is defined in [RFC5929] ๐Ÿ˜ฑ the 3SHAKE attack [TRIPLESHAKE] poses a risk by allowing an on-path active attacker to leverage session resumption and renegotiation to inject itself between a client and server even when channel binding is in use. implementers should use the Extended Master Secret Extension in DTLS [RFC7627] to prevent such attacks. in the context of this specification, an attacker could invalidate the purpose of the POP linking challengePassword in the client request by resuming an EST-coaps connection. even though the practical risk of such an attack to EST-coaps is not devastating, we would rather use a more secure channel-binding mechanism ๐Ÿ’œ in this specification, we still depend on the tls-unique mechanism defined in [RFC5929] for DTLS 1.2 because a 3SHAKE attack does not expose messages exchanged with EST-coaps. but for DTLS 1.3, [TLS13-CHANNEL-BINDINGS] is used instead to derive a 32-byte tls-exporter binding in place of the tls-unique value in the CSR. that would alleviate the risks from the 3SHAKE attack [TRIPLESHAKE] โœจ

interpreters of ASN.1 structures should be aware of the use of invalid ASN.1 length fields and should take appropriate measures to guard against buffer overflows, stack overruns in particular, and malicious content in general ๐Ÿšง

9.2. HTTPS-CoAPS Registrar Considerations ๐Ÿงพ

the Registrar proposed in Section 5 must be deployed with care and only when direct client-server connections are not possible ๐Ÿ˜ฌ when POP linking is used, the Registrar terminating the DTLS connection establishes a new TLS connection with the upstream CA. thus, it is impossible for POP linking to be enforced end to end for the EST transaction. the EST server could be configured to accept POP linking information that does not match the current TLS session because the authenticated EST Registrar is assumed to have verified POP linking downstream to the client.

the introduction of an EST-coaps-to-HTTP Registrar assumes the client can authenticate the Registrar using its implicit or explicit TA database. it also assumes the Registrar has a trust relationship with the upstream EST server in order to act on behalf of the clients. when a client uses the Implicit TA database for certificate validation, it SHOULD confirm if the server is acting as an RA by the presence of the id-kp-cmcRA EKU [RFC6402] in the server certificate ๐Ÿซถ

in a server-side key generation case, if no end-to-end encryption is used, the Registrar may be able see the private key as it acts as a man in the middle ๐Ÿ•ต๏ธโ€โ™€๏ธ thus, the client puts its trust on the Registrar not exposing the private key.

clients that leverage server-side key generation without end-to-end encryption of the private key (Section 4.8) have no knowledge as to whether the Registrar will be generating the private key and enrolling the certificates with the CA or if the CA will be responsible for generating the key. in such cases, the existence of a Registrar requires the client to put its trust on the Registrar when it is generating the private key ๐Ÿ“

10. References ๐Ÿ“š

10.1. Normative References ๐Ÿ’…

okay so these are the must-read specs bestie, the ones the whole thing is built on ๐Ÿง  if you skip them you're gonna be so lost ๐Ÿ˜ญ


10.2. Informative References ๐ŸŒธ

these ones are the extra reading ๐Ÿ“– super helpful for getting the vibe of the whole thing, but you don't strictly need them to build the thing ๐Ÿซถ


Appendix A. EST Messages to EST-coaps โœจ

this section is giving the same vibes as the examples in Appendix A of [RFC7030] ๐ŸŽ€ but for EST-coaps instead ๐Ÿ’–

the payloads here are hex-encoded binary, made with xxd -p, of the PKI certificates created by following [PKI-GUIDE] ๐Ÿงš we use hex only so it actually shows up nicely in text, because raw binary doesn't render well ๐Ÿ™ˆ on the wire it's never hex, it's pure binary bestie ๐Ÿ’œ and these payloads are shown unencrypted. in real life the message content would go over an encrypted DTLS channel ๐Ÿ”๐Ÿซถ

the certificate responses in these examples carry Content-Format 281 (application/pkcs7) ๐ŸŒˆ if the client asked for Content-Format 287 (application/pkix-cert) instead, the server would reply with a single DER binary certificate ๐Ÿ’… and for a response to a /est/skc query, that certificate would be wrapped in a multipart-core container ๐ŸŽ

these examples assume a short resource path of "/est" ๐ŸŒท even though we left it out to keep things short, a client would first find out which EST-coaps resources the server supports by sending a GET request for /.well-known/core?rt=ace.est* ๐Ÿ” (that's explained in Section 4.1, go check it out ๐Ÿ‘€)

the matching CoAP headers only show up in Appendix A.1 ๐Ÿฆ‹ and building CoAP headers is assumed to be something you already get, so we're not going deep on it ๐Ÿ˜Œ

the actual message content is shown in plain text in Appendix C ๐Ÿ“โœจ

A.1. cacerts ๐ŸŒธ

Okay, bestie, let's start with cacerts ๐Ÿ’–. In EST-coaps, a cacerts message looks like this:

GET example.com:9085/est/crts
(Accept:  281)

Here are the matching CoAP header fields. The block and DTLS stuff is in Appendix B โœจ.

Ver = 1
T = 0 (CON)
Code = 0x01 (0.01 is GET)
Token = 0x9a (client generated)
Options
  Option (Uri-Host)
     Option Delta = 0x3  (option# 3)
     Option Length = 0xB
     Option Value = "example.com"
  Option (Uri-Port)
     Option Delta = 0x4  (option# 3+4=7)
     Option Length = 0x2
     Option Value = 9085
   Option (Uri-Path)
     Option Delta = 0x4   (option# 7+4=11)
     Option Length = 0x3
     Option Value = "est"
   Option (Uri-Path)
     Option Delta = 0x0   (option# 11+0=11)
     Option Length = 0x4
     Option Value = "crts"
   Option (Accept)
     Option Delta = 0x6   (option# 11+6=17)
     Option Length = 0x2
     Option Value = 281
Payload = [Empty]

Quick tea ๐Ÿซ–: per Section 5.10.1 of [RFC7252], the Uri-Host and Uri-Port Options can be left out if they match the transport protocol's destination address and port, respectively. Iconic efficiency ๐Ÿ‘‘.

When the server answers with a cert in EST-coaps, the response looks like this, 2.05 Content with Content-Format 281:

2.05 Content (Content-Format: 281)
   {payload with certificate in binary format}

And these are the CoAP fields:

Ver = 1
T = 2 (ACK)
Code = 0x45 (2.05 Content)
Token = 0x9a   (copied from request by server)
Options
  Option (Content-Format)
    Option Delta = 0xC  (option# 12)
    Option Length = 0x2
    Option Value = 281

Heads up ๐Ÿ™ˆ: the hex below would NOT be sent as hex on the wire. It's binary! We only write it in hex because binary doesn't render well in text.

3082027a06092a864886f70d010702a082026b308202670201013100300b
06092a864886f70d010701a082024d30820249308201efa0030201020208
0b8bb0fe604f6a1e300a06082a8648ce3d0403023067310b300906035504
0613025553310b300906035504080c024341310b300906035504070c024c
4131143012060355040a0c0b4578616d706c6520496e6331163014060355
040b0c0d63657274696669636174696f6e3110300e06035504030c07526f
6f74204341301e170d3139303133313131323730335a170d333930313236
3131323730335a3067310b3009060355040613025553310b300906035504
080c024341310b300906035504070c024c4131143012060355040a0c0b45
78616d706c6520496e6331163014060355040b0c0d636572746966696361
74696f6e3110300e06035504030c07526f6f742043413059301306072a86
48ce3d020106082a8648ce3d030107034200040c1b1e82ba8cc72680973f
97edb8a0c72ab0d405f05d4fe29b997a14ccce89008313d09666b6ce375c
595fcc8e37f8e4354497011be90e56794bd91ad951ab45a3818430818130
1d0603551d0e041604141df1208944d77b5f1d9dcb51ee244a523f3ef5de
301f0603551d230418301680141df1208944d77b5f1d9dcb51ee244a523f
3ef5de300f0603551d130101ff040530030101ff300e0603551d0f0101ff
040403020106301e0603551d110417301581136365727469667940657861
6d706c652e636f6d300a06082a8648ce3d040302034800304502202b891d
d411d07a6d6f621947635ba4c43165296b3f633726f02e51ecf464bd4002
2100b4be8a80d08675f041fbc719acf3b39dedc85dc92b3035868cb2daa8
f05db196a1003100

The plain-text version of that payload lives in Appendix C.1 ๐Ÿฆ‹.

A.2. enroll / reenroll ๐ŸŽ€

Now for the enroll and reenroll glow-up ๐Ÿ’…. During the (re-)enroll exchange, the EST-coaps client sends a CSR in the POST payload, using Content-Format 286. The Accept Option tells the server the client wants Content-Format 281 (PKCS #7) back ๐ŸŒˆ. As Appendix C.2 shows, the CSR carries a challengePassword, and that's what gets used for POP linking (Section 3) ๐Ÿ”ฅ.

POST [2001:db8::2:321]:61616/est/sen
(Token: 0x45)
(Accept: 281)
(Content-Format: 286)

Again, the hex below would NOT be transported as hex. It's binary underneath, and hex is just the readable version ๐Ÿ™ˆ.

3082018b30820131020100305c310b3009060355040613025553310b3009
06035504080c024341310b300906035504070c024c413114301206035504
0a0c0b6578616d706c6520496e63310c300a060355040b0c03496f54310f
300d060355040513065774313233343059301306072a8648ce3d02010608
2a8648ce3d03010703420004c8b421f11c25e47e3ac57123bf2d9fdc494f
028bc351cc80c03f150bf50cff958d75419d81a6a245dffae790be95cf75
f602f9152618f816a2b23b5638e59fd9a073303406092a864886f70d0109
0731270c2576437630292a264a4b4a3bc3a2c280c2992f3e3c2e2c3d6b6e
7634332323403d204e787e60303b06092a864886f70d01090e312e302c30
2a0603551d1104233021a01f06082b06010505070804a013301106092b06
010401b43b0a01040401020304300a06082a8648ce3d0403020348003045
02210092563a546463bd9ecff170d0fd1f2ef0d3d012160e5ee90cffedab
ec9b9a38920220179f10a3436109051abad17590a09bc87c4dce5453a6fc
1135a1e84eed754377

Once the server has verified the CSR, it sends back a 2.04 Changed response with the issued cert ๐Ÿ“.

2.04 Changed
(Token: 0x45)
(Content-Format: 281)

Same deal here: the hex would NOT be transported as hex ๐Ÿฆ‹.

3082026e06092a864886f70d010702a082025f3082025b0201013100300b
06092a864886f70d010701a08202413082023d308201e2a0030201020208
7e7661d7b54e4632300a06082a8648ce3d040302305d310b300906035504
0613025553310b300906035504080c02434131143012060355040a0c0b45
78616d706c6520496e6331163014060355040b0c0d636572746966696361
74696f6e3113301106035504030c0a3830322e3141522043413020170d31
39303133313131323931365a180f39393939313233313233353935395a30
5c310b3009060355040613025553310b300906035504080c024341310b30
0906035504070c024c4131143012060355040a0c0b6578616d706c652049
6e63310c300a060355040b0c03496f54310f300d06035504051306577431
3233343059301306072a8648ce3d020106082a8648ce3d03010703420004
c8b421f11c25e47e3ac57123bf2d9fdc494f028bc351cc80c03f150bf50c
ff958d75419d81a6a245dffae790be95cf75f602f9152618f816a2b23b56
38e59fd9a3818a30818730090603551d1304023000301d0603551d0e0416
041496600d8716bf7fd0e752d0ac760777ad665d02a0301f0603551d2304
183016801468d16551f951bfc82a431d0d9f08bc2d205b1160300e060355
1d0f0101ff0404030205a0302a0603551d1104233021a01f06082b060105
05070804a013301106092b06010401b43b0a01040401020304300a06082a
8648ce3d0403020349003046022100c0d81996d2507d693f3c48eaa5ee94
91bda6db214099d98117c63b361374cd86022100a774989f4c321a5cf25d
832a4d336a08ad67df20f1506421188a0ade6d349236a1003100

The request and response in plain text are in Appendix C.2 ๐ŸŒธ.

A.3. serverkeygen ๐Ÿงš

In a serverkeygen exchange, the CoAP POST request looks like this:

POST 192.0.2.1:8085/est/skg
(Token: 0xa5)
(Accept: 62)
(Content-Format: 286)

Reminder ๐Ÿ’€: the hex would NOT be transported as hex. It's binary, and hex is just for us humans.

3081d03078020100301631143012060355040a0c0b736b67206578616d70
6c653059301306072a8648ce3d020106082a8648ce3d03010703420004c8
b421f11c25e47e3ac57123bf2d9fdc494f028bc351cc80c03f150bf50cff
958d75419d81a6a245dffae790be95cf75f602f9152618f816a2b23b5638
e59fd9a000300a06082a8648ce3d040302034800304502207c553981b1fe
349249d8a3f50a0346336b7dfaa099cf74e1ec7a37a0a760485902210084
79295398774b2ff8e7e82abb0c17eaef344a5088fa69fd63ee611850c34b
0a

The response follows [RFC8710] and looks something like this: a 2.04 Changed with Token 0xa5 and Content-Format 62 โœจ.

2.04 Changed
(Token: 0xa5)
(Content-Format: 62)

Once more, the hex representations below would NOT be transported as hex. Binary all the way down ๐Ÿ’œ.

84                                   # array(4)
19 011C                              # unsigned(284)
58 8A                                # bytes(138)
308187020100301306072a8648ce3d020106082a8648ce3d030107046d30
6b020101042061336a86ac6e7af4a96f632830ad4e6aa0837679206094d7
679a01ca8c6f0c37a14403420004c8b421f11c25e47e3ac57123bf2d9fdc
494f028bc351cc80c03f150bf50cff958d75419d81a6a245dffae790be95
cf75f602f9152618f816a2b23b5638e59fd9
19 0119                              # unsigned(281)
59 01D3                              # bytes(467)
308201cf06092a864886f70d010702a08201c0308201bc0201013100300b
06092a864886f70d010701a08201a23082019e30820144a0030201020209
00b3313e8f3fc9538e300a06082a8648ce3d040302301631143012060355
040a0c0b736b67206578616d706c65301e170d3139303930343037343430
335a170d3339303833303037343430335a301631143012060355040a0c0b
736b67206578616d706c653059301306072a8648ce3d020106082a8648ce
3d03010703420004c8b421f11c25e47e3ac57123bf2d9fdc494f028bc351
cc80c03f150bf50cff958d75419d81a6a245dffae790be95cf75f602f915
2618f816a2b23b5638e59fd9a37b307930090603551d1304023000302c06
096086480186f842010d041f161d4f70656e53534c2047656e6572617465
64204365727469666963617465301d0603551d0e0416041496600d8716bf
7fd0e752d0ac760777ad665d02a0301f0603551d2304183016801496600d
8716bf7fd0e752d0ac760777ad665d02a0300a06082a8648ce3d04030203
48003045022100e95bfa25a08976652246f2d96143da39fce0dc4c9b26b9
cce1f24164cc2b12b602201351fd8eea65764e3459d324e4345ff5b2a915
38c04976111796b3698bf6379ca1003100

Spicy detail ๐ŸŒถ๏ธ: the private key in that response has no CMS EnvelopedData wrapper and no extra encryption beyond DTLS (Section 4.8) ๐Ÿ”. The request and response in plain text are in Appendix C.3 ๐ŸŽ€.

A.4. csrattrs ๐Ÿฆ‹

Last one in this batch: a csrattrs exchange โœจ.

REQ:
GET example.com:61616/est/att

RES:
2.05 Content
(Content-Format: 285)

The hex is binary, so it would NOT be transported as hex ๐Ÿ™ˆ.

307c06072b06010101011630220603883701311b131950617273652053455
420617320322e3939392e31206461746106092a864886f70d010907302c06
0388370231250603883703060388370413195061727365205345542061732
0322e3939392e32206461746106092b240303020801010b06096086480165
03040202

A 2.05 Content response should carry attributes that make sense for the authenticated client ๐Ÿ’…. This example is borrowed from Appendix A.2 of [RFC7030], except the base64 has been swapped for the equivalent binary, shown here in hex. The EST-coaps server can send attributes the client doesn't recognise, and the client is free to ignore them ๐ŸŒˆ.

Appendix B. EST-coaps Block Message Examples ๐ŸŒˆ

Two examples live in this section โœจ:

  1. A cacerts exchange shows Block2 in action, plus the block headers.
  2. An enroll exchange shows the Block1 and Block2 size negotiation for request and response payloads.

The payloads here are unencrypted for readability ๐Ÿ“–. In real life, the contents are binary and travel through an encrypted DTLS tunnel ๐Ÿ”. You'll only see the CoAP headers in Appendix B.1, and building CoAP headers is assumed to be pretty well known already ๐Ÿ’œ.

B.1. cacerts ๐ŸŽ€

okay so this one is a full walkthrough of DTLS and CoAP Option Block2 ๐Ÿฆ‹ the block length is 64, which gives an SZX value of 2 โœจ

The cacerts response from Appendix A.1 of [RFC7030] is 639 bytes in binary for this example. CoAP adds around 10 bytes and the DTLS record adds around 29 bytes ๐Ÿ’… To avoid IP fragmentation, the CoAP Block Option is used and we assume an MTU of 127 so everything fits in one IEEE 802.15.4 packet. To stay below that 127 MTU, the payload gets split into 9 packets with 64 bytes each, plus a tenth packet with the last 63 bytes ๐Ÿ“ The client sends an IPv6 packet holding a UDP datagram, with DTLS record protection wrapping a CoAP request, and does this 10 times, once for each block. The server sends back an IPv6 packet with a UDP datagram carrying the DTLS record that wraps the CoAP response ๐ŸŒธ

Here's how to read the Block Option notation: block-option:NUM/M/size. The kind of Block Option is 2 in this case, followed by a colon. Then comes the block number (NUM), the more bit (M = 0 in a Block2 response means it's the last block), and the block size with its exponent, 2^(SZX+4), all separated by slashes. The Length 64 is used with SZX=2 ๐Ÿงš The CoAP Request is sent Confirmable (CON). The Content-Format of the response is 281 (application/pkcs7-mime; smime-type=certs-only), even though it isn't shown in the exchange below ๐Ÿ’œ The transfer of the 10 blocks, with the partially filled block NUM=9, looks like this:

      GET example.com:9085/est/crts (2:0/0/64)  -->
                    <--   (2:0/1/64) 2.05 Content
      GET example.com:9085/est/crts (2:1/0/64)  -->
                    <--   (2:1/1/64) 2.05 Content
                                  |
                                  |
                                  |
      GET example.com:9085/est/crts (2:9/0/64) -->
                    <--   (2:9/0/64) 2.05 Content

The GET request header looks like this ๐Ÿ‘‘

     Ver = 1
     T = 0 (CON)
     Code = 0x01 (0.1 GET)
     Token = 0x9a    (client generated)
     Options
      Option (Uri-Host)
        Option Delta = 0x3  (option# 3)
        Option Length = 0xB
        Option Value = "example.com"
      Option (Uri-Port)
        Option Delta = 0x4   (option# 3+4=7)
        Option Length = 0x2
        Option Value = 9085
      Option (Uri-Path)
        Option Delta = 0x4    (option# 7+4=11)
        Option Length = 0x3
        Option Value = "est"
      Option (Uri-Path)Uri-Path)
        Option Delta = 0x0    (option# 11+0=11)
        Option Length = 0x4
        Option Value = "crts"
      Option (Accept)
        Option Delta = 0x6   (option# 11+6=17)
        Option Length = 0x2
        Option Value = 281
     Payload = [Empty]

So the Uri-Host and Uri-Port Options can be left out if they match the transport protocol's destination address and port, respectively ๐Ÿซถ Writing them out explicitly is typically useful when one endpoint hosts several virtual servers and needs the Options to route each request to the right one ๐ŸŒˆ

To get more details on the CoAP headers, here are the first two blocks and the last one ๐Ÿ”ฅ First up is the header of the first Block2 response:

     Ver = 1
     T = 2 (ACK)
     Code = 0x45 (2.05 Content)
     Token = 0x9a     (copied from request by server)
     Options
       Option
         Option Delta = 0xC  (option# 12 Content-Format)
         Option Length = 0x2
         Option Value = 281
       Option
         Option Delta = 0xB  (option# 12+11=23 Block2)
         Option Length = 0x1
         Option Value = 0x0A (block#=0, M=1, SZX=2)

     [ The hexadecimal representation below would NOT be transported
     in hex, but in binary. Hex is used because a binary representation
     cannot be rendered well in text. ]

     Payload =
   3082027b06092a864886f70d010702a082026c308202680201013100300b
   06092a864886f70d010701a082024e3082024a308201f0a0030201020209
   009189bc

Next, the header of the second Block2 response ๐Ÿ’–

     Ver = 1
     T = 2 (means ACK)
     Code = 0x45 (2.05 Content)
     Token = 0x9a     (copied from request by server)
     Options
       Option
         Option Delta = 0xC  (option# 12 Content-Format)
         Option Length = 0x2
         Option Value = 281
       Option
         Option Delta = 0xB  (option 12+11=23 Block2)
         Option Length = 0x1
         Option Value = 0x1A (block#=1, M=1, SZX=2)

     [ The hexadecimal representation below would NOT be transported
     in hex, but in binary. Hex is used because a binary representation
     cannot be rendered well in text. ]

     Payload =
   df9c99244b300a06082a8648ce3d0403023067310b300906035504061302
   5553310b300906035504080c024341310b300906035504070c024c413114
   30120603

And last but not least, the header of the tenth and final Block2 response ๐Ÿ˜ญ

     Ver = 1
     T = 2 (means ACK)
     Code = 0x45      (2.05 Content)
     Token = 0x9a     (copied from request by server)
     Options
       Option
         Option Delta = 0xC  (option# 12 Content-Format)
         Option Length = 0x2
         Option Value = 281
       Option
         Option Delta = 0xB  (option# 12+11=23 Block2 )
         Option Length = 0x1
         Option Value = 0x92 (block#=9, M=0, SZX=2)

     [ The hexadecimal representation below would NOT be transported
     in hex, but in binary. Hex is used because a binary representation
     cannot be rendered well in text. ]

     Payload =
   2ec0b4af52d46f3b7ecc9687ddf267bcec368f7b7f1353272f022047a28a
   e5c7306163b3c3834bab3c103f743070594c089aaa0ac870cd13b902caa1
   003100

B.2. enroll / reenroll ๐ŸŒธ

okay this one is the enrollment example ๐Ÿงš the client asks for a Block2 size of 256 bytes, and it sends that request in the very first message โœจ 256 is equal to 2^(SZX+4), which gives SZX=4. Block numbering works exactly the same as in B.1. The header fields and payload are left out here to keep things short ๐Ÿซถ

   POST [2001:db8::2:1]:61616/est/sen (CON)(1:0/1/256)
                      {CSR (frag# 1)} -->

          <-- (ACK) (1:0/1/256) (2.31 Continue)
   POST [2001:db8::2:1]:61616/est/sen (CON)(1:1/1/256)
                      {CSR (frag# 2)} -->
          <-- (ACK) (1:1/1/256) (2.31 Continue)
                         .
                         .
                         .
   POST [2001:db8::2:1]:61616/est/sen (CON)(1:N1/0/256)
                      {CSR(frag# N1+1)}-->
                         |
       ...........Immediate response  .........
                         |
     <-- (ACK) (1:N1/0/256)(2:0/1/256)(2.04 Changed)
                      {Cert resp (frag# 1)}
   POST [2001:db8::2:1]:61616/est/sen (CON)(2:1/0/256)           -->
     <-- (ACK) (2:1/1/256)(2.04 Changed)
                      {Cert resp (frag# 2)}
                         .
                         .
                         .
   POST [2001:db8::2:321]:61616/est/sen (CON)(2:N2/0/256)          -->
     <-- (ACK) (2:N2/0/256) (2.04 Changed)
                      {Cert resp (frag# N2+1)}

            Figure 6: EST-coaps Enrollment with Multiple Blocks

So in total, N1+1 blocks go from client to server, and N2+1 blocks go from server to client ๐Ÿ’œ


Appendix C. Message Content Breakdown โœจ

okay this appendix is where we crack open the binary payloads from Appendix A and show them as plain-text hex dumps ๐Ÿ”ฅ It's basically the "what's actually inside" tour ๐Ÿ’…

C.1. cacerts ๐Ÿฆ‹

Here's the cacerts response, which holds one root CA certificate, in plain text ๐ŸŒˆ

   Certificate:
       Data:
           Version: 3 (0x2)
           Serial Number: 831953162763987486 (0xb8bb0fe604f6a1e)
       Signature Algorithm: ecdsa-with-SHA256
           Issuer: C=US, ST=CA, L=LA, O=Example Inc,
                     OU=certification, CN=Root CA
           Validity
               Not Before: Jan 31 11:27:03 2019 GMT
               Not After : Jan 26 11:27:03 2039 GMT
           Subject: C=US, ST=CA, L=LA, O=Example Inc,
                        OU=certification, CN=Root CA
           Subject Public Key Info:
               Public Key Algorithm: id-ecPublicKey
                   Public-Key: (256 bit)
                   pub:
                       04:0c:1b:1e:82:ba:8c:c7:26:80:97:3f:97:ed:b8:
                       a0:c7:2a:b0:d4:05:f0:5d:4f:e2:9b:99:7a:14:cc:
                       ce:89:00:83:13:d0:96:66:b6:ce:37:5c:59:5f:cc:
                       8e:37:f8:e4:35:44:97:01:1b:e9:0e:56:79:4b:d9:
                       1a:d9:51:ab:45
                   ASN1 OID: prime256v1
                   NIST CURVE: P-256
           X509v3 extensions:
               X509v3 Subject Key Identifier:
   1D:F1:20:89:44:D7:7B:5F:1D:9D:CB:51:EE:24:4A:52:3F:3E:F5:DE
               X509v3 Authority Key Identifier:
                     keyid:
   1D:F1:20:89:44:D7:7B:5F:1D:9D:CB:51:EE:24:4A:52:3F:3E:F5:DE

               X509v3 Basic Constraints: critical
                   CA:TRUE
               X509v3 Key Usage: critical
                   Certificate Sign, CRL Sign
               X509v3 Subject Alternative Name:
                   email:certify@example.com
       Signature Algorithm: ecdsa-with-SHA256
            30:45:02:20:2b:89:1d:d4:11:d0:7a:6d:6f:62:19:47:63:5b:
            a4:c4:31:65:29:6b:3f:63:37:26:f0:2e:51:ec:f4:64:bd:40:
            02:21:00:b4:be:8a:80:d0:86:75:f0:41:fb:c7:19:ac:f3:b3:
            9d:ed:c8:5d:c9:2b:30:35:86:8c:b2:da:a8:f0:5d:b1:96

C.2. enroll / reenroll ๐Ÿ’Œ

okay so here's the enrollment request in plain text, bestie ๐Ÿ’–

Certificate Request:
    Data:
        Version: 0 (0x0)
        Subject: C=US, ST=CA, L=LA, O=example Inc,
                    OU=IoT/serialNumber=Wt1234
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub:
                    04:c8:b4:21:f1:1c:25:e4:7e:3a:c5:71:23:bf:2d:
                    9f:dc:49:4f:02:8b:c3:51:cc:80:c0:3f:15:0b:f5:
                    0c:ff:95:8d:75:41:9d:81:a6:a2:45:df:fa:e7:90:
                    be:95:cf:75:f6:02:f9:15:26:18:f8:16:a2:b2:3b:
                    56:38:e5:9f:d9
                ASN1 OID: prime256v1
                NIST CURVE: P-256
        Attributes:
            challengePassword:   <256-bit POP linking value>
        Requested Extensions:
            X509v3 Subject Alternative Name:
                othername:<unsupported>
    Signature Algorithm: ecdsa-with-SHA256
         30:45:02:21:00:92:56:3a:54:64:63:bd:9e:cf:f1:70:d0:fd:
         1f:2e:f0:d3:d0:12:16:0e:5e:e9:0c:ff:ed:ab:ec:9b:9a:38:
         92:02:20:17:9f:10:a3:43:61:09:05:1a:ba:d1:75:90:a0:9b:
         c8:7c:4d:ce:54:53:a6:fc:11:35:a1:e8:4e:ed:75:43:77

the CSR carries a challengePassword, which is used for POP linking (Section 3) ๐Ÿ”—. it also has an id-on-hardwareModuleName hardware identifier, so the returned certificate gets customized to the requesting device โœจ (See [RFC7299] and [PKI-GUIDE]).

and here's the issued certificate, also in plain text ๐ŸŽ€

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 9112578475118446130 (0x7e7661d7b54e4632)
    Signature Algorithm: ecdsa-with-SHA256
        Issuer: C=US, ST=CA, O=Example Inc,
                      OU=certification, CN=802.1AR CA
        Validity
            Not Before: Jan 31 11:29:16 2019 GMT
            Not After : Dec 31 23:59:59 9999 GMT
        Subject: C=US, ST=CA, L=LA, O=example Inc,
                OU=IoT/serialNumber=Wt1234
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub:
                    04:c8:b4:21:f1:1c:25:e4:7e:3a:c5:71:23:bf:2d:
                    9f:dc:49:4f:02:8b:c3:51:cc:80:c0:3f:15:0b:f5:
                    0c:ff:95:8d:75:41:9d:81:a6:a2:45:df:fa:e7:90:
                    be:95:cf:75:f6:02:f9:15:26:18:f8:16:a2:b2:3b:
                    56:38:e5:9f:d9
                ASN1 OID: prime256v1
                NIST CURVE: P-256
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Subject Key Identifier:
96:60:0D:87:16:BF:7F:D0:E7:52:D0:AC:76:07:77:AD:66:5D:02:A0
            X509v3 Authority Key Identifier:
                keyid:
68:D1:65:51:F9:51:BF:C8:2A:43:1D:0D:9F:08:BC:2D:20:5B:11:60

            X509v3 Key Usage: critical
                Digital Signature, Key Encipherment
            X509v3 Subject Alternative Name:
                othername:<unsupported>
    Signature Algorithm: ecdsa-with-SHA256
         30:46:02:21:00:c0:d8:19:96:d2:50:7d:69:3f:3c:48:ea:a5:
         ee:94:91:bd:a6:db:21:40:99:d9:81:17:c6:3b:36:13:74:cd:
         86:02:21:00:a7:74:98:9f:4c:32:1a:5c:f2:5d:83:2a:4d:33:
         6a:08:ad:67:df:20:f1:50:64:21:18:8a:0a:de:6d:34:92:36

C.3. serverkeygen ๐Ÿงš

first up, the server-side key generation request, in plain text ๐Ÿ“

Certificate Request:
    Data:
        Version: 0 (0x0)
        Subject: O=skg example
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub:
                    04:c8:b4:21:f1:1c:25:e4:7e:3a:c5:71:23:bf:2d:
                    9f:dc:49:4f:02:8b:c3:51:cc:80:c0:3f:15:0b:f5:
                    0c:ff:95:8d:75:41:9d:81:a6:a2:45:df:fa:e7:90:
                    be:95:cf:75:f6:02:f9:15:26:18:f8:16:a2:b2:3b:
                    56:38:e5:9f:d9
                ASN1 OID: prime256v1
                NIST CURVE: P-256
        Attributes:
            a0:00
    Signature Algorithm: ecdsa-with-SHA256
         30:45:02:20:7c:55:39:81:b1:fe:34:92:49:d8:a3:f5:0a:03:
         46:33:6b:7d:fa:a0:99:cf:74:e1:ec:7a:37:a0:a7:60:48:59:
         02:21:00:84:79:29:53:98:77:4b:2f:f8:e7:e8:2a:bb:0c:17:
         ea:ef:34:4a:50:88:fa:69:fd:63:ee:61:18:50:c3:4b:0a

next, the private key content from the server-side key generation response, also in plain text ๐Ÿ”

Private-Key: (256 bit)
    priv:
        61:33:6a:86:ac:6e:7a:f4:a9:6f:63:28:30:ad:4e:
        6a:a0:83:76:79:20:60:94:d7:67:9a:01:ca:8c:6f:
        0c:37
    pub:
        04:c8:b4:21:f1:1c:25:e4:7e:3a:c5:71:23:bf:2d:
        9f:dc:49:4f:02:8b:c3:51:cc:80:c0:3f:15:0b:f5:
        0c:ff:95:8d:75:41:9d:81:a6:a2:45:df:fa:e7:90:
        be:95:cf:75:f6:02:f9:15:26:18:f8:16:a2:b2:3b:
        56:38:e5:9f:d9
    ASN1 OID: prime256v1
    NIST CURVE: P-256

and last, the certificate from the server-side key generation response payload, in plain text ๐Ÿฆ‹

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            b3:31:3e:8f:3f:c9:53:8e
    Signature Algorithm: ecdsa-with-SHA256
        Issuer: O=skg example
        Validity
            Not Before: Sep  4 07:44:03 2019 GMT
            Not After : Aug 30 07:44:03 2039 GMT
        Subject: O=skg example
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub:
                    04:c8:b4:21:f1:1c:25:e4:7e:3a:c5:71:23:bf:2d:
                    9f:dc:49:4f:02:8b:c3:51:cc:80:c0:3f:15:0b:f5:
                    0c:ff:95:8d:75:41:9d:81:a6:a2:45:df:fa:e7:90:
                    be:95:cf:75:f6:02:f9:15:26:18:f8:16:a2:b2:3b:
                    56:38:e5:9f:d9
                ASN1 OID: prime256v1
                NIST CURVE: P-256
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            Netscape Comment:
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier:
96:60:0D:87:16:BF:7F:D0:E7:52:D0:AC:76:07:77:AD:66:5D:02:A0
            X509v3 Authority Key Identifier:
                keyid:
96:60:0D:87:16:BF:7F:D0:E7:52:D0:AC:76:07:77:AD:66:5D:02:A0

    Signature Algorithm: ecdsa-with-SHA256
         30:45:02:21:00:e9:5b:fa:25:a0:89:76:65:22:46:f2:d9:61:
         43:da:39:fc:e0:dc:4c:9b:26:b9:cc:e1:f2:41:64:cc:2b:12:
         b6:02:20:13:51:fd:8e:ea:65:76:4e:34:59:d3:24:e4:34:5f:
         f5:b2:a9:15:38:c0:49:76:11:17:96:b3:69:8b:f6:37:9c

Acknowledgements โœจ

The authors are super grateful to Klaus Hartke for his detailed explanations on the use of Block with DTLS and his support for the Content-Format specification ๐Ÿ™Œ. They also want to thank Esko Dijk and Michael Verschoor for the valuable discussions that helped shape the solution ๐Ÿ’œ. They'd like to thank Peter Panburana too, for his feedback on technical details of the solution ๐ŸŒธ. Constructive comments came from Benjamin Kaduk, Eliot Lear, Jim Schaad, Hannes Tschofenig, Julien Vermillard, John Manuel, Oliver Pfaff, Pete Beal, and Carsten Bormann ๐Ÿ’….

Interop tests were done by Oliver Pfaff, Thomas Werner, Oskar Camezind, Bjorn Elmers, and Joel Hoglund ๐Ÿงช.

Robert Moskowitz provided code to create the examples ๐Ÿ’ป.

Contributors ๐Ÿซถ

Martin Furuhed contributed to the EST-coaps specification by giving feedback based on the Nexus EST-over-CoAPS server implementation that started in 2015 ๐ŸŽ€. Sandeep Kumar kick-started this specification and was instrumental in drawing attention to how important the subject is ๐Ÿ‘‘.

Authors' Addresses ๐Ÿฆ‹

  • Peter van der Stok
    • Consultant
    • Email: stokcons@bbhmail.nl
  • Panos Kampanakis
    • Cisco Systems
    • Email: pkampana@cisco.com
  • Michael C. Richardson
  • Shahid Raza
    • RISE Research Institutes of Sweden
    • Isafjordsgatan 22
    • SE-16440 Kista, Stockholm
    • Sweden
    • Email: shahid.raza@ri.se
๐Ÿ“ฆ where this page comes from