idnits 2.17.1 draft-ietf-ace-coap-est-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC3849-compliant IPv6 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 8, 2019) is 1874 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'Empty' is mentioned on line 1731, but not defined == Unused Reference: 'I-D.ietf-lamps-rfc5751-bis' is defined on line 1271, but no explicit reference was found in the text == Outdated reference: A later version (-04) exists of draft-ietf-core-multipart-ct-02 == Outdated reference: A later version (-43) exists of draft-ietf-tls-dtls13-30 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Downref: Normative reference to an Informational RFC: RFC 5967 ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) == Outdated reference: A later version (-13) exists of draft-ietf-tls-dtls-connection-id-02 == Outdated reference: A later version (-10) exists of draft-moskowitz-ecdsa-pki-04 -- Obsolete informational reference (is this intentional?): RFC 7230 (Obsoleted by RFC 9110, RFC 9112) -- Obsolete informational reference (is this intentional?): RFC 7231 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 7525 (Obsoleted by RFC 9325) Summary: 3 errors (**), 0 flaws (~~), 8 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 ACE P. van der Stok 3 Internet-Draft Consultant 4 Intended status: Standards Track P. Kampanakis 5 Expires: September 9, 2019 Cisco Systems 6 M. Richardson 7 SSW 8 S. Raza 9 RISE SICS 10 March 8, 2019 12 EST over secure CoAP (EST-coaps) 13 draft-ietf-ace-coap-est-10 15 Abstract 17 Enrollment over Secure Transport (EST) is used as a certificate 18 provisioning protocol over HTTPS. Low-resource devices often use the 19 lightweight Constrained Application Protocol (CoAP) for message 20 exchanges. This document defines how to transport EST payloads over 21 secure CoAP (EST-coaps), which allows constrained devices to use 22 existing EST functionality for provisioning certificates. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at https://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on September 9, 2019. 41 Copyright Notice 43 Copyright (c) 2019 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (https://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . 3 59 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 6 60 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 61 4. DTLS and conformance to RFC7925 profiles . . . . . . . . . . 7 62 5. Protocol Design . . . . . . . . . . . . . . . . . . . . . . . 9 63 5.1. Discovery and URIs . . . . . . . . . . . . . . . . . . . 9 64 5.2. Mandatory/optional EST Functions . . . . . . . . . . . . 12 65 5.3. Payload formats . . . . . . . . . . . . . . . . . . . . . 12 66 5.4. Message Bindings . . . . . . . . . . . . . . . . . . . . 13 67 5.5. CoAP response codes . . . . . . . . . . . . . . . . . . . 14 68 5.6. Message fragmentation . . . . . . . . . . . . . . . . . . 15 69 5.7. Delayed Responses . . . . . . . . . . . . . . . . . . . . 16 70 5.8. Server-side Key Generation . . . . . . . . . . . . . . . 18 71 6. HTTPS-CoAPS Registrar . . . . . . . . . . . . . . . . . . . . 19 72 7. Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 21 73 8. Deployment limitations . . . . . . . . . . . . . . . . . . . 22 74 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22 75 9.1. Content-Format Registry . . . . . . . . . . . . . . . . . 22 76 9.2. Resource Type registry . . . . . . . . . . . . . . . . . 23 77 10. Security Considerations . . . . . . . . . . . . . . . . . . . 23 78 10.1. EST server considerations . . . . . . . . . . . . . . . 23 79 10.2. HTTPS-CoAPS Registrar considerations . . . . . . . . . . 25 80 11. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 26 81 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 26 82 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 26 83 13.1. Normative References . . . . . . . . . . . . . . . . . . 26 84 13.2. Informative References . . . . . . . . . . . . . . . . . 28 85 Appendix A. EST messages to EST-coaps . . . . . . . . . . . . . 30 86 A.1. cacerts . . . . . . . . . . . . . . . . . . . . . . . . . 31 87 A.2. enroll / reenroll . . . . . . . . . . . . . . . . . . . . 32 88 A.3. serverkeygen . . . . . . . . . . . . . . . . . . . . . . 34 89 A.4. csrattrs . . . . . . . . . . . . . . . . . . . . . . . . 36 90 Appendix B. EST-coaps Block message examples . . . . . . . . . . 37 91 B.1. cacerts . . . . . . . . . . . . . . . . . . . . . . . . . 37 92 B.2. enroll / reenroll . . . . . . . . . . . . . . . . . . . . 41 93 Appendix C. Message content breakdown . . . . . . . . . . . . . 42 94 C.1. cacerts . . . . . . . . . . . . . . . . . . . . . . . . . 42 95 C.2. enroll / reenroll . . . . . . . . . . . . . . . . . . . . 44 96 C.3. serverkeygen . . . . . . . . . . . . . . . . . . . . . . 45 98 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 47 100 1. Change Log 102 EDNOTE: Remove this section before publication 104 -10 106 Addressed WGLC comments 108 More consistent request format in the examples. 110 Explained root resource difference when there is resource 111 discovery 113 Clarified when the client is supposed to do discovery 115 Fixed nits and minor Option length inaccurracies in the examples. 117 -09 119 WGLC comments taken into account 121 consensus about discovery of content-format 123 added additional path for content-format selection 125 merged DTLS sections 127 -08 129 added application/pkix-cert Content-Format TBD287. 131 discovery text clarified 133 Removed text on ct negotiation in connection to multipart-core 135 removed text that duplicates or contradicts RFC7252 (thanks Klaus) 137 Stated that well-known/est is compulsory 139 Use of response codes clarified. 141 removed bugs: Max-Age and Content-Format Options in Request 143 Accept Option explained for est/skg and added in enroll example 144 Added second URI /skc for server-side key gen and a simple cert 145 (not PKCS#7) 147 Persistence of DTLS connection clarified. 149 Minor text fixes. 151 -07: 153 redone examples from scratch with openssl 155 Updated authors. 157 Added CoAP RST as a MAY for an equivalent to an HTTP 204 message. 159 Added serialization example of the /skg CBOR response. 161 Added text regarding expired IDevIDs and persistent DTLS 162 connection that will start using the Explicit TA Database in the 163 new DTLS connection. 165 Nits and fixes 167 Removed CBOR envelop for binary data 169 Replaced TBD8 with 62. 171 Added RFC8174 reference and text. 173 Clarified MTI for server-side key generation and Content-Formats. 174 Defined the /skg MTI (PKCS#8) and the cases where CMS encryption 175 will be used. 177 Moved Fragmentation section up because it was referenced in 178 sections above it. 180 -06: 182 clarified discovery section, by specifying that no discovery may 183 be needed for /.well-known/est URI. 185 added resource type values for IANA 187 added list of compulsory to implement and optional functions. 189 Fixed issues pointed out by the idnits tool. 191 Updated CoAP response codes section with more mappings between EST 192 HTTP codes and EST-coaps CoAP codes. 194 Minor updates to the MTI EST Functions section. 196 Moved Change Log section higher. 198 -05: 200 repaired again 202 TBD8 = 62 removed from C-F registration, to be done in CT draft. 204 -04: 206 Updated Delayed response section to reflect short and long delay 207 options. 209 -03: 211 Removed observe and simplified long waits 213 Repaired Content-Format specification 215 -02: 217 Added parameter discussion in section 8 219 Concluded Content-Format specification using multipart-ct draft 221 examples updated 223 -01: 225 Editorials done. 227 Redefinition of proxy to Registrar in Section 6. Explained better 228 the role of https-coaps Registrar, instead of "proxy" 230 Provide "observe" Option examples 232 extended block message example. 234 inserted new server key generation text in Section 5.8 and 235 motivated server key generation. 237 Broke down details for DTLS 1.3 238 New Media-Type uses CBOR array for multiple Content-Format 239 payloads 241 provided new Content-Format tables 243 new media format for IANA 245 -00 247 copied from vanderstok-ace-coap-04 249 2. Introduction 251 "Classical" Enrollment over Secure Transport (EST) [RFC7030] is used 252 for authenticated/authorized endpoint certificate enrollment (and 253 optionally key provisioning) through a Certificate Authority (CA) or 254 Registration Authority (RA). EST transports messages over HTTPS. 256 This document defines a new transport for EST based on the 257 Constrained Application Protocol (CoAP) since some Internet of Things 258 (IoT) devices use CoAP instead of HTTP. Therefore, this 259 specification utilizes DTLS [RFC6347] and CoAP [RFC7252] instead of 260 TLS [RFC8446] and HTTP [RFC7230]. 262 EST responses can be relatively large and for this reason this 263 specification also uses CoAP Block-Wise Transfer [RFC7959] to offer a 264 fragmentation mechanism of EST messages at the CoAP layer. 266 This document also profiles the use of EST to only support 267 certificate-based client authentication. HTTP Basic or Digest 268 authentication (as described in Section 3.2.3 of [RFC7030]) are not 269 supported. 271 3. Terminology 273 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 274 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 275 "OPTIONAL" in this document are to be interpreted as described in BCP 276 14 [RFC2119] [RFC8174] when, and only when, they appear in all 277 capitals, as shown here. 279 Many of the concepts in this document are taken from [RFC7030]. 280 Consequently, much text is directly traceable to [RFC7030]. 282 4. DTLS and conformance to RFC7925 profiles 284 This section describes how EST-coaps fits into the profiles of low- 285 resource devices described in [RFC7925]. EST-coaps can transport 286 certificates and private keys. Certificates are responses to 287 (re-)enrollment requests or requests for a trusted certificate list. 288 Private keys can be transported as responses to a server-side key 289 generation request as described in Section 4.4 of [RFC7030] and 290 discussed in Section 5.8 of this document. 292 EST-coaps depends on a secure transport mechanism that secures the 293 exchanged CoAP messages. DTLS is one such secure protocol. No other 294 changes are necessary regarding the secure transport of EST messages. 296 +------------------------------------------------+ 297 | EST request/response messages | 298 +------------------------------------------------+ 299 | CoAP for message transfer and signaling | 300 +------------------------------------------------+ 301 | Secure Transport | 302 +------------------------------------------------+ 304 Figure 1: EST-coaps protocol layers 306 As per sections 3.3 and 4.4 of [RFC7925], the mandatory cipher suite 307 for DTLS in EST-coaps is TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 308 [RFC7251]. Curve secp256r1 MUST be supported [RFC8422]; this curve 309 is equivalent to the NIST P-256 curve. Additionally, crypto agility 310 is important, and the recommendations in Section 4.4 of [RFC7925] and 311 any updates to it concerning Curve25519 and other curves also apply. 313 DTLS 1.2 implementations must use the Supported Elliptic Curves and 314 Supported Point Formats Extensions in [RFC8422]. Uncompressed point 315 format must also be supported. DTLS 1.3 [I-D.ietf-tls-dtls13] 316 implementations differ from DTLS 1.2 because they do not support 317 point format negotiation in favor of a single point format for each 318 curve. Thus, support for DTLS 1.3 does not mandate point format 319 extensions and negotiation. 321 CoAP was designed to avoid IP fragmentation. DTLS is used to secure 322 CoAP messages. However, fragmentation is still possible at the DTLS 323 layer during the DTLS handshake when using ECC ciphersuites. If 324 fragmentation is necessary, "DTLS provides a mechanism for 325 fragmenting a handshake message over several records, each of which 326 can be transmitted separately, thus avoiding IP fragmentation" 327 [RFC6347]. 329 The authentication of the EST-coaps server by the EST-coaps client is 330 based on certificate authentication in the DTLS handshake. The EST- 331 coaps client MUST be configured with at least an Implicit TA database 332 which will enable the authentication of the server the first time 333 before updating its trust anchor (Explicit TA) [RFC7030]. 335 The authentication of the EST-coaps client MUST be with a client 336 certificate in the DTLS handshake. This can either be 338 o a previously issued client certificate (e.g., an existing 339 certificate issued by the EST CA); this could be a common case for 340 simple re-enrollment of clients. 342 o a previously installed certificate (e.g., manufacturer IDevID 343 [ieee802.1ar] or a certificate issued by some other party); the 344 server is expected to trust that certificate. IDevID's are 345 expected to have a very long life, as long as the device, but 346 under some conditions could expire. In that case, the server MAY 347 want to authenticate a client certificate against its trust store 348 although the certificate is expired (Section 10). 350 EST-coaps supports the certificate types and Trust Anchors (TA) that 351 are specified for EST in Section 3 of [RFC7030]. 353 CoAP and DTLS can provide proof-of-identity for EST-coaps clients and 354 servers with simple PKI messages as described in Section 3.1 of 355 [RFC5272]. Moreover, channel-binding information for linking proof- 356 of-identity with connection-based proof-of-possession is OPTIONAL for 357 EST-coaps. When proof-of-possession is desired, a set of actions are 358 required regarding the use of tls-unique, described in Section 3.5 in 359 [RFC7030]. The tls-unique information consists of the contents of 360 the first "Finished" message in the (D)TLS handshake between server 361 and client [RFC5929]. The client adds the "Finished" message as a 362 ChallengePassword in the attributes section of the PKCS#10 Request 363 [RFC5967] to prove that the client is indeed in control of the 364 private key at the time of the (D)TLS session establishment. 366 In the case of EST-coaps, the same operations can be performed during 367 the DTLS handshake. For DTLS 1.2, in the event of handshake message 368 fragmentation, the Hash of the handshake messages used in the MAC 369 calculation of the Finished message must be computed as if each 370 handshake message had been sent as a single fragment (Section 4.2.6 371 of [RFC6347]). The Finished message is calculated as shown in 372 Section 7.4.9 of [RFC5246]. Similarly, for DTLS 1.3, the Finished 373 message must be computed as if each handshake message had been sent 374 as a single fragment (Section 5.8 of [I-D.ietf-tls-dtls13]) following 375 the algorithm described in 4.4.4 of [RFC8446]. 377 In a constrained CoAP environment, endpoints can't always afford to 378 establish a DTLS connection for every EST transaction. 379 Authenticating and negotiating DTLS keys requires resources on low- 380 end endpoints and consumes valuable bandwidth. To alleviate this 381 situation, an EST-coaps DTLS connection MAY remain open for 382 sequential EST transactions. For example, an EST csrattrs request 383 that is followed by a simpleenroll request can use the same 384 authenticated DTLS connection. However, when a cacerts request is 385 included in the set of sequential EST transactions, some additional 386 security considerations apply regarding the use of the Implicit and 387 Explicit TA database as explained in Section 10.1. 389 Given that after a successful enrollment, it is more likely that a 390 new EST transaction will take place after a significant amount of 391 time, the DTLS connections SHOULD only be kept alive for EST messages 392 that are relatively close to each other. In some cases, like NAT 393 rebinding, keeping the state of a connection is not possible when 394 devices sleep for extended periods of time. In such occasions, 395 [I-D.ietf-tls-dtls-connection-id] negotiates a connection ID that can 396 eliminate the need for new handshake and its additional cost. 398 5. Protocol Design 400 EST-coaps uses CoAP to transfer EST messages, aided by Block-Wise 401 Transfer [RFC7959] to avoid IP fragmentation. The use of Blocks for 402 the transfer of larger EST messages is specified in Section 5.6. 403 Figure 1 shows the layered EST-coaps architecture. 405 The EST-coaps protocol design follows closely the EST design. The 406 supported message types in EST-coaps are: 408 o CA certificate retrieval needed to receive the complete set of CA 409 certificates. 411 o Simple enroll and re-enroll for a CA to sign public client 412 identity key. 414 o Certificate Signing Request (CSR) attribute messages that inform 415 the client of the fields to include in a CSR. 417 o Server-side key generation messages to provide a private client 418 identity key when the client choses so. 420 5.1. Discovery and URIs 422 EST-coaps is targeted for low-resource networks with small packets. 423 Saving header space is important and short EST-coaps URIs are 424 specified in this document. These URIs are shorter than the ones in 425 [RFC7030]. Two example EST-coaps resource path names are: 427 coaps://example.com:/.well-known/est/ 428 coaps://example.com:/.well-known/est/ 429 ArbitraryLabel/ 431 The short-est strings are defined in Table 1. Arbitrary Labels are 432 usually defined and used by EST CAs in order to route client requests 433 to the appropriate certificate profile. Implementers should consider 434 using short labels to minimize transmission overhead. 436 The EST-coaps server URIs, obtained through discovery of the EST- 437 coaps resource(s) as shown below, are of the form: 439 coaps://example.com:// 440 coaps://example.com:// 441 ArbitraryLabel/ 443 Figure 5 in Section 3.2.2 of [RFC7030] enumerates the operations and 444 corresponding paths which are supported by EST. Table 1 provides the 445 mapping from the EST URI path to the shorter EST-coaps URI path. 447 +------------------+-------------------------------+ 448 | EST | EST-coaps | 449 +------------------+-------------------------------+ 450 | /cacerts | /crts | 451 | /simpleenroll | /sen | 452 | /simplereenroll | /sren | 453 | /csrattrs | /att | 454 | /serverkeygen | /skg (PKCS#7) | 455 | /serverkeygen | /skc (application/pkix-cert) | 456 +------------------+-------------------------------+ 458 Table 1: Short EST-coaps URI path 460 The /skg message is the EST /serverkeygen equivalent where the client 461 requests for a certificate in PKCS#7 format and a private key. If 462 the client prefers a single application/pkix-cert certificate instead 463 of PKCS#7, he will make an /skc request. 465 Clients and servers MUST support the short resource EST-coaps URIs. 467 In the context of CoAP, the presence and location of (path to) the 468 management data are discovered by sending a GET request to "/.well- 469 known/core" including a resource type (RT) parameter with the value 470 "ace.est*" [RFC6690]. Upon success, the return payload will contain 471 the root resource of the EST resources. The example below shows the 472 discovery of the presence and location of EST-coaps resources. 473 Linefeeds are included only for readability. 475 REQ: GET /.well-known/core?rt=ace.est* 477 RES: 2.05 Content 478 ;rt="ace.est.crts";ct="281 TBD287", 479 ;rt="ace.est.sen";ct="281 TBD287", 480 ;rt="ace.est.sren";ct="281 TBD287", 481 ;rt="ace.est.att";ct=285, 482 ;rt="ace.est.skg";ct=62, 483 ;rt="ace.est.skc";ct=62 485 The first three lines of the discovery response above MUST be 486 returned if the server supports resource discovery. The last three 487 lines are only included if the corresponding EST functions are 488 implemented. The Content-Formats in the response allow the client to 489 request one that is supported by the server. These are the values 490 that would be sent in the client request with an Accept option. 492 Discoverable port numbers can be returned in the response payload. 493 An example response payload for non-default CoAPS server port 61617 494 follows below. Linefeeds were included only for readability. 496 REQ: GET /.well-known/core?rt=ace.est* 498 RES: 2.05 Content 499 ;rt="ace.est.crts"; 500 ct="281 TBD287", 501 ;rt="ace.est.sen"; 502 ct="281 TBD287", 503 ;rt="ace.est.sren"; 504 ct="281 TBD287", 505 ;rt="ace.est.att"; 506 ct=285, 507 ;rt="ace.est.skg"; 508 ct=62, 509 ;rt="ace.est.skc"; 510 ct=62 512 The server MUST support the default /.well-known/est root resource. 513 The server SHOULD support resource discovery when he supports non- 514 default URIs (like /est or /est/ArbitraryLabel) or ports. The client 515 SHOULD use resource discovery when he is unaware of the available 516 EST-coaps resources. 518 It is up to the implementation to choose its resource paths; 519 throughout this document the example root resource /est is used. 521 5.2. Mandatory/optional EST Functions 523 This specification contains a set of required-to-implement functions, 524 optional functions, and not specified functions. The latter ones are 525 deemed too expensive for low-resource devices in payload and 526 calculation times. 528 Table 2 specifies the mandatory-to-implement or optional 529 implementation of the EST-coaps functions. Discovery of the 530 existence of optional functions is described in Section 5.1. 532 +------------------+--------------------------+ 533 | EST Functions | EST-coaps implementation | 534 +------------------+--------------------------+ 535 | /cacerts | MUST | 536 | /simpleenroll | MUST | 537 | /simplereenroll | MUST | 538 | /csrattrs | OPTIONAL | 539 | /serverkeygen | OPTIONAL | 540 | /fullcmc | Not specified | 541 +------------------+--------------------------+ 543 Table 2: List of EST-coaps functions 545 While [RFC7030] permits a number of these functions to be used 546 without authentication, this specification requires that the client 547 MUST be authenticated for all functions. 549 5.3. Payload formats 551 EST-coaps is designed for low-resource devices and hence does not 552 need to send Base64-encoded data. Simple binary is more efficient 553 (30% smaller payload) and well supported by CoAP. Thus, the payload 554 for a given Media-Type follows the ASN.1 structure of the Media-Type 555 and is transported in binary format. 557 The Content-Format (HTTP Media-Type equivalent) of the CoAP message 558 determines which EST message is transported in the CoAP payload. The 559 Media-Types specified in the HTTP Content-Type header (Section 3.2.2 560 of [RFC7030]) are specified by the Content-Format Option (12) of 561 CoAP. The combination of URI-Path and Content-Format in EST-coaps 562 MUST map to an allowed combination of URI and Media-Type in EST. The 563 required Content-Formats for these requests and response messages are 564 defined in Section 9.1. The CoAP response codes are defined in 565 Section 5.5. 567 Content-Format TBD287 can be used in place of 281 to carry a single 568 certificate instead of a PKCS#7 container in a /crts, /sen, /sren or 569 /skg response. Content-Format 281 MUST be supported by EST-coaps 570 servers. Servers MAY also support Content-Format TBD287. It is up 571 to the client to support only Content-Format 281, TBD287 or both. 572 The client will use a COAP Accept Option in the request to express 573 the preferred response Content-Format. If an Accept Option is not 574 included in the request, the client is not expressing any preference 575 and the server SHOULD choose format 281. 577 Content-Format 286 is used in /sen, /sren and /skg requests and 285 578 in /att responses. 580 A representation with Content-Format identifier 62 contains a 581 collection of representations along with their respective Content- 582 Format. The Content-Format identifies the Media-Type application/ 583 multipart-core specified in [I-D.ietf-core-multipart-ct]. For 584 example, a collection, containing two representations in response to 585 a EST-coaps server-side key generation /skg request, could include a 586 private key in PKCS#8 [RFC5958] with Content-Format identifier 284 587 (0x011C) and a single certificate in a PKCS#7 container with Content- 588 Format identifier 281 (0x0119). Such a collection would look like 589 [284,h'0123456789abcdef', 281,h'fedcba9876543210'] in diagnostic CBOR 590 notation. The serialization of such CBOR content would be 592 84 # array(4) 593 19 011C # unsigned(284) 594 48 # bytes(8) 595 0123456789ABCDEF # "\x01#Eg\x89\xAB\xCD\xEF" 596 19 0119 # unsigned(281) 597 48 # bytes(8) 598 FEDCBA9876543210 # "\xFE\xDC\xBA\x98vT2\x10" 600 Multipart /skg response serialization 602 When the client makes an /skc request the certificate returned with 603 the private key is a single X.509 certificate (not a PKCS#7 604 container) with Content-Format identifier TBD287 (0x011F) instead of 605 281. In cases where the private key is encrypted with CMS (as 606 explained in Section 5.8) the Content-Format identifier is 280 607 (0x0118) instead of 284. The key and certificate representations are 608 ASN.1 encoded in binary format. An example is shown in Appendix A.3. 610 5.4. Message Bindings 612 The general EST-coaps message characteristics are: 614 o EST-coaps servers sometimes need to provide delayed responses 615 which are conveyed with an empty ACK or an ACK containing response 616 code 5.03 as explained in Section 5.7. Thus, it is RECOMMENDED 617 for implementers to send EST-coaps requests in confirmable CON 618 CoAP messages. 620 o The CoAP Options used are Uri-Host, Uri-Path, Uri-Port, Content- 621 Format, Block, Accept and Location-Path. These CoAP Options are 622 used to communicate the HTTP fields specified in the EST REST 623 messages. The Uri-host and Uri-Port Options can be omitted from 624 the COAP message sent on the wire. When omitted, they are 625 logically assumed to be the transport protocol destination address 626 and port respectively. Explicit Uri-Host and Uri-Port Options are 627 typically used when an endpoint hosts multiple virtual servers and 628 uses the Options to route the requests accordingly. Other COAP 629 Options should be handled in accordance with [RFC7252]. 631 o EST URLs are HTTPS based (https://), in CoAP these are assumed to 632 be translated to CoAPS (coaps://) 634 Table 1 provides the mapping from the EST URI path to the EST-coaps 635 URI path. Appendix A includes some practical examples of EST 636 messages translated to CoAP. 638 5.5. CoAP response codes 640 Section 5.9 of [RFC7252] and Section 7 of [RFC8075] specify the 641 mapping of HTTP response codes to CoAP response codes. Every time 642 the HTTP response code 200 is specified in [RFC7030] in response to a 643 GET request (/cacerts, /csrattrs), the equivalent CoAP response code 644 2.05 or 2.03 MUST be used in EST-coaps. Similarly, 2.01, 2.02 or 645 2.04 MUST be used in response to EST POST requests (/simpleenroll, 646 /simplereenroll, /serverkeygen). 648 HTTP response code 202 with a Retry-After header in [RFC7030] has no 649 equivalent in CoAP. Retry-After is used in EST for delayed server 650 responses. Section 5.7 specifies how EST-coaps handles delayed 651 messages. 653 EST makes use of HTTP 204 and 404 responses when a resource is not 654 available for the client. The equivalent CoAP codes to use in an 655 EST-coaps responses are 2.04 and 4.04. Additionally, EST's HTTP 401 656 error translates to 4.01 in EST-coaps. Other EST HTTP error messages 657 are 400, 423 and 503. Their equivalent CoAP errors are 4.00, 4.03 658 and 5.03 respectively. In case a CoAP Option is unrecognized and 659 critical, the server is expected to return a 4.02 (Bad Option). 661 5.6. Message fragmentation 663 DTLS defines fragmentation only for the handshake and not for secure 664 data exchange (DTLS records). [RFC6347] states that to avoid using 665 IP fragmentation, which involves error-prone datagram reconstitution, 666 invokers of the DTLS record layer should size DTLS records so that 667 they fit within any Path MTU estimates obtained from the record 668 layer. In addition, invokers residing on a 6LoWPAN over IEEE 669 802.15.4 [ieee802.15.4] network should attempt to size CoAP messages 670 such that each DTLS record will fit within one or two IEEE 802.15.4 671 frames. 673 That is not always possible in EST-coaps. Even though ECC 674 certificates are small in size, they can vary greatly based on 675 signature algorithms, key sizes, and Object Identifier (OID) fields 676 used. For 256-bit curves, common ECDSA cert sizes are 500-1000 bytes 677 which could fluctuate further based on the algorithms, OIDs, Subject 678 Alternative Names (SAN) and cert fields. For 384-bit curves, ECDSA 679 certificates increase in size and can sometimes reach 1.5KB. 680 Additionally, there are times when the EST cacerts response from the 681 server can include multiple certificates that amount to large 682 payloads. Section 4.6 of CoAP [RFC7252] describes the possible 683 payload sizes: "if nothing is known about the size of the headers, 684 good upper bounds are 1152 bytes for the message size and 1024 bytes 685 for the payload size". Section 4.6 of [RFC7252] also suggests that 686 IPv4 implementations may want to limit themselves to more 687 conservative IPv4 datagram sizes such as 576 bytes. Even with ECC, 688 EST-coaps messages can still exceed MTU sizes on the Internet or 689 6LoWPAN [RFC4919] (Section 2 of [RFC7959]). EST-coaps needs to be 690 able to fragment messages into multiple DTLS datagrams. 692 To perform fragmentation in CoAP, [RFC7959] specifies the Block1 693 Option for fragmentation of the request payload and the Block2 Option 694 for fragmentation of the return payload of a CoAP flow. As explained 695 in Section 1 of [RFC7959], block-wise transfers should be used in 696 Confirmable CoAP messages to avoid the exacerbation of lost blocks. 697 The EST-coaps client and server MUST support Block2. Block1 MUST be 698 supported for EST-coaps enrollment requests that exceed the Path MTU. 700 [RFC7959] also defines Size1 and Size2 Options to provide size 701 information about the resource representation in a request and 702 response. EST-client and server MAY support Size1 and Size2 Options. 704 Examples of fragmented EST-coaps messages are shown in Appendix B. 706 5.7. Delayed Responses 708 Server responses can sometimes be delayed. According to 709 Section 5.2.2 of [RFC7252], a slow server can acknowledge the request 710 and respond later with the requested resource representation. In 711 particular, a slow server can respond to an EST-coaps enrollment 712 request with an empty ACK with code 0.00, before sending the 713 certificate to the client after a short delay. If the certificate 714 response is large, the server will need more than one Block2 blocks 715 to transfer it. 717 This situation is shown in Figure 2. The client sends an enrollment 718 request that uses N1+1 Block1 blocks. The server uses an empty 0.00 719 ACK to announce the delayed response which is provided later with 720 2.04 messages containing N2+1 Block2 Options. The first 2.04 is a 721 confirmable message that is acknowledged by the client. Onwards, 722 having received the first 256 bytes in the first Block2 block, the 723 client asks for a block reduction to 128 bytes in a confirmable 724 enrollment request and acknowledges the Block2 blocks sent up to that 725 point. 727 POST [2001:db8::2:1]:61616/est/sen (CON)(1:0/1/256) {CSR req} --> 728 <-- (ACK) (1:0/1/256) (2.31 Continue) 729 POST [2001:db8::2:1]:61616/est/sen (CON)(1:1/1/256) {CSR req} --> 730 <-- (ACK) (1:1/1/256) (2.31 Continue) 731 . 732 . 733 . 734 POST [2001:db8::2:1]:61616/est/sen (CON)(1:N1/0/256){CSR req} --> 735 <-- (0.00 empty ACK) 736 | 737 ...... short delay before certificate is ready ...... 738 | 739 <-- (CON) (1:N1/0/256)(2:0/1/256)(2.04 Changed) {Cert resp} 740 (ACK) --> 741 POST [2001:db8::2:1]:61616/est/sen (CON)(2:1/0/128) --> 742 <-- (ACK) (2:1/1/128) (2.04 Changed) {Cert resp} 743 . 744 . 745 . 746 POST [2001:db8::2:1]:61616/est/sen (CON)(2:N2/0/128) --> 747 <-- (ACK) (2:N2/0/128) (2.04 Changed) {Cert resp} 749 Figure 2: EST-COAP enrollment with short wait 751 If the server is very slow (i.e. minutes) in providing the response 752 (i.e. when a manual intervention is needed), he SHOULD respond with 753 an ACK containing response code 5.03 (Service unavailable) and a Max- 754 Age Option to indicate the time the client SHOULD wait to request the 755 content later. After a delay of Max-Age, the client SHOULD resend 756 the identical CSR to the server. As long as the server responds with 757 response code 5.03 (Service Unavailable) with a Max-Age Option, the 758 client SHOULD keep resending the enrollment request until the server 759 responds with the certificate or the client abandons for other 760 reasons. 762 To demonstrate this scenario, Figure 3 shows a client sending an 763 enrollment request that uses N1+1 Block1 blocks to send the CSR to 764 the server. The server needs N2+1 Block2 blocks to respond, but also 765 needs to take a long delay (minutes) to provide the response. 766 Consequently, the server uses a 5.03 ACK response with a Max-Age 767 Option. The client waits for a period of Max-Age as many times as he 768 receives the same 5.03 response and retransmits the enrollment 769 request until he receives a certificate in a fragmented 2.01 770 response. Note that the server asks for a decrease in the block size 771 when acknowledging the first Block2. 773 POST [2001:db8::2:1]:61616/est/sen (CON)(1:0/1/256) {CSR req} --> 774 <-- (ACK) (1:0/1/256) (2.31 Continue) 775 POST [2001:db8::2:1]:61616/est/sen (CON)(1:1/1/256) {CSR req} --> 776 <-- (ACK) (1:1/1/256) (2.31 Continue) 777 . 778 . 779 POST [2001:db8::2:1]:61616/est/sen (CON)(1:N1/0/256){CSR req} --> 780 <-- (ACK) (1:N1/0/256) (2:0/0/128)(5.03 Service Unavailable) 781 (Max-Age) 782 | 783 | 784 Client tries one or more times after Max-Age with identical payload 785 | 786 | 787 POST [2001:db8::2:1]:61616/est/sen (CON)(1:N1/0/256){CSR req} --> 788 <-- (ACK) (1:N1/0/256) (2:0/1/128) (2.01 Created){Cert resp} 789 POST [2001:db8::2:1]:61616/est/sen (CON)(2:1/0/128) --> 790 <-- (ACK) (2:1/1/128) (2.01 Created) {Cert resp} 791 . 792 . 793 . 794 POST [2001:db8::2:1]:61616/est/sen (CON)(2:N2/0/128) --> 795 <-- (ACK) (2:N2/0/128) (2.01 Created) {Cert resp} 797 Figure 3: EST-COAP enrollment with long wait 799 5.8. Server-side Key Generation 801 Constrained devices sometimes do not have the necessary hardware to 802 generate statistically random numbers for private keys and DTLS 803 ephemeral keys. Past experience has also shown that low-resource 804 endpoints sometimes generate numbers which could allow someone to 805 decrypt the communication or guess the private key and impersonate as 806 the device [PsQs] [RSAorig]. Additionally, random number key 807 generation is costly, thus energy draining. Even though the random 808 numbers that constitute the identity/cert do not get generated often, 809 an endpoint may not want to spend time and energy generating 810 keypairs, and just ask for one from the server. 812 In these scenarios, server-side key generation can be used. The 813 client asks for the server or proxy to generate the private key and 814 the certificate which are transferred back to the client in the 815 server-side key generation response. In all respects, the server 816 SHOULD treat the CSR as it would treat any enroll or re-enroll CSR; 817 the only distinction here is that the server MUST ignore the public 818 key values and signature in the CSR. These are included in the 819 request only to allow re-use of existing codebases for generating and 820 parsing such requests. 822 The client /skg request is for a certificate in a PKCS#7 container 823 and private key in two application/multipart-core elements. 824 Respectively, an /skc request is for a single application/pkix-cert 825 certificate and a private key. The private key Content-Format 826 requested by the client is depicted in the PKCS#10 CSR request. If 827 the request contains SMIMECapabilities and DecryptKeyIdentifier or 828 AsymmetricDecryptKeyIdentifier the client is expecting Content-Format 829 280 for the private key. Then the private key is encrypted 830 symmetrically or asymmetrically as per [RFC7030]. The symmetric key 831 or the asymmetric keypair establishment method is out of scope of the 832 specification. A /skg or /skc request with a CSR without 833 SMIMECapabilities expects an application/multipart-core with an 834 unencrypted PKCS#8 private key with Content-Format 284. 836 The EST-coaps server-side key generation response is returned with 837 Content-Format application/multipart-core 838 [I-D.ietf-core-multipart-ct] containing a CBOR array with four items 839 (Section 5.3) . The two representations (each consisting of two CBOR 840 array items) do not have to be in a particular order since each 841 representation is preceded by its Content-Format ID. The private key 842 can be in unprotected PKCS#8 [RFC5958] format (Content-Format 284) or 843 protected inside of CMS SignedData (Content-Format 280). The 844 SignedData is signed by the party that generated the private key, 845 which may be the EST server or the EST CA. The SignedData is further 846 protected by placing it inside of a CMS EnvelopedData as explained in 847 Section 4.4.2 of [RFC7030]. In summary, the symmetrically encrypted 848 key is included in the encryptedKey attribute in a KEKRecipientInfo 849 structure. In the case where the asymmetric encryption key is 850 suitable for transport key operations the generated private key is 851 encrypted with a symmetric key which is encrypted by the client 852 defined (in the CSR) asymmetric public key and is carried in an 853 encryptedKey attribute in a KeyTransRecipientInfo structure. 854 Finally, if the asymmetric encryption key is suitable for key 855 agreement, the generated private key is encrypted with a symmetric 856 key which is encrypted by the client defined (in the CSR) asymmetric 857 public key and is carried in an recipientEncryptedKeys attribute in a 858 KeyAgreeRecipientInfo. 860 [RFC7030] recommends the use of additional encryption of the returned 861 private key. For the context of this specification, clients and 862 servers that choose to support server-side key generation MUST 863 support unprotected (PKCS#8) private keys (Content-Format 284). 864 Symmetric or asymmetric encryption of the private key (CMS 865 EnvelopedData, Content-Format 280) SHOULD be supported for 866 deployments where end-to-end encryption needs to be provided between 867 the client and a server. Such cases could include architectures 868 where an entity between the client and the CA terminates the DTLS 869 connection (Registrar in Figure 4). 871 6. HTTPS-CoAPS Registrar 873 In real-world deployments, the EST server will not always reside 874 within the CoAP boundary. The EST server can exist outside the 875 constrained network in which case it will support TLS/HTTP instead of 876 CoAPS. In such environments EST-coaps is used by the client within 877 the CoAP boundary and TLS is used to transport the EST messages 878 outside the CoAP boundary. A Registrar at the edge is required to 879 operate between the CoAP environment and the external HTTP network as 880 shown in Figure 4. 882 Constrained Network 883 .------. .----------------------------. 884 | CA | |.--------------------------.| 885 '------' || || 886 | || || 887 .------. HTTP .-----------------. CoAPS .-----------. || 888 | EST |<------->|EST-coaps-to-HTTPS|<------->| EST Client| || 889 |Server|over TLS | Registrar | '-----------' || 890 '------' '-----------------' || 891 || || 892 |'--------------------------'| 893 '----------------------------' 895 Figure 4: EST-coaps-to-HTTPS Registrar at the CoAP boundary. 897 The EST-coaps-to-HTTPS Registrar MUST terminate EST-coaps downstream 898 and initiate EST connections over TLS upstream. The Registrar MUST 899 authenticate and OPTIONALLY authorize the clients and it MUST be 900 authenticated by the EST server or CA. The trust relationship 901 between the Registrar and the EST server SHOULD be pre-established 902 for the Registrar to proxy these connections on behalf of various 903 clients. 905 When enforcing Proof-of-Possession (POP) linking, the DTLS tls-unique 906 value of the (D)TLS session is used to prove that the private key 907 corresponding to the public key is in the possession of the client 908 and was used to establish the connection as explained in Section 4. 909 The POP linking information is lost between the EST-coaps client and 910 the EST server when a Registrar is present. The EST server becomes 911 aware of the presence of a Registrar from its TLS client certificate 912 that includes id-kp-cmcRA [RFC6402] extended key usage extension 913 (EKU). As explained in Section 3.7 of [RFC7030], the EST server 914 SHOULD apply an authorization policy consistent with a Registrar 915 client. For example, it could be configured to accept POP linking 916 information that does not match the current TLS session because the 917 authenticated EST client Registrar has verified this information when 918 acting as an EST server. 920 For some use cases, clients that leverage server-side key generation 921 might prefer for the enrolled keys to be generated by the Registrar 922 if the CA does not support server-side key generation. Such 923 Registrar is responsible for generating a new CSR signed by a new key 924 which will be returned to the client along with the certificate from 925 the CA. In these cases, the Registrar MUST support random number 926 generation using proper entropy. 928 Table 1 contains the URI mappings between EST-coaps and EST that the 929 Registrar MUST adhere to. Section 5.5 of this specification and 930 Section 7 of [RFC8075] define the mappings between EST-coaps and HTTP 931 response codes, that determine how the Registrar MUST translate CoAP 932 response codes from/to HTTP status codes. The mapping from CoAP 933 Content-Format to HTTP Media-Type is defined in Section 9.1. 934 Additionally, a conversion from CBOR major type 2 to Base64 encoding 935 MUST take place at the Registrar when server-side key generation is 936 supported. If CMS end-to-end encryption is employed for the private 937 key, the encrypted CMS EnvelopedData blob MUST be converted to binary 938 in CBOR type 2 downstream to the client. 940 Due to fragmentation of large messages into blocks, an EST-coaps-to- 941 HTTP Registrar MUST reassemble the BLOCKs before translating the 942 binary content to Base64, and consecutively relay the message 943 upstream. 945 If necessary, the EST-coaps-to-HTTP Registrar will support resouce 946 discovery according to the rules in Section 5.1. 948 7. Parameters 950 This section addresses transmission parameters described in sections 951 4.7 and 4.8 of [RFC7252]. EST does not impose any unique values on 952 the CoAP parameters in [RFC7252], but the EST parameter values need 953 to be tuned to the CoAP parameter values. 955 It is recommended, based on experiments, to follow the default CoAP 956 configuration parameters ([RFC7252]). However, depending on the 957 implementation scenario, retransmissions and timeouts can also occur 958 on other networking layers, governed by other configuration 959 parameters. A change in a server parameter MUST ensure the adjusted 960 value is also available to all the endpoints with which these 961 adjusted values are to be used to communicate. 963 Some further comments about some specific parameters, mainly from 964 Table 2 in [RFC7252]: 966 o NSTART: A parameter that controls the number of simultaneous 967 outstanding interactions that a client maintains to a given 968 server. An EST-coaps client is not expected to interact with more 969 than one servers at the same time, which is the default NSTART 970 value defined in [RFC7252]. 972 o DEFAULT_LEISURE: This setting is only relevant in multicast 973 scenarios, outside the scope of EST-coaps. 975 o PROBING_RATE: A parameter which specifies the rate of re-sending 976 non-confirmable messages. The EST messages are defined to be sent 977 as CoAP confirmable messages, hence this setting is not 978 applicable. 980 Finally, the Table 3 parameters in [RFC7252] are mainly derived from 981 Table 2. Directly changing parameters on one table would affect 982 parameters on the other. 984 8. Deployment limitations 986 Although EST-coaps paves the way for the utilization of EST by 987 constrained devices in constrained networks, some classes of devices 988 [RFC7228] will not have enough resources to handle the payloads that 989 come with EST-coaps. The specification of EST-coaps is intended to 990 ensure that EST works for networks of constrained devices that choose 991 to limit their communications stack to DTLS/CoAP. It is up to the 992 network designer to decide which devices execute the EST protocol and 993 which do not. 995 9. IANA Considerations 997 9.1. Content-Format Registry 999 Additions to the sub-registry "CoAP Content-Formats", within the 1000 "CoRE Parameters" registry [COREparams] are specified in Table 3. 1001 These have been registered provisionally in the Expert Review range 1002 (0-255). 1004 +------------------------------+-------+----------------------------+ 1005 | HTTP Media-Type | ID | Reference | 1006 +------------------------------+-------+----------------------------+ 1007 | application/pkcs7-mime; | 280 | [RFC7030] [I-D.ietf-lamps- | 1008 | smime-type=server-generated- | | rfc5751-bis] | 1009 | key | | | 1010 | application/pkcs7-mime; | 281 | [I-D.ietf-lamps-rfc5751-bi | 1011 | smime-type=certs-only | | s] | 1012 | application/pkcs8 | 284 | [RFC5958] [I-D.ietf-lamps- | 1013 | | | rfc5751-bis] | 1014 | application/csrattrs | 285 | [RFC7030] [RFC7231] | 1015 | application/pkcs10 | 286 | [RFC5967] [I-D.ietf-lamps- | 1016 | | | rfc5751-bis] | 1017 | application/pkix-cert | TBD28 | [RFC2585] | 1018 | | 7 | | 1019 +------------------------------+-------+----------------------------+ 1021 Table 3: New CoAP Content-Formats 1023 It is suggested that 287 is allocated to TBD287. 1025 9.2. Resource Type registry 1027 This memo registers new Resource Type (rt=) Link Target Attributes in 1028 the "Resource Type (rt=) Link Target Attribute Values" subregistry 1029 under the "Constrained RESTful Environments (CoRE) Parameters" 1030 registry. 1032 o rt="ace.est.crts". This resource depicts the support of EST get 1033 cacerts. 1035 o rt="ace.est.sen". This resource depicts the support of EST simple 1036 enroll. 1038 o rt="ace.est.sren". This resource depicts the support of EST 1039 simple reenroll. 1041 o rt="ace.est.att". This resource depicts the support of EST CSR 1042 attributes. 1044 o rt="ace.est.skg". This resource depicts the support of EST 1045 server-side key generation with the returned certificate in a 1046 PKCS#7 container. 1048 o rt="ace.est.skc". This resource depicts the support of EST 1049 server-side key generation with the returned certificate in 1050 application/pkix-cert format. 1052 10. Security Considerations 1054 10.1. EST server considerations 1056 The security considerations of Section 6 of [RFC7030] are only 1057 partially valid for the purposes of this document. As HTTP Basic 1058 Authentication is not supported, the considerations expressed for 1059 using passwords do not apply. 1061 Given that the client has only limited resources and may not be able 1062 to generate sufficiently random keys to encrypt its identity, it is 1063 possible that the client uses server generated private/public keys. 1064 The transport of these keys is inherently risky. Analysis SHOULD be 1065 done to establish whether server-side key generation enhances or 1066 decreases the probability of identity stealing. 1068 It is also RECOMMENDED that the Implicit Trust Anchor database used 1069 for EST server authentication is carefully managed to reduce the 1070 chance of a third-party CA with poor certification practices 1071 jeopardizing authentication. Disabling the Implicit Trust Anchor 1072 database after successfully receiving the Distribution of CA 1073 certificates response (Section 4.1.3 of [RFC7030]) limits any risk to 1074 the first DTLS exchange. Alternatively, in a case where a /sen 1075 request immediately follows a /crt, a client MAY choose to keep the 1076 connection authenticated by the Implicit TA open for efficiency 1077 reasons (Section 4). A client that pipelines EST-coaps /crt request 1078 with other requests in the same DTLS connection SHOULD revalidate the 1079 server certificate chain against the updated Explicit TA from the 1080 /crt response before proceeding with the subsequent requests. If the 1081 server certificate chain does not authenticate against the database, 1082 the client SHOULD close the connection without completing the rest of 1083 the requests. The updated Explicit TA MUST continue to be used in 1084 new DTLS connections. 1086 In cases where the IDevID used to authenticate the client is expired 1087 the server MAY still authenticate the client because IDevIDs are 1088 expected to live as long as the device itself (Section 4). In such 1089 occasions, checking the certificate revocation status or authorizing 1090 the client using another method is important for the server to ensure 1091 that the client is to be trusted. 1093 In accordance with [RFC7030], TLS cipher suites that include 1094 "_EXPORT_" and "_DES_" in their names MUST NOT be used. More 1095 information about recommendations of TLS and DTLS are included in 1096 [RFC7525]. 1098 As described in CMC, Section 6.7 of [RFC5272], "For keys that can be 1099 used as signature keys, signing the certification request with the 1100 private key serves as a POP on that key pair". The inclusion of tls- 1101 unique in the certificate request links the proof-of-possession to 1102 the TLS proof-of-identity. This implies but does not prove that only 1103 the authenticated client currently has access to the private key. 1105 What's more, POP linking uses tls-unique as it is defined in 1106 [RFC5929]. The 3SHAKE attack [tripleshake] poses a risk by allowing 1107 a man-in-the-middle to leverage session resumption and renegotiation 1108 to inject himself between a client and server even when channel 1109 binding is in use. The attack was possible because of certain (D)TLS 1110 implementation imperfections. In the context of this specification, 1111 an attacker could invalidate the purpose of the POP linking 1112 ChallengePassword in the client request by resuming an EST-coaps 1113 connection. Even though the practical risk of such an attack to EST- 1114 coaps is not devastating, we would rather use a more secure channel 1115 binding mechanism. Such a mechanism could include an updated tls- 1116 unique value generation like the tls-unique-prf defined in 1117 [I-D.josefsson-sasl-tls-cb] by using a TLS exporter [RFC5705] in TLS 1118 1.2 or TLS 1.3's updated exporter (Section 7.5 of [RFC8446]). Such 1119 mechanism has not been standardized yet. Adopting a channel binding 1120 value generated from an exporter would break backwards compatibility. 1122 Thus, in this specification we still depend in the tls-unique 1123 mechanism defined in [RFC5929], especially since the practicality of 1124 such an attack would not expose any messages exchanged with EST- 1125 coaps. 1127 Regarding the Certificate Signing Request (CSR), a CA is expected to 1128 be able to enforce policies to recover from improper CSR requests. 1130 Interpreters of ASN.1 structures should be aware of the use of 1131 invalid ASN.1 length fields and should take appropriate measures to 1132 guard against buffer overflows, stack overruns in particular, and 1133 malicious content in general. 1135 10.2. HTTPS-CoAPS Registrar considerations 1137 The Registrar proposed in Section 6 must be deployed with care, and 1138 only when the recommended connections are impossible. When POP 1139 linking is used the Registrar terminating the TLS connection 1140 establishes a new one with the upstream CA. Thus, it is impossible 1141 for POP linking to be enforced end-to-end for the EST transaction. 1142 The EST server could be configured to accept POP linking information 1143 that does not match the current TLS session because the authenticated 1144 EST Registrar client has verified this information when acting as an 1145 EST server. 1147 The introduction of an EST-coaps-to-HTTP Registrar assumes the client 1148 can trust the registrar using its implicit or explicit TA database. 1149 It also assumes the Registrar has a trust relationship with the 1150 upstream EST server in order to act on behalf of the clients. When a 1151 client uses the Implicit TA database for certificate validation, he 1152 SHOULD confirm if the server is acting as an RA by the presence of 1153 the id-kp-cmcRA EKU [RFC6402] in the server certificate. 1155 In a server-side key generation case, if no end-to-end encryption is 1156 used, the Registrar may be able see the private key as it acts as a 1157 man-in-the-middle. Thus, the client puts its trust on the Registrar 1158 not exposing the private key. 1160 Clients that leverage server-side key generation without end-to-end 1161 encryption of the private key (Section 5.8) have no knowledge if the 1162 Registrar will be generating the private key and enrolling the 1163 certificates with the CA or if the CA will be responsible for 1164 generating the key. In such cases, the existence of a Registrar 1165 requires the client to put its trust on the registrar doing the right 1166 thing if it is generating the private key. 1168 11. Contributors 1170 Martin Furuhed contributed to the EST-coaps specification by 1171 providing feedback based on the Nexus EST over CoAPS server 1172 implementation that started in 2015. Sandeep Kumar kick-started this 1173 specification and was instrumental in drawing attention to the 1174 importance of the subject. 1176 12. Acknowledgements 1178 The authors are very grateful to Klaus Hartke for his detailed 1179 explanations on the use of Block with DTLS and his support for the 1180 Content-Format specification. The authors would like to thank Esko 1181 Dijk and Michael Verschoor for the valuable discussions that helped 1182 in shaping the solution. They would also like to thank Peter 1183 Panburana for his feedback on technical details of the solution. 1184 Constructive comments were received from Benjamin Kaduk, Eliot Lear, 1185 Jim Schaad, Hannes Tschofenig, Julien Vermillard, John Manuel, Oliver 1186 Pfaff, Pete Beal and Carsten Bormann. 1188 Interop tests were done by Oliver Pfaff, Thomas Werner, Oskar 1189 Camezind, Bjorn Elmers and Joel Hoglund. 1191 Robert Moskowitz provided code to create the examples. 1193 13. References 1195 13.1. Normative References 1197 [I-D.ietf-core-multipart-ct] 1198 Fossati, T., Hartke, K., and C. Bormann, "Multipart 1199 Content-Format for CoAP", draft-ietf-core-multipart-ct-02 1200 (work in progress), August 2018. 1202 [I-D.ietf-tls-dtls13] 1203 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 1204 Datagram Transport Layer Security (DTLS) Protocol Version 1205 1.3", draft-ietf-tls-dtls13-30 (work in progress), 1206 November 2018. 1208 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1209 Requirement Levels", BCP 14, RFC 2119, 1210 DOI 10.17487/RFC2119, March 1997, 1211 . 1213 [RFC2585] Housley, R. and P. Hoffman, "Internet X.509 Public Key 1214 Infrastructure Operational Protocols: FTP and HTTP", 1215 RFC 2585, DOI 10.17487/RFC2585, May 1999, 1216 . 1218 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1219 (TLS) Protocol Version 1.2", RFC 5246, 1220 DOI 10.17487/RFC5246, August 2008, 1221 . 1223 [RFC5967] Turner, S., "The application/pkcs10 Media Type", RFC 5967, 1224 DOI 10.17487/RFC5967, August 2010, 1225 . 1227 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1228 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 1229 January 2012, . 1231 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 1232 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 1233 . 1235 [RFC7030] Pritikin, M., Ed., Yee, P., Ed., and D. Harkins, Ed., 1236 "Enrollment over Secure Transport", RFC 7030, 1237 DOI 10.17487/RFC7030, October 2013, 1238 . 1240 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 1241 Application Protocol (CoAP)", RFC 7252, 1242 DOI 10.17487/RFC7252, June 2014, 1243 . 1245 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 1246 the Constrained Application Protocol (CoAP)", RFC 7959, 1247 DOI 10.17487/RFC7959, August 2016, 1248 . 1250 [RFC8075] Castellani, A., Loreto, S., Rahman, A., Fossati, T., and 1251 E. Dijk, "Guidelines for Mapping Implementations: HTTP to 1252 the Constrained Application Protocol (CoAP)", RFC 8075, 1253 DOI 10.17487/RFC8075, February 2017, 1254 . 1256 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1257 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1258 May 2017, . 1260 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1261 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 1262 . 1264 13.2. Informative References 1266 [COREparams] 1267 "Constrained RESTful Environments (CoRE) Parameters", 1268 . 1271 [I-D.ietf-lamps-rfc5751-bis] 1272 Schaad, J., Ramsdell, B., and S. Turner, "Secure/ 1273 Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 1274 Message Specification", draft-ietf-lamps-rfc5751-bis-12 1275 (work in progress), September 2018. 1277 [I-D.ietf-tls-dtls-connection-id] 1278 Rescorla, E., Tschofenig, H., Fossati, T., and T. Gondrom, 1279 "Connection Identifiers for DTLS 1.2", draft-ietf-tls- 1280 dtls-connection-id-02 (work in progress), October 2018. 1282 [I-D.josefsson-sasl-tls-cb] 1283 Josefsson, S., "Channel Bindings for TLS based on the 1284 PRF", draft-josefsson-sasl-tls-cb-03 (work in progress), 1285 March 2015. 1287 [I-D.moskowitz-ecdsa-pki] 1288 Moskowitz, R., Birkholz, H., Xia, L., and M. Richardson, 1289 "Guide for building an ECC pki", draft-moskowitz-ecdsa- 1290 pki-04 (work in progress), September 2018. 1292 [ieee802.15.4] 1293 "IEEE Standard 802.15.4-2006", 2006. 1295 [ieee802.1ar] 1296 "IEEE 802.1AR Secure Device Identifier", December 2009. 1298 [PsQs] "Mining Your Ps and Qs: Detection of Widespread Weak Keys 1299 in Network Devices", USENIX Security Symposium 2012 ISBN 1300 978-931971-95-9, August 2012. 1302 [RFC4919] Kushalnagar, N., Montenegro, G., and C. Schumacher, "IPv6 1303 over Low-Power Wireless Personal Area Networks (6LoWPANs): 1304 Overview, Assumptions, Problem Statement, and Goals", 1305 RFC 4919, DOI 10.17487/RFC4919, August 2007, 1306 . 1308 [RFC5272] Schaad, J. and M. Myers, "Certificate Management over CMS 1309 (CMC)", RFC 5272, DOI 10.17487/RFC5272, June 2008, 1310 . 1312 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1313 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 1314 March 2010, . 1316 [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings 1317 for TLS", RFC 5929, DOI 10.17487/RFC5929, July 2010, 1318 . 1320 [RFC5958] Turner, S., "Asymmetric Key Packages", RFC 5958, 1321 DOI 10.17487/RFC5958, August 2010, 1322 . 1324 [RFC6402] Schaad, J., "Certificate Management over CMS (CMC) 1325 Updates", RFC 6402, DOI 10.17487/RFC6402, November 2011, 1326 . 1328 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 1329 Constrained-Node Networks", RFC 7228, 1330 DOI 10.17487/RFC7228, May 2014, 1331 . 1333 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1334 Protocol (HTTP/1.1): Message Syntax and Routing", 1335 RFC 7230, DOI 10.17487/RFC7230, June 2014, 1336 . 1338 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1339 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1340 DOI 10.17487/RFC7231, June 2014, 1341 . 1343 [RFC7251] McGrew, D., Bailey, D., Campagna, M., and R. Dugal, "AES- 1344 CCM Elliptic Curve Cryptography (ECC) Cipher Suites for 1345 TLS", RFC 7251, DOI 10.17487/RFC7251, June 2014, 1346 . 1348 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 1349 "Recommendations for Secure Use of Transport Layer 1350 Security (TLS) and Datagram Transport Layer Security 1351 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 1352 2015, . 1354 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 1355 Security (TLS) / Datagram Transport Layer Security (DTLS) 1356 Profiles for the Internet of Things", RFC 7925, 1357 DOI 10.17487/RFC7925, July 2016, 1358 . 1360 [RFC8422] Nir, Y., Josefsson, S., and M. Pegourie-Gonnard, "Elliptic 1361 Curve Cryptography (ECC) Cipher Suites for Transport Layer 1362 Security (TLS) Versions 1.2 and Earlier", RFC 8422, 1363 DOI 10.17487/RFC8422, August 2018, 1364 . 1366 [RSAorig] "The Million-Key Question - Investigating the Origins of 1367 RSA Public Keys", USENIX Security Symposium 2016 ISBN 1368 978-1-931971-32-4, August 2016. 1370 [tripleshake] 1371 "Triple Handshakes and Cookie Cutters: Breaking and Fixing 1372 Authentication over TLS", IEEE Security and Privacy ISBN 1373 978-1-4799-4686-0, May 2014. 1375 Appendix A. EST messages to EST-coaps 1377 This section shows similar examples to the ones presented in 1378 Appendix A of [RFC7030]. The payloads in the examples are the hex 1379 encoded binary, generated with 'xxd -p', of the PKI certificates 1380 created following [I-D.moskowitz-ecdsa-pki]. Hex is used for 1381 visualization purposes because a binary representation cannot be 1382 rendered well in text. The hexadecimal representations would not be 1383 transported in hex, but in binary. The payloads are shown 1384 unencrypted. In practice the message content would be transferred 1385 over an encrypted DTLS tunnel. 1387 The certificate responses included in the examples contain Content- 1388 Format 281 (application/pkcs7). If the client had requested Content- 1389 Format TBD287 (application/pkix-cert) by querying /est/skc, the 1390 server would respond with a single DER binary certificate. 1392 These examples assume a short resource path of "/est". Even though 1393 omitted from the examples for brevity, before making the EST-coaps 1394 requests, a client would learn about the server supported EST-coaps 1395 resources with a GET request for /.well-known/core?rt=ace.est* as 1396 explained in Section 5.1. 1398 The corresponding CoAP headers are only shown in Appendix A.1. 1399 Creating CoAP headers is assumed to be generally understood. 1401 The message content breakdown is presented in Appendix C. 1403 A.1. cacerts 1405 In EST-coaps, a cacerts message can be: 1407 GET example.com:9085/est/crts 1408 (Accept: 281) 1410 The corresponding CoAP header fields are shown below. The use of 1411 block and DTLS are worked out in Appendix B. 1413 Ver = 1 1414 T = 0 (CON) 1415 Code = 0x01 (0.01 is GET) 1416 Token = 0x9a (client generated) 1417 Options 1418 Option (Uri-Host) 1419 Option Delta = 0x3 (option# 3) 1420 Option Length = 0xD 1421 Option Value = "example.com" 1422 Option (Uri-Port) 1423 Option Delta = 0x4 (option# 3+4=7) 1424 Option Length = 0x4 1425 Option Value = 9085 1426 Option (Uri-Path) 1427 Option Delta = 0x4 (option# 7+4=11) 1428 Option Length = 0x5 1429 Option Value = "est" 1430 Option (Uri-Path) 1431 Option Delta = 0x0 (option# 11+0=11) 1432 Option Length = 0x6 1433 Option Value = "crts" 1434 Option (Accept) 1435 Option Delta = 0x6 (option# 11+6=17) 1436 Option Length = 0x2 1437 Option Value = 281 1438 Payload = [Empty] 1440 The Uri-Host and Uri-Port Options can be omitted if they coincide 1441 with the transport protocol destination address and port 1442 respectively. Explicit Uri-Host and Uri-Port Options are typically 1443 used when an endpoint hosts multiple virtual servers and uses the 1444 Options to route the requests accordingly. 1446 A 2.05 Content response with a cert in EST-coaps will then be 1448 2.05 Content (Content-Format: 281) 1449 {payload with certificate in binary format} 1451 with CoAP fields 1453 Ver = 1 1454 T = 2 (ACK) 1455 Code = 0x45 (2.05 Content) 1456 Token = 0x9a (copied from request by server) 1457 Options 1458 Option (Content-Format) 1459 Option Delta = 0xC (option# 12) 1460 Option Length = 0x2 1461 Option Value = 281 1463 [ The hexadecimal representation below would NOT be transported 1464 in hex, but in binary. Hex is used because a binary representation 1465 cannot be rendered well in text. ] 1467 Payload = 1468 3082027b06092a864886f70d010702a082026c308202680201013100300b 1469 06092a864886f70d010701a082024e3082024a308201f0a0030201020209 1470 009189bcdf9c99244b300a06082a8648ce3d0403023067310b3009060355 1471 040613025553310b300906035504080c024341310b300906035504070c02 1472 4c4131143012060355040a0c0b4578616d706c6520496e63311630140603 1473 55040b0c0d63657274696669636174696f6e3110300e06035504030c0752 1474 6f6f74204341301e170d3139303130373130343034315a170d3339303130 1475 323130343034315a3067310b3009060355040613025553310b3009060355 1476 04080c024341310b300906035504070c024c4131143012060355040a0c0b 1477 4578616d706c6520496e6331163014060355040b0c0d6365727469666963 1478 6174696f6e3110300e06035504030c07526f6f742043413059301306072a 1479 8648ce3d020106082a8648ce3d03010703420004814994082b6e8185f3df 1480 53f5e0bee698973335200023ddf78cd17a443ffd8ddd40908769c55652ac 1481 2ccb75c4a50a7c7ddb7c22dae6c85cca538209fdbbf104c9a38184308181 1482 301d0603551d0e041604142495e816ef6ffcaaf356ce4adffe33cf492abb 1483 a8301f0603551d230418301680142495e816ef6ffcaaf356ce4adffe33cf 1484 492abba8300f0603551d130101ff040530030101ff300e0603551d0f0101 1485 ff040403020106301e0603551d1104173015811363657274696679406578 1486 616d706c652e636f6d300a06082a8648ce3d0403020348003045022100da 1487 e37c96f154c32ec0b4af52d46f3b7ecc9687ddf267bcec368f7b7f135327 1488 2f022047a28ae5c7306163b3c3834bab3c103f743070594c089aaa0ac870 1489 cd13b902caa1003100 1491 The breakdown of the payload is shown in Appendix C.1. 1493 A.2. enroll / reenroll 1495 During the (re-)enroll exchange the EST-coaps client uses a CSR 1496 (Content-Format 286) request in the POST request payload. The Accept 1497 option tells the server that the client is expecting Content-Format 1498 281 (PKCS#7) in the response. As shown in Appendix C.2, the CSR 1499 contains a ChallengePassword which is used for POP linking 1500 (Section 4). 1502 POST [2001:db8::2:321]:61616/est/sen 1503 (Token: 0x45) 1504 (Accept: 281) 1505 (Content-Format: 286) 1507 [ The hexadecimal representation below would NOT be transported 1508 in hex, but in binary. Hex is used because a binary representation 1509 cannot be rendered well in text. ] 1511 3082018b30820131020100305c310b3009060355040613025553310b3009 1512 06035504080c024341310b300906035504070c024c413114301206035504 1513 0a0c0b6578616d706c6520496e63310c300a060355040b0c03496f54310f 1514 300d060355040513065774313233343059301306072a8648ce3d02010608 1515 2a8648ce3d03010703420004c8b421f11c25e47e3ac57123bf2d9fdc494f 1516 028bc351cc80c03f150bf50cff958d75419d81a6a245dffae790be95cf75 1517 f602f9152618f816a2b23b5638e59fd9a073303406092a864886f70d0109 1518 0731270c2576437630292a264a4b4a3bc3a2c280c2992f3e3c2e2c3d6b6e 1519 7634332323403d204e787e60303b06092a864886f70d01090e312e302c30 1520 2a0603551d1104233021a01f06082b06010505070804a013301106092b06 1521 010401b43b0a01040401020304300a06082a8648ce3d0403020348003045 1522 02210092563a546463bd9ecff170d0fd1f2ef0d3d012160e5ee90cffedab 1523 ec9b9a38920220179f10a3436109051abad17590a09bc87c4dce5453a6fc 1524 1135a1e84eed754377 1526 After verification of the CSR by the server, a 2.01 Content response 1527 with the issued certificate will be returned to the client. 1529 2.01 Created 1530 (Token: 0x45) 1531 (Content-Format: 281) 1533 [ The hexadecimal representation below would NOT be transported 1534 in hex, but in binary. Hex is used because a binary representation 1535 cannot be rendered well in text. ] 1537 3082026e06092a864886f70d010702a082025f3082025b0201013100300b 1538 06092a864886f70d010701a08202413082023d308201e2a0030201020208 1539 7e7661d7b54e4632300a06082a8648ce3d040302305d310b300906035504 1540 0613025553310b300906035504080c02434131143012060355040a0c0b45 1541 78616d706c6520496e6331163014060355040b0c0d636572746966696361 1542 74696f6e3113301106035504030c0a3830322e3141522043413020170d31 1543 39303133313131323931365a180f39393939313233313233353935395a30 1544 5c310b3009060355040613025553310b300906035504080c024341310b30 1545 0906035504070c024c4131143012060355040a0c0b6578616d706c652049 1546 6e63310c300a060355040b0c03496f54310f300d06035504051306577431 1547 3233343059301306072a8648ce3d020106082a8648ce3d03010703420004 1548 c8b421f11c25e47e3ac57123bf2d9fdc494f028bc351cc80c03f150bf50c 1549 ff958d75419d81a6a245dffae790be95cf75f602f9152618f816a2b23b56 1550 38e59fd9a3818a30818730090603551d1304023000301d0603551d0e0416 1551 041496600d8716bf7fd0e752d0ac760777ad665d02a0301f0603551d2304 1552 183016801468d16551f951bfc82a431d0d9f08bc2d205b1160300e060355 1553 1d0f0101ff0404030205a0302a0603551d1104233021a01f06082b060105 1554 05070804a013301106092b06010401b43b0a01040401020304300a06082a 1555 8648ce3d0403020349003046022100c0d81996d2507d693f3c48eaa5ee94 1556 91bda6db214099d98117c63b361374cd86022100a774989f4c321a5cf25d 1557 832a4d336a08ad67df20f1506421188a0ade6d349236a1003100 1559 The breakdown of the request and response is shown in Appendix C.2. 1561 A.3. serverkeygen 1563 In a serverkeygen exchange the CoAP POST request looks like 1564 POST 192.0.2.1:8085/est/skg 1565 (Token: 0xa5) 1566 (Accept: 62) 1567 (Content-Format: 286) 1569 [ The hexadecimal representation below would NOT be transported 1570 in hex, but in binary. Hex is used because a binary representation 1571 cannot be rendered well in text. ] 1573 3081cf3078020100301631143012060355040a0c0b736b67206578616d70 1574 6c653059301306072a8648ce3d020106082a8648ce3d030107034200041b 1575 b8c1117896f98e4506c03d70efbe820d8e38ea97e9d65d52c8460c5852c5 1576 1dd89a61370a2843760fc859799d78cd33f3c1846e304f1717f8123f1a28 1577 4cc99fa000300a06082a8648ce3d04030203470030440220387cd4e9cf62 1578 8d4af77f92ebed4890d9d141dca86cd2757dd14cbd59cdf6961802202f24 1579 5e828c77754378b66660a4977f113cacdaa0cc7bad7d1474a7fd155d090d 1581 The response would follow [I-D.ietf-core-multipart-ct] and could look 1582 like 1583 2.01 Content 1584 (Token: 0xa5) 1585 (Content-Format: 62) 1587 [ The hexadecimal representations below would NOT be transported 1588 in hex, but in binary. Hex is used because a binary representation 1589 cannot be rendered well in text. ] 1591 84 # array(4) 1592 19 011C # unsigned(284) 1593 58 8A # bytes(138) 1594 308187020100301306072a8648ce3d020106082a8648ce3d030107046d30 1595 6b02010104200b9a67785b65e07360b6d28cfc1d3f3925c0755799deeca7 1596 45372b01697bd8a6a144034200041bb8c1117896f98e4506c03d70efbe82 1597 0d8e38ea97e9d65d52c8460c5852c51dd89a61370a2843760fc859799d78 1598 cd33f3c1846e304f1717f8123f1a284cc99f 1599 19 0119 # unsigned(281) 1600 59 01D3 # bytes(467) 1601 308201cf06092a864886f70d010702a08201c0308201bc0201013100300b 1602 06092a864886f70d010701a08201a23082019e30820143a0030201020208 1603 126de8571518524b300a06082a8648ce3d04030230163114301206035504 1604 0a0c0b736b67206578616d706c65301e170d313930313039303835373038 1605 5a170d3339303130343038353730385a301631143012060355040a0c0b73 1606 6b67206578616d706c653059301306072a8648ce3d020106082a8648ce3d 1607 030107034200041bb8c1117896f98e4506c03d70efbe820d8e38ea97e9d6 1608 5d52c8460c5852c51dd89a61370a2843760fc859799d78cd33f3c1846e30 1609 4f1717f8123f1a284cc99fa37b307930090603551d1304023000302c0609 1610 6086480186f842010d041f161d4f70656e53534c2047656e657261746564 1611 204365727469666963617465301d0603551d0e04160414494be598dc8dbc 1612 0dbc071c486b777460e5cce621301f0603551d23041830168014494be598 1613 dc8dbc0dbc071c486b777460e5cce621300a06082a8648ce3d0403020349 1614 003046022100a4b167d0f9add9202810e6bf6a290b8cfdfc9b9c9fea2cc1 1615 c8fc3a464f79f2c202210081d31ba142751a7b4a34fd1a01fcfb08716b9e 1616 b53bdaadc9ae60b08f52429c0fa1003100 1618 The private key in the response above is without CMS EnvelopedData 1619 and has no additional encryption beyond DTLS (Section 5.8). 1621 The breakdown of the request and response is shown in Appendix C.3 1623 A.4. csrattrs 1625 Below is a csrattrs exchange 1626 REQ: 1627 GET example.com:61616/est/att 1629 RES: 1630 2.05 Content 1631 (Content-Format: 285) 1633 [ The hexadecimal representation below would NOT be transported 1634 in hex, but in binary. Hex is used because a binary representation 1635 cannot be rendered well in text. ] 1637 307c06072b06010101011630220603883701311b131950617273652053455 1638 420617320322e3939392e31206461746106092a864886f70d010907302c06 1639 0388370231250603883703060388370413195061727365205345542061732 1640 0322e3939392e32206461746106092b240303020801010b06096086480165 1641 03040202 1643 A 2.05 Content response should contain attributes which are relevant 1644 for the authenticated client. This example is copied from 1645 Section A.2 in [RFC7030], where the base64 representation is replaced 1646 with a hexadecimal representation of the equivalent binary format. 1647 The EST-coaps server returns attributes that the client can ignore if 1648 they are unknown to him. 1650 Appendix B. EST-coaps Block message examples 1652 Two examples are presented in this section: 1654 1. a cacerts exchange shows the use of Block2 and the block headers 1656 2. an enroll exchange shows the Block1 and Block2 size negotiation 1657 for request and response payloads. 1659 The payloads are shown unencrypted. In practice the message contents 1660 would be binary formatted and transferred over an encrypted DTLS 1661 tunnel. The corresponding CoAP headers are only shown in 1662 Appendix B.1. Creating CoAP headers is assumed to be generally 1663 known. 1665 B.1. cacerts 1667 This section provides a detailed example of the messages using DTLS 1668 and BLOCK option Block2. The minimum PMTU is 1280 bytes, which is 1669 the example value assumed for the DTLS datagram size. The example 1670 block length is taken as 64 which gives an SZX value of 2. 1672 The following is an example of a cacerts exchange over DTLS. The 1673 content length of the cacerts response in appendix A.1 of [RFC7030] 1674 contains 639 bytes in binary. The CoAP message adds around 10 bytes, 1675 the DTLS record 29 bytes. To avoid IP fragmentation, the CoAP Block 1676 Option is used and an MTU of 127 is assumed to stay within one IEEE 1677 802.15.4 packet. To stay below the MTU of 127, the payload is split 1678 in 9 packets with a payload of 64 bytes each, followed by a last 1679 tenth packet of 63 bytes. The client sends an IPv6 packet containing 1680 the UDP datagram with the DTLS record that encapsulates the CoAP 1681 request 10 times. The server returns an IPv6 packet containing the 1682 UDP datagram with the DTLS record that encapsulates the CoAP 1683 response. The CoAP request-response exchange with block option is 1684 shown below. Block Option is shown in a decomposed way (block- 1685 option:NUM/M/size) indicating the kind of Block Option (2 in this 1686 case) followed by a colon, and then the block number (NUM), the more 1687 bit (M = 0 in Block2 response means it is last block), and block size 1688 with exponent (2**(SZX+4)) separated by slashes. The Length 64 is 1689 used with SZX=2 to avoid IP fragmentation. The CoAP Request is sent 1690 confirmable (CON) and the Content-Format of the response, even though 1691 not shown, is 281 (application/pkcs7-mime; smime-type=certs-only). 1692 The transfer of the 10 blocks with partially filled block NUM=9 is 1693 shown below 1695 GET example.com:9085/est/crts (2:0/0/64) --> 1696 <-- (2:0/1/64) 2.05 Content 1697 GET example.com:9085/est/crts (2:1/0/64) --> 1698 <-- (2:1/1/64) 2.05 Content 1699 | 1700 | 1701 | 1702 GET example.com:9085/est/crts (2:9/0/64) --> 1703 <-- (2:9/0/64) 2.05 Content 1705 The header of the GET request looks like 1706 Ver = 1 1707 T = 0 (CON) 1708 Code = 0x01 (0.1 GET) 1709 Token = 0x9a (client generated) 1710 Options 1711 Option (Uri-Host) 1712 Option Delta = 0x3 (option# 3) 1713 Option Length = 0xD 1714 Option Value = "example.com" 1715 Option (Uri-Port) 1716 Option Delta = 0x4 (option# 3+4=7) 1717 Option Length = 0x4 1718 Option Value = 9085 1719 Option (Uri-Path) 1720 Option Delta = 0x4 (option# 7+4=11) 1721 Option Length = 0x5 1722 Option Value = "est" 1723 Option (Uri-Path)Uri-Path) 1724 Option Delta = 0x0 (option# 11+0=11) 1725 Option Length = 0x6 1726 Option Value = "crts" 1727 Option (Accept) 1728 Option Delta = 0x6 (option# 11+6=17) 1729 Option Length = 0x2 1730 Option Value = 281 1731 Payload = [Empty] 1733 The Uri-Host and Uri-Port Options can be omitted if they coincide 1734 with the transport protocol destination address and port 1735 respectively. Explicit Uri-Host and Uri-Port Options are typically 1736 used when an endpoint hosts multiple virtual servers and uses the 1737 Options to route the requests accordingly. 1739 For further detailing the CoAP headers, the first two and the last 1740 blocks are written out below. The header of the first Block2 1741 response looks like 1742 Ver = 1 1743 T = 2 (ACK) 1744 Code = 0x45 (2.05 Content) 1745 Token = 0x9a (copied from request by server) 1746 Options 1747 Option 1748 Option Delta = 0xC (option# 12 Content-Format) 1749 Option Length = 0x2 1750 Option Value = 281 1751 Option 1752 Option Delta = 0xB (option# 12+11=23 Block2) 1753 Option Length = 0x1 1754 Option Value = 0x0A (block#=0, M=1, SZX=2) 1756 [ The hexadecimal representation below would NOT be transported 1757 in hex, but in binary. Hex is used because a binary representation 1758 cannot be rendered well in text. ] 1760 Payload = 1761 3082027b06092a864886f70d010702a082026c308202680201013100300b 1762 06092a864886f70d010701a082024e3082024a308201f0a0030201020209 1763 009189bc 1765 The second Block2: 1767 Ver = 1 1768 T = 2 (means ACK) 1769 Code = 0x45 (2.05 Content) 1770 Token = 0x9a (copied from request by server) 1771 Options 1772 Option 1773 Option Delta = 0xC (option# 12 Content-Format) 1774 Option Length = 0x2 1775 Option Value = 281 1776 Option 1777 Option Delta = 0xB (option 12+11=23 Block2) 1778 Option Length = 0x1 1779 Option Value = 0x1A (block#=1, M=1, SZX=2) 1781 [ The hexadecimal representation below would NOT be transported 1782 in hex, but in binary. Hex is used because a binary representation 1783 cannot be rendered well in text. ] 1785 Payload = 1786 df9c99244b300a06082a8648ce3d0403023067310b300906035504061302 1787 5553310b300906035504080c024341310b300906035504070c024c413114 1788 30120603 1789 The 10th and final Block2: 1791 Ver = 1 1792 T = 2 (means ACK) 1793 Code = 0x45 (2.05 Content) 1794 Token = 0x9a (copied from request by server) 1795 Options 1796 Option 1797 Option Delta = 0xC (option# 12 Content-Format) 1798 Option Length = 0x2 1799 Option Value = 281 1800 Option 1801 Option Delta = 0xB (option# 12+11=23 Block2 ) 1802 Option Length = 0x1 1803 Option Value = 0x92 (block#=9, M=0, SZX=2) 1805 [ The hexadecimal representation below would NOT be transported 1806 in hex, but in binary. Hex is used because a binary representation 1807 cannot be rendered well in text. ] 1809 Payload = 1810 2ec0b4af52d46f3b7ecc9687ddf267bcec368f7b7f1353272f022047a28a 1811 e5c7306163b3c3834bab3c103f743070594c089aaa0ac870cd13b902caa1 1812 003100 1814 B.2. enroll / reenroll 1816 In this example, the requested Block2 size of 256 bytes, required by 1817 the client, is transferred to the server in the very first request 1818 message. The block size 256=(2**(SZX+4)) which gives SZX=4. The 1819 notation for block numbering is the same as in Appendix B.1. The 1820 header fields and the payload are omitted for brevity. 1822 POST [2001:db8::2:321]:61616/est/sen (CON)(1:0/1/256) {CSR req} --> 1823 <-- (ACK) (1:0/1/256) (2.31 Continue) 1824 POST [2001:db8::2:321]:61616/est/sen (CON)(1:1/1/256) {CSR req} --> 1825 <-- (ACK) (1:1/1/256) (2.31 Continue) 1826 . 1827 . 1828 . 1829 POST [2001:db8::2:321]:61616/est/sen (CON)(1:N1/0/256){CSR req} --> 1830 <-- (ACK) (1:N1/0/256)(2:0/1/256)(2.04 Changed){Cert resp} 1831 POST [2001:db8::2:321]:61616/est/sen (CON)(2:1/0/256) --> 1832 <-- (ACK) (2:1/1/256)(2.04 Changed) {Cert resp} 1833 . 1834 . 1835 . 1836 POST [2001:db8::2:321]:61616/est/sen (CON)(2:N2/0/256) --> 1837 <-- (ACK) (2:N2/0/256) (2.04 Changed) {Cert resp} 1839 Figure 5: EST-COAP enrollment with multiple blocks 1841 N1+1 blocks have been transferred from client to the server and N2+1 1842 blocks have been transferred from server to client. 1844 Appendix C. Message content breakdown 1846 This appendix presents the breakdown of the hexadecimal dumps of the 1847 binary payloads shown in Appendix A. 1849 C.1. cacerts 1851 The breakdown of cacerts response containing one root CA certificate 1852 is 1853 Certificate: 1854 Data: 1855 Version: 3 (0x2) 1856 Serial Number: 1857 91:89:bc:df:9c:99:24:4b 1858 Signature Algorithm: ecdsa-with-SHA256 1859 Issuer: C=US, ST=CA, L=LA, O=Example Inc, 1860 OU=certification, CN=Root CA 1861 Validity 1862 Not Before: Jan 7 10:40:41 2019 GMT 1863 Not After : Jan 2 10:40:41 2039 GMT 1864 Subject: C=US, ST=CA, L=LA, O=Example Inc, 1865 OU=certification, CN=Root CA 1866 Subject Public Key Info: 1867 Public Key Algorithm: id-ecPublicKey 1868 Public-Key: (256 bit) 1869 pub: 1870 04:81:49:94:08:2b:6e:81:85:f3:df:53:f5:e0:be: 1871 e6:98:97:33:35:20:00:23:dd:f7:8c:d1:7a:44:3f: 1872 fd:8d:dd:40:90:87:69:c5:56:52:ac:2c:cb:75:c4: 1873 a5:0a:7c:7d:db:7c:22:da:e6:c8:5c:ca:53:82:09: 1874 fd:bb:f1:04:c9 1875 ASN1 OID: prime256v1 1876 NIST CURVE: P-256 1877 X509v3 extensions: 1878 X509v3 Subject Key Identifier: 1879 24:95:E8:16:EF:6F:FC:AA:F3:56:CE:4A:DF:FE:33:CF:49:2A:BB:A8 1880 X509v3 Authority Key Identifier: 1881 keyid: 1882 24:95:E8:16:EF:6F:FC:AA:F3:56:CE:4A:DF:FE:33:CF:49:2A:BB:A8 1884 X509v3 Basic Constraints: critical 1885 CA:TRUE 1886 X509v3 Key Usage: critical 1887 Certificate Sign, CRL Sign 1888 X509v3 Subject Alternative Name: 1889 email:certify@example.com 1890 Signature Algorithm: ecdsa-with-SHA256 1891 30:45:02:21:00:da:e3:7c:96:f1:54:c3:2e:c0:b4:af:52:d4: 1892 6f:3b:7e:cc:96:87:dd:f2:67:bc:ec:36:8f:7b:7f:13:53:27: 1893 2f:02:20:47:a2:8a:e5:c7:30:61:63:b3:c3:83:4b:ab:3c:10: 1894 3f:74:30:70:59:4c:08:9a:aa:0a:c8:70:cd:13:b9:02:ca 1896 C.2. enroll / reenroll 1898 The breakdown of the enrollment request is 1900 Certificate Request: 1901 Data: 1902 Version: 0 (0x0) 1903 Subject: C=US, ST=CA, L=LA, O=example Inc, 1904 OU=IoT/serialNumber=Wt1234 1905 Subject Public Key Info: 1906 Public Key Algorithm: id-ecPublicKey 1907 Public-Key: (256 bit) 1908 pub: 1909 04:c8:b4:21:f1:1c:25:e4:7e:3a:c5:71:23:bf:2d: 1910 9f:dc:49:4f:02:8b:c3:51:cc:80:c0:3f:15:0b:f5: 1911 0c:ff:95:8d:75:41:9d:81:a6:a2:45:df:fa:e7:90: 1912 be:95:cf:75:f6:02:f9:15:26:18:f8:16:a2:b2:3b: 1913 56:38:e5:9f:d9 1914 ASN1 OID: prime256v1 1915 NIST CURVE: P-256 1916 Attributes: 1917 challengePassword : <256-bit POP linking value> 1918 Requested Extensions: 1919 X509v3 Subject Alternative Name: 1920 othername: 1921 Signature Algorithm: ecdsa-with-SHA256 1922 30:45:02:21:00:92:56:3a:54:64:63:bd:9e:cf:f1:70:d0:fd: 1923 1f:2e:f0:d3:d0:12:16:0e:5e:e9:0c:ff:ed:ab:ec:9b:9a:38: 1924 92:02:20:17:9f:10:a3:43:61:09:05:1a:ba:d1:75:90:a0:9b: 1925 c8:7c:4d:ce:54:53:a6:fc:11:35:a1:e8:4e:ed:75:43:77 1927 The CSR contained a ChallengePassword which is used for POP linking 1928 (Section 4). 1930 The breakdown of the issued certificate is 1931 Certificate: 1932 Data: 1933 Version: 3 (0x2) 1934 Serial Number: 9112578475118446130 (0x7e7661d7b54e4632) 1935 Signature Algorithm: ecdsa-with-SHA256 1936 Issuer: C=US, ST=CA, O=Example Inc, OU=certification, 1937 CN=802.1AR CA 1938 Validity 1939 Not Before: Jan 31 11:29:16 2019 GMT 1940 Not After : Dec 31 23:59:59 9999 GMT 1941 Subject: C=US, ST=CA, L=LA, O=example Inc, 1942 OU=IoT/serialNumber=Wt1234 1943 Subject Public Key Info: 1944 Public Key Algorithm: id-ecPublicKey 1945 Public-Key: (256 bit) 1946 pub: 1947 04:c8:b4:21:f1:1c:25:e4:7e:3a:c5:71:23:bf:2d: 1948 9f:dc:49:4f:02:8b:c3:51:cc:80:c0:3f:15:0b:f5: 1949 0c:ff:95:8d:75:41:9d:81:a6:a2:45:df:fa:e7:90: 1950 be:95:cf:75:f6:02:f9:15:26:18:f8:16:a2:b2:3b: 1951 56:38:e5:9f:d9 1952 ASN1 OID: prime256v1 1953 NIST CURVE: P-256 1954 X509v3 extensions: 1955 X509v3 Basic Constraints: 1956 CA:FALSE 1957 X509v3 Subject Key Identifier: 1958 96:60:0D:87:16:BF:7F:D0:E7:52:D0:AC:76:07:77:AD:66:5D:02:A0 1960 X509v3 Authority Key Identifier: 1961 keyid: 1962 68:D1:65:51:F9:51:BF:C8:2A:43:1D:0D:9F:08:BC:2D:20:5B:11:60 1964 X509v3 Key Usage: critical 1965 Digital Signature, Key Encipherment 1966 X509v3 Subject Alternative Name: 1967 othername: 1968 Signature Algorithm: ecdsa-with-SHA256 1969 30:46:02:21:00:c0:d8:19:96:d2:50:7d:69:3f:3c:48:ea:a5: 1970 ee:94:91:bd:a6:db:21:40:99:d9:81:17:c6:3b:36:13:74:cd: 1971 86:02:21:00:a7:74:98:9f:4c:32:1a:5c:f2:5d:83:2a:4d:33: 1972 6a:08:ad:67:df:20:f1:50:64:21:18:8a:0a:de:6d:34:92:36 1974 C.3. serverkeygen 1976 The following is the breakdown of the server-side key generation 1977 request. 1979 Certificate Request: 1980 Data: 1981 Version: 0 (0x0) 1982 Subject: O=skg example 1983 Subject Public Key Info: 1984 Public Key Algorithm: id-ecPublicKey 1985 Public-Key: (256 bit) 1986 pub: 1987 04:1b:b8:c1:11:78:96:f9:8e:45:06:c0:3d:70:ef: 1988 be:82:0d:8e:38:ea:97:e9:d6:5d:52:c8:46:0c:58: 1989 52:c5:1d:d8:9a:61:37:0a:28:43:76:0f:c8:59:79: 1990 9d:78:cd:33:f3:c1:84:6e:30:4f:17:17:f8:12:3f: 1991 1a:28:4c:c9:9f 1992 ASN1 OID: prime256v1 1993 NIST CURVE: P-256 1994 Attributes: 1995 a0:00 1996 Signature Algorithm: ecdsa-with-SHA256 1997 30:44:02:20:38:7c:d4:e9:cf:62:8d:4a:f7:7f:92:eb:ed:48: 1998 90:d9:d1:41:dc:a8:6c:d2:75:7d:d1:4c:bd:59:cd:f6:96:18: 1999 02:20:2f:24:5e:82:8c:77:75:43:78:b6:66:60:a4:97:7f:11: 2000 3c:ac:da:a0:cc:7b:ad:7d:14:74:a7:fd:15:5d:09:0d 2002 Following is the breakdown of the private key content of the server- 2003 side key generation response. 2005 Private-Key: (256 bit) 2006 priv: 2007 0b:9a:67:78:5b:65:e0:73:60:b6:d2:8c:fc:1d:3f: 2008 39:25:c0:75:57:99:de:ec:a7:45:37:2b:01:69:7b: 2009 d8:a6 2010 pub: 2011 04:1b:b8:c1:11:78:96:f9:8e:45:06:c0:3d:70:ef: 2012 be:82:0d:8e:38:ea:97:e9:d6:5d:52:c8:46:0c:58: 2013 52:c5:1d:d8:9a:61:37:0a:28:43:76:0f:c8:59:79: 2014 9d:78:cd:33:f3:c1:84:6e:30:4f:17:17:f8:12:3f: 2015 1a:28:4c:c9:9f 2016 ASN1 OID: prime256v1 2017 NIST CURVE: P-256 2019 The following is the breakdown of the certificate in the server-side 2020 key generation response payload. 2022 Certificate: 2023 Data: 2024 Version: 3 (0x2) 2025 Serial Number: 1327972925857878603 (0x126de8571518524b) 2026 Signature Algorithm: ecdsa-with-SHA256 2027 Issuer: O=skg example 2028 Validity 2029 Not Before: Jan 9 08:57:08 2019 GMT 2030 Not After : Jan 4 08:57:08 2039 GMT 2031 Subject: O=skg example 2032 Subject Public Key Info: 2033 Public Key Algorithm: id-ecPublicKey 2034 Public-Key: (256 bit) 2035 pub: 2036 04:1b:b8:c1:11:78:96:f9:8e:45:06:c0:3d:70:ef: 2037 be:82:0d:8e:38:ea:97:e9:d6:5d:52:c8:46:0c:58: 2038 52:c5:1d:d8:9a:61:37:0a:28:43:76:0f:c8:59:79: 2039 9d:78:cd:33:f3:c1:84:6e:30:4f:17:17:f8:12:3f: 2040 1a:28:4c:c9:9f 2041 ASN1 OID: prime256v1 2042 NIST CURVE: P-256 2043 X509v3 extensions: 2044 X509v3 Basic Constraints: 2045 CA:FALSE 2046 Netscape Comment: 2047 OpenSSL Generated Certificate 2048 X509v3 Subject Key Identifier: 2049 49:4B:E5:98:DC:8D:BC:0D:BC:07:1C:48:6B:77:74:60:E5:CC:E6:21 2050 X509v3 Authority Key Identifier: 2051 keyid: 2052 49:4B:E5:98:DC:8D:BC:0D:BC:07:1C:48:6B:77:74:60:E5:CC:E6:21 2054 Signature Algorithm: ecdsa-with-SHA256 2055 30:46:02:21:00:a4:b1:67:d0:f9:ad:d9:20:28:10:e6:bf:6a: 2056 29:0b:8c:fd:fc:9b:9c:9f:ea:2c:c1:c8:fc:3a:46:4f:79:f2: 2057 c2:02:21:00:81:d3:1b:a1:42:75:1a:7b:4a:34:fd:1a:01:fc: 2058 fb:08:71:6b:9e:b5:3b:da:ad:c9:ae:60:b0:8f:52:42:9c:0f 2060 Authors' Addresses 2062 Peter van der Stok 2063 Consultant 2065 Email: consultancy@vanderstok.org 2066 Panos Kampanakis 2067 Cisco Systems 2069 Email: pkampana@cisco.com 2071 Michael C. Richardson 2072 Sandelman Software Works 2074 Email: mcr+ietf@sandelman.ca 2075 URI: http://www.sandelman.ca/ 2077 Shahid Raza 2078 RISE SICS 2079 Isafjordsgatan 22 2080 Kista, Stockholm 16440 2081 SE 2083 Email: shahid@sics.se