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