idnits 2.17.1 draft-ietf-ace-coap-est-02.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (June 21, 2018) is 2136 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 1593, but not defined ** Obsolete normative reference: RFC 5751 (Obsoleted by RFC 8551) ** Downref: Normative reference to an Informational RFC: RFC 5967 ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) ** Obsolete normative reference: RFC 7049 (Obsoleted by RFC 8949) -- Obsolete informational reference (is this intentional?): RFC 4492 (Obsoleted by RFC 8422) -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) -- 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: 4 errors (**), 0 flaws (~~), 2 warnings (==), 6 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: December 23, 2018 Cisco Systems 6 S. Kumar 7 Philips Lighting Research 8 M. Richardson 9 SSW 10 M. Furuhed 11 Nexus Group 12 S. Raza 13 RISE SICS 14 June 21, 2018 16 EST over secure CoAP (EST-coaps) 17 draft-ietf-ace-coap-est-02 19 Abstract 21 Enrollment over Secure Transport (EST) is used as a certificate 22 provisioning protocol over HTTPS. Low-resource devices often use the 23 lightweight Constrained Application Protocol (CoAP) for message 24 exchanges. This document defines how to transport EST payloads over 25 secure CoAP (EST-coaps), which allows low-resource constrained 26 devices to use existing EST functionality for provisioning 27 certificates. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on December 23, 2018. 46 Copyright Notice 48 Copyright (c) 2018 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (https://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 64 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 65 3. Conformance to RFC7925 profiles . . . . . . . . . . . . . . . 3 66 4. Protocol Design . . . . . . . . . . . . . . . . . . . . . . . 4 67 4.1. Payload format . . . . . . . . . . . . . . . . . . . . . 5 68 4.1.1. Content Format application/multipart-core . . . . . . 6 69 4.2. Message Bindings . . . . . . . . . . . . . . . . . . . . 6 70 4.3. CoAP response codes . . . . . . . . . . . . . . . . . . . 6 71 4.4. Delayed Results . . . . . . . . . . . . . . . . . . . . . 7 72 4.5. Server-side Key Generation . . . . . . . . . . . . . . . 8 73 4.6. Message fragmentation . . . . . . . . . . . . . . . . . . 9 74 4.7. Deployment limits . . . . . . . . . . . . . . . . . . . . 10 75 5. Discovery and URI . . . . . . . . . . . . . . . . . . . . . . 10 76 6. DTLS Transport Protocol . . . . . . . . . . . . . . . . . . . 11 77 7. HTTPS-CoAPS Registrar . . . . . . . . . . . . . . . . . . . . 13 78 8. Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 15 79 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 80 9.1. Content-Format Registry . . . . . . . . . . . . . . . . . 16 81 9.2. Resource Type registry . . . . . . . . . . . . . . . . . 17 82 10. Security Considerations . . . . . . . . . . . . . . . . . . . 17 83 10.1. EST server considerations . . . . . . . . . . . . . . . 17 84 10.2. HTTPS-CoAPS Registrar considerations . . . . . . . . . . 18 85 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 19 86 12. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . 19 87 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 88 13.1. Normative References . . . . . . . . . . . . . . . . . . 20 89 13.2. Informative References . . . . . . . . . . . . . . . . . 21 90 Appendix A. EST messages to EST-coaps . . . . . . . . . . . . . 23 91 A.1. cacerts . . . . . . . . . . . . . . . . . . . . . . . . . 23 92 A.2. csrattrs . . . . . . . . . . . . . . . . . . . . . . . . 28 93 A.3. enroll / reenroll . . . . . . . . . . . . . . . . . . . . 29 94 A.4. serverkeygen . . . . . . . . . . . . . . . . . . . . . . 31 95 Appendix B. EST-coaps Block message examples . . . . . . . . . . 33 96 B.1. cacerts block example . . . . . . . . . . . . . . . . . . 34 97 B.2. enroll block example . . . . . . . . . . . . . . . . . . 37 98 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 38 100 1. Introduction 102 "Classical" Enrollment over Secure Transport (EST) [RFC7030] is used 103 for authenticated/authorized endpoint certificate enrollment (and 104 optionally key provisioning) through a Certificate Authority (CA) or 105 Registration Authority (RA). EST messages run over HTTPS. 107 This document defines a new transport for EST based on the 108 Constrained Application Protocol (CoAP) since some Internet of Things 109 (IoT) devices use CoAP instead of HTTP. Therefore, this 110 specification utilizes DTLS [RFC6347], CoAP [RFC7252], and UDP 111 instead of TLS [RFC5246], HTTP [RFC7230] and TCP. 113 EST messages may be relatively large and for this reason this 114 document also uses CoAP Block-Wise Transfer [RFC7959] to offer a 115 fragmentation mechanism of EST messages at the CoAP layer. COAP 116 Observe options [RFC7641] are also used to convey delayed EST 117 responses to clients. 119 This specification also profiles the use of EST to only support 120 certificate-based client Authentication. HTTP Basic or Digest 121 authentication (as described in Section 3.2.3 of [RFC7030] are not 122 supported. 124 2. Terminology 126 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 127 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 128 document are to be interpreted as described in [RFC2119]. 130 Many of the concepts in this document are taken over from [RFC7030]. 131 Consequently, much text is directly traceable to [RFC7030]. The same 132 document structure is followed to point out the differences and 133 commonalities between EST and EST-coaps. 135 3. Conformance to RFC7925 profiles 137 This section shows how EST-coaps fits into the profiles of low- 138 resource devices described in [RFC7925]. 140 EST-coaps can transport certificates and private keys. Certificates 141 are responses to (re-)enrollment requests or request for a trusted 142 certificate list. Private keys can be transported as responses to a 143 request to a server-side keygeneration as described in section 4.4 of 144 [RFC7030] and discussed in Section 4.5 of this document. 146 As per [RFC7925] section 3.3 and section 4.4, the mandatory cipher 147 suite for DTLS in EST-coaps is TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 148 defined in [RFC7251], and the the curve secp256r1 MUST be supported 149 [RFC4492]; this curve is equivalent to the NIST P-256 curve. Crypto 150 agility is important, and the recommendations in [RFC7925] section 151 4.4 and any updates to RFC7925 concerning Curve25519 and other CFRG 152 curves also applies. 154 DTLS1.2 implementations MUST use the Supported Elliptic Curves and 155 Supported Point Formats Extensions [RFC4492]. Uncompressed point 156 format MUST also be supported. [RFC6090] can be used as summary of 157 the ECC algorithms. DTLS 1.3 implementations differ from DTLS 1.2 158 because they do not support point format negotiation in favor of a 159 single point format for each curve and thus support for DTLS 1.3 does 160 not mandate point formation extensions and negotiation. 162 The EST-coaps client MUST be configured with at least an implicit TA 163 database from its manufacturer. The authentication of the EST-coaps 164 server by the EST-coaps client is based on certificate authentication 165 in the DTLS handshake. 167 The authentication of the EST-coaps client is based on a client 168 certificate in the DTLS handshake. This can either be 170 o a previously issued client certificate (e.g., an existing 171 certificate issued by the EST CA); this could be a common case for 172 simple re-enrollment of clients; 174 o a previously installed certificate (e.g., manufacturer-installed 175 certificate or a certificate issued by some other party); the 176 server is expected to trust the manufacturer's root CA certificate 177 in this case. 179 4. Protocol Design 181 EST-coaps uses CoAP to transfer EST messages, aided by Block-Wise 182 Transfer [RFC7959] to transport CoAP messages in blocks thus avoiding 183 (excessive) fragmentation of UDP datagrams. The use of "Block" for 184 the transfer of larger EST messages is specified in Section 4.6. The 185 Figure 1 below shows the layered EST-coaps architecture. 187 +------------------------------------------------+ 188 | EST request/response messages | 189 +------------------------------------------------+ 190 | CoAP for message transfer and signaling | 191 +------------------------------------------------+ 192 | DTLS for transport security | 193 +------------------------------------------------+ 194 | UDP for transport | 195 +------------------------------------------------+ 197 Figure 1: EST-coaps protocol layers 199 The EST-coaps protocol design follows closely the EST design. The 200 actions supported by EST-coaps are identified by their message types: 202 o CA certificate retrieval, needed to receive the complete set of CA 203 certificates. 205 o Simple enroll and reenroll, for CA to sign public client-identity 206 key. 208 o Certificate Signing Request (CSR) Attributes request messages, 209 informs the client of the fields to include in generated CSR. 211 o Server-side key generation messages, to provide a private client- 212 identity key when the client choses for an external entity to 213 generate its private key. 215 4.1. Payload format 217 The content-format (media type equivalent) of the CoAP message 218 determines which EST message is transported in the CoAP payload. The 219 media types specified in the HTTP Content-Type header (section 3.2.2 220 of [RFC7030]) are in EST-coaps specified by the Content-Format Option 221 (12) of CoAP. The combination of URI path and content-format used 222 for CoAP MUST map to an allowed combination of URI and media type as 223 defined for EST. The required content-formats for these requests and 224 response messages are defined in Section 9. The CoAP response codes 225 are defined in Section 4.3. 227 EST-coaps is designed for use between low-resource devices and hence 228 does not need to send base64-encoded data. Simple binary is more 229 efficient (30% smaller payload) and well supported by CoAP. 230 Therefore, the content formats specification in Section 4.1.1 231 specifies that the binary payload is transported as a CBOR major type 232 2, a byte string, for all EST-coaps Content-Formats. In the examples 233 of Appendix A, the base16 diagnostic notation is used for CBOR major 234 type 2, where h'450aafbb' represents an example binary payload. 236 4.1.1. Content Format application/multipart-core 238 A representation with content format ID TBD8 contains a collection of 239 representations along with their respective content format. The 240 content-format identifies the media-type application/multipart-core 241 specified in [I-D.fossati-core-multipart-ct]. 243 The collection is encoded as a CBOR array [RFC7049] with an even 244 number of elements. The second, fourth, sixth, etc. element is a 245 binary string containing a representation. The first, third, fifth, 246 etc. element is an unsigned integer specifying the content format ID 247 of the following representation. 249 For example, a collection containing two representations, one with 250 content format ID TBD5 and one with content format ID TBD2, looks 251 like this in diagnostic CBOR notation: 252 [TBD5,h'0123456789abcdef',TBD2,h'fedcba9876543210']. An example is 253 shown in Appendix A.4. 255 4.2. Message Bindings 257 The general EST CoAP message characteristics are: 259 o All EST-coaps messages expect a response from the server, thus the 260 client MUST send the requests over confirmable CON COAP messages. 262 o The Ver, TKL, Token, and Message ID values of the CoAP header are 263 not affected by EST. 265 o The CoAP options used are Uri-Host, Uri-Path, Uri-Port, Content- 266 Format, and Location-Path in CoAP. These CoAP Options are used to 267 communicate the HTTP fields specified in the EST REST messages. 269 o EST URLs are HTTPS based (https://), in CoAP these will be assumed 270 to be transformed to coaps (coaps://) 272 Appendix A includes some practical examples of EST messages 273 translated to CoAP. 275 4.3. CoAP response codes 277 Section 5.9 of [RFC7252] specifies the mapping of HTTP response codes 278 to CoAP response codes. Every time the HTTP response code 200 is 279 specified in [RFC7030] in response to a GET request, in EST-coaps the 280 equivalent CoAP response code 2.05 or 2.03 MUST be used. Similarly, 281 2.01, 2.02 or 2.04 MUST be used in response to POST EST requests. 282 Response code HTTP 202 has no equivalent in CoAP. In Section 4.4 it 283 is specified how EST requests over CoAP handle delayed messages. 285 All other HTTP 2xx response codes are not used by EST. For the 286 following HTTP 4xx error codes that may occur: 400, 401, 403, 404, 287 405, 406, 412, 413, 415; the equivalent CoAP response code for EST- 288 coaps is 4.xx. For the HTTP 5xx error codes: 500, 501, 502, 503, 504 289 the equivalent CoAP response code is 5.xx. 291 4.4. Delayed Results 293 If the server is slow providing the response, she can respond with an 294 empty ACK, sending the content later, according to [RFC7252], section 295 5.2.2. If the response will be more than one packet (requring block 296 mode) then the client needs to send an empty ACK with code 0.00 for 297 the first block and acknowledge the rest of the blocks accordingly. 298 To demonstrate this situation below we show a client sending an 299 enrollment request that will use more than one Block1 blocks to send 300 the CSR to the server. The server on the other hand will need more 301 than one Block2 blocks to respond, but will need take some time to 302 provide the response. Thus the server will use a 0.00 ACK for the 303 response which will be provided when ready by using 2.04 messages and 304 Block2 options. Readers should note that the client asks for a 305 decrease in the block size when acknowledging the first Block2. 307 CON | POST 1:0/1/256 (enroll request with CSR) --> 308 <-- ACK | 2.31 1:0/1/256 309 CON | POST 1:1/1/256 (enroll request with CSR) 310 <-- ACK | 2.31 1:1/1/256 311 CON | POST 1:2/0/256 (enroll request with CSR) 312 <-- ACK (code 0.00, no payload, 313 to signal delay in the response. 314 When ready, the server transfers 315 the response in Block2 blocks.) 316 CON | 2.04 1:2/0/256 & 2:0/1/128 (Certificate) --> 317 <-- ACK (code 0.00, no payload) 318 <-- CON | POST 2:1/0/128 319 ACK | 2.04 2:1/1/128 (Certificate) --> 320 <-- CON | POST 2:2/0/128 321 ACK | 2.04 2:2/0/128 (Certificate) --> 323 [EDNOTE: To update this. HTTP 202 Retry-After in EST needs an 324 equivalent mechanism in EST-coaps. Observe seems like a candidate 325 but after the HTTP 202 the client needs to do a new POST, not a GET, 326 so Observe is not the best option. We could use 2.04 or a new 2.0x 327 with Max-Age to convey the EST Retry-After. ] It is possible that 328 responses are not always directly available by the server, and may 329 even require manual intervention to generate the certificate for the 330 server response. Delays of minutes to hours are possible. EST 331 requires the use of an HTTP 202 message with a Retry-After header by 332 the server which signals to the client to attempt the request in a 333 certain amount of time. In EST, each GET request MUST be accompanied 334 by the observe option. When the result is directly available, the 335 client receives the result and forgets about the observe as specified 336 in section 3.6 of [RFC7641]. When a POST response is delayed, the 337 POST returns a 2.01 (Created) response code, having put a value in 338 the Location-Path option. After reception of 2.01 the client does a 339 GET request with the observe option to the newly returned location. 340 Once the delayed result is notified by the server, the client forgets 341 about the observe. 343 Next to the observe option the server MUST specify the Max-Age option 344 that indicates the maximum waiting time in minutes. 346 4.5. Server-side Key Generation 348 Constrained devices sometimes do not have the necessary hardware to 349 generate statistically random numbers for private keys and DTLS 350 ephemeral keys. Past experience has shown that low-resource 351 endpoints sometimes generate numbers which could allow someone to 352 decrypt the communication or guess the private key and impersonate as 353 the device. Studies have shown that the same keys are generated by 354 the same model devices deployed on-line. 356 Additionally, random number key generation is costly, thus energy 357 draining. Even though the random numbers that constitute the 358 identity/cert do not get generated often, an endpoint may not want to 359 spend time and energy generating keypairs, and just ask for one from 360 the server. 362 In these scenarios, server-side key generation can be used. The 363 client asks for the server or proxy to generate the private key and 364 the certificate which is transferred back to the client in the 365 server-side key generation response. 367 [RFC7030] recommends for the private key returned by the server to be 368 encrypted. The specification provides two methods to encrypt the 369 generated key, symmetric and asymmetric. The methods are signalled 370 by the client by using the relevant attributes (SMIMECapabilities and 371 DecryptKeyIdentifier or AsymmetricDecryptKeyIdentifier) in the CSR 372 request. In the symmetric key case, the key can be established out- 373 of-band or alternatively derived by the established TLS connection as 374 described in [RFC5705]. 376 The sever-side key generation response is returned using a CBOR array 377 Section 4.1.1. The certificate part exactly matches the response 378 from a enrollment response. The private key is placed inside of a 379 CMS SignedData. The SignedData is signed by the party that generated 380 the private key, which may or may not be the EST server or the EST 381 CA. The SignedData is further protected by placing it inside of a 382 CMS EnvelopedData as explained in Section 4.4.2 of [RFC7030]. 384 4.6. Message fragmentation 386 DTLS defines fragmentation only for the handshake part and not for 387 secure data exchange (DTLS records). [RFC6347] states that to avoid 388 using IP fragmentation, which involves error-prone datagram 389 reconstitution, invokers of the DTLS record layer SHOULD size DTLS 390 records so that they fit within any Path MTU estimates obtained from 391 the record layer. In addition, invokers residing on a 6LoWPAN over 392 IEEE 802.15.4 network SHOULD attempt to size CoAP messages such that 393 each DTLS record will fit within one or two IEEE 802.15.4 frames. 395 That is not always possible. Even though ECC certificates are small 396 in size, they can vary greatly based on signature algorithms, key 397 sizes, and OID fields used. For 256-bit curves, common ECDSA cert 398 sizes are 500-1000 bytes which could fluctuate further based on the 399 algorithms, OIDs, SANs and cert fields. For 384-bit curves, ECDSA 400 certs increase in size and can sometimes reach 1.5KB. Additionally, 401 there are times when the EST cacerts response from the server can 402 include multiple certs that amount to large payloads. Section 4.6 of 403 CoAP [RFC7252] describes the possible payload sizes: "if nothing is 404 known about the size of the headers, good upper bounds are 1152 bytes 405 for the message size and 1024 bytes for the payload size". 406 Section 4.6 of [RFC7252] also suggests that IPv4 implementations may 407 want to limit themselves to more conservative IPv4 datagram sizes 408 such as 576 bytes. From [RFC0791] follows that the absolute minimum 409 value of the IP MTU for IPv4 is as low as 68 bytes, which would leave 410 only 40 bytes minus security overhead for a UDP payload. Thus, even 411 with ECC certs, EST-coaps messages can still exceed sizes in MTU of 412 1280 for IPv6 or 60-80 bytes for 6LoWPAN [RFC4919] as explained in 413 section 2 of [RFC7959]. EST-coaps needs to be able to fragment EST 414 messages into multiple DTLS datagrams. Fine-grained fragmentation of 415 EST messages is essential. 417 To perform fragmentation in CoAP, [RFC7959] specifies the "Block1" 418 option for fragmentation of the request payload and the "Block2" 419 option for fragmentation of the return payload of a CoAP flow. 421 The BLOCK draft defines SZX in the Block1 and Block2 option fields. 422 These are used to convey the size of the blocks in the requests or 423 responses. 425 The CoAP client MAY specify the Block1 size and MAY also specify the 426 Block2 size. The CoAP server MAY specify the Block2 size, but not 427 the Block1 size. As explained in Section 1 of [RFC7959]), blockwise 428 transfers SHOULD be used in Confirmable CoAP messages to avoid the 429 exacerbation of lost blocks. 431 The Size1 response MAY be parsed by the client as a size indication 432 of the Block2 resource in the server response or by the server as a 433 request for a size estimate by the client. Similarly, Size2 option 434 defined in BLOCK should be parsed by the server as an indication of 435 the size of the resource carried in Block1 options and by the client 436 as a maximum size expected in the 4.13 (Request Entity Too Large) 437 response to a request. 439 Examples of fragmented messages are shown in Appendix B. 441 4.7. Deployment limits 443 Although EST-coaps paves the way for the utilization of EST for 444 constrained devices on constrained networks, some devices will not 445 have enough resources to handle the large payloads that come with 446 EST-coaps. The specification of EST-coaps is intended to ensure that 447 EST works for networks of constrained devices that choose to limit 448 their communications stack to UDP/CoAP. It is up to the network 449 designer to decide which devices execute the EST protocol and which 450 do not. 452 5. Discovery and URI 454 EST-coaps is targeted to low-resource networks with small packets. 455 Saving header space is important and an additional EST-coaps URI is 456 specified that is shorter than the EST URI. 458 In the context of CoAP, the presence and location of (path to) the 459 management data are discovered by sending a GET request to "/.well- 460 known/core" including a resource type (RT) parameter with the value 461 "ace.est" [RFC6690]. Upon success, the return payload will contain 462 the root resource of the EST resources. It is up to the 463 implementation to choose its root resource; throughout this document 464 the example root resource /est is used. 466 The individual EST-coaps server URIs differ from the EST URI by 467 replacing the scheme https by coaps and by specifying shorter 468 resource path names: 470 coaps://www.example.com/.well-known/est/ArbitraryLabel/. 472 The ArbitraryLabel Path-Segment SHOULD be of the shortest length 473 possible. 475 Figure 5 in section 3.2.2 of [RFC7030] enumerates the operations and 476 corresponding paths which are supported by EST. Table 1 provides the 477 mapping from the EST URI path to the shorter EST-coaps URI path. 479 +------------------+-----------+ 480 | EST | EST-coaps | 481 +------------------+-----------+ 482 | /cacerts | /crts | 483 | /simpleenroll | /sen | 484 | /simplereenroll | /sren | 485 | /csrattrs | /att | 486 | /serverkeygen | /skg | 487 +------------------+-----------+ 489 Table 1 491 The short resource URIs MUST be supported. The corresponding longer 492 URIs specified in [RFC7030] MAY be supported. 494 When discovering the root path for the EST resources, the server MAY 495 return all available resource paths and the used content types. This 496 is useful when multiple content types are specified for EST-coaps 497 server. The example below shows the discovery of the presence and 498 location of management data. 500 REQ: GET /.well-known/core?rt=ace.est 502 RES: 2.05 Content 503 ; rt="ace.est" 504 ;ct=TBD2 505 ;ct=TBD2 TBD7 506 ;ct=TBD2 TBD7 507 ;ct=TBD6 508 ;ct=TBD1 TBD7 TBD8 510 The first line of the discovery response MUST be returned. The five 511 consecutive lines MAY be returned. The return of the content-types 512 in the last four lines allows the client to choose the most 513 appropriate one from multiple content types. 515 6. DTLS Transport Protocol 517 EST-coaps depends on a secure transport mechanism over UDP that can 518 secure (confidentiality, authenticity) the exchanged CoAP messages. 520 DTLS is one such secure protocol. When "TLS" is referred to in the 521 context of EST, it is understood that in EST-coaps, security is 522 provided using DTLS instead. No other changes are necessary (all 523 provisional modes etc. are the same as for TLS). 525 CoAP was designed to avoid fragmentation. DTLS is used to secure 526 CoAP messages. However, fragmentation is still possible at the DTLS 527 layer during the DTLS handshake when using ECC ciphersuites. If 528 fragmentation is necessary, "DTLS provides a mechanism for 529 fragmenting a handshake message over several records, each of which 530 can be transmitted separately, thus avoiding IP fragmentation" 531 [RFC6347]. 533 CoAP and DTLS can provide proof of identity for EST-coaps clients and 534 server with simple PKI messages conformant to section 3.1 of 535 [RFC5272]. EST-coaps supports the certificate types and Trust 536 Anchors (TA) that are specified for EST in section 3 of [RFC7030]. 538 Channel-binding information for linking proof-of-identity with 539 connection-based proof-of-possession is optional for EST-coaps. When 540 proof-of-possession is desired, a set of actions are required 541 regarding the use of tls-unique, described in section 3.5 in 542 [RFC7030]. The tls-unique information translates to the contents of 543 the first "Finished" message in the (D)TLS handshake between server 544 and client [RFC5929]. The client is then supposed to add this 545 "Finished" message as a ChallengePassword in the attributes section 546 of the PKCS#10 Request Info to prove that the client is indeed in 547 control of the private key at the time of the TLS session when 548 performing a /simpleenroll, for example. In the case of EST-coaps, 549 the same operations can be performed during the DTLS handshake. For 550 DTLS 1.2, in the event of handshake message fragmentation, the Hash 551 of the handshake messages used in the MAC calculation of the Finished 552 message 554 PRF(master_secret, finished_label, Hash(handshake_messages)) 555 [0..verify_data_length-1]; 557 MUST be computed as if each handshake message had been sent as a 558 single fragment [RFC6347]. Similarly, for DTLS 1.3, the Finished 559 message 561 HMAC(finished_key, 562 Transcript-Hash(Handshake Context, 563 Certificate*, CertificateVerify*)) 565 * Only included if present. 567 MUST be computed as if each handshake message had been sent as a 568 single fragment following the algorithm described in 4.4.4 of 569 [I-D.ietf-tls-tls13]. 571 In a constrained CoAP environment, endpoints can't afford to 572 establish a DTLS connection for every EST transaction. 573 Authenticating and negotiating DTLS keys requires resources on low- 574 end endpoints and consumes valuable bandwidth. The DTLS connection 575 SHOULD remain open for persistent EST connections. For example, an 576 EST cacerts request that is followed by a simpleenroll request can 577 use the same authenticated DTLS connection. Given that after a 578 successful enrollment, it is more likely that a new EST transaction 579 will take place after a significant amount of time, the DTLS 580 connections SHOULD only be kept alive for EST messages that are 581 relatively close to each other. In some cases, such as NAT 582 rebinding, keeping the state of a connection is not possible when 583 devices sleep for extended periods of time. In such occasions, 584 [I-D.rescorla-tls-dtls-connection-id] negotiates a connection ID that 585 can eliminate the need for new handshake and its additional cost. 587 Support for Observe CoAP options [RFC7641] is compulsory. The 588 necessity of Observer for long delays (minutes - hours)is explained 589 in Section 4.4. Observe options could also be used by the server to 590 notify clients about a change in the cacerts or csr attributes 591 (resources) and might be an area of future work. 593 7. HTTPS-CoAPS Registrar 595 In real-world deployments, the EST server will not always reside 596 within the CoAP boundary. The EST-server can exist outside the 597 constrained network in a non-constrained network that supports TLS/ 598 HTTP. In such environments EST-coaps is used by the client within 599 the CoAP boundary and TLS is used to transport the EST messages 600 outside the CoAP boundary. A Registrar at the edge is required to 601 operate between the CoAP environment and the external HTTP network. 602 The EST coaps-to-HTTPS Registrar MUST terminate EST-coaps and 603 authenticate the client downstream and initiate EST connections over 604 TLS upstream. 606 The Registrar SHOULD authenticate the client downstream and it should 607 be authenticated by the EST server or CA upstream. The Registration 608 Authority (re-)creates the secure connection from DTLS to TLS and 609 vice versa. A trust relationship SHOULD be pre-established between 610 the Registrar and the EST servers to be able to proxy these 611 connections on behalf of various clients. 613 When enforcing Proof-of-Possession (POP), the (D)TLS tls-unique value 614 of the (D)TLS session needs to be used to prove that the private key 615 corresponding to the public key is in the possession of and can be 616 used by an end-entity or client. In other words, the CSR the client 617 is using needs to include information from the DTLS connection the 618 client establishes with the server. In EST, that information is the 619 (D)TLS tls-unique value of the (D)TLS session. In the presence of 620 ESTcoaps-to-HTTPS Registrar, the EST-coaps client MUST be 621 authenticated and authorized by the Registrar and the Registrar MUST 622 be authenticated as an EST Registrar client to the EST server. Thus 623 the POP information is lost between the EST-coaps client and the EST 624 server. The EST server becomes aware of the presence of an EST 625 Registrar from its TLS client certificate that includes id-kp-cmcRA 626 [RFC6402] extended key usage extension. As explained in Section 3.7 627 of [RFC7030], the EST server SHOULD apply an authorization policy 628 consistent with a Registrar client. For example, it could be 629 configured to accept POP linking information that does not match the 630 current TLS session because the authenticated EST client Registrar 631 has verified this information when acting as an EST server. 633 One possible use-case, shown in one figure below, is expected to be 634 deployed in practice: 636 Constrained Network 637 .---------. .----------------------------. 638 | CA | |.--------------------------.| 639 '---------' || || 640 | || || 641 .------. HTTP .-----------------. CoAPS .-----------. || 642 | EST |<------->|ESTcoaps-to-HTTPS|<-------->| EST Client| || 643 |Server|over TLS | Registrar | '-----------' || 644 '------' '-----------------' || 645 || || 646 |'--------------------------'| 647 '----------------------------' 649 ESTcoaps-to-HTTPS Registrar at the CoAP boundary. 651 Table 1 contains the URI mapping between the EST-coaps and EST the 652 Registrar SHOULD adhere to. Section 7 of [RFC8075] and Section 4.3 653 define the mapping between EST-coaps and HTTP response codes, that 654 determines how the Registrar translates CoAP response codes from/to 655 HTTP status codes. The mapping from Content-Type to media type is 656 defined in Section 9. The conversion from CBOR major type 2 to 657 base64 encoding needs to be done in the Registrar. Conversion is 658 possible because a TLS link exists between EST-coaps-to-HTTP 659 Registrar and EST server and a corresponding DTLS link exists between 660 EST-coaps-to-HTTP Registrar and EST client. 662 Due to fragmentation of large messages into blocks, an EST-coaps-to- 663 HTTP Registrar SHOULD reassemble the BLOCKs before translating the 664 binary content to Base-64, and consecutively relay the message 665 upstream. 667 For the discovery of the EST server by the EST client in the coap 668 environment, the EST-coaps-to-HTTP Registrar MUST announce itself 669 according to the rules of Section 5. The available actions of the 670 Registrars MUST be announced with as many resource paths. The 671 discovery of EST server in the http environment follow the rules 672 specified in [RFC7030]. 674 When server-side key generation is used, if the private key is 675 protected using symmetric keys then the Registrar needs to encrypt 676 the private key down to the client with one symmetric key and decrypt 677 it from the server with another. If no private key encryption takes 678 place the Registrar will be able to see the key as it establishes a 679 separate connection to the server. In the case of asymmetrically 680 encrypted private key, the Registrar may not be able to decrypt it if 681 the server encrypted it with a public key that corresponds to a 682 private key that belongs to the client. 684 8. Parameters 686 THis section addresses transmission parameters described in sections 687 4.7 and 4.8 of the CoAP document [RFC7252]. 689 ACK_TIMEOUT | 2 seconds | 690 ACK_RANDOM_FACTOR | 1.5 | 691 MAX_RETRANSMIT | 4 | 692 NSTART | 1 | 693 DEFAULT_LEISURE | 5 seconds | 694 PROBING_RATE | 1 byte/second | 696 Figure 2: EST-COAP protocol parameters 698 EST does not impose any unique parameters that affect the CoAP 699 parameters in Table 2 and 3 in the CoAP draft but the ones in CoAP 700 could be affecting EST. For example, the processing delay of CAs 701 could be less then 2s, but in this case they should send a CoAP ACK 702 every 2s while processing. 704 The main recommendation, based on experiments using Nexus Certificate 705 Manager with Californium for CoAP support, communicating with a 706 ContikiOS and tinyDTLS based client, from RISE SICS, is to start with 707 the default CoAP configuration parameters. 709 However, depending on the implementation scenario, resending and 710 timeouts can also occur on other networking layers, governed by other 711 configuration parameters. 713 Some further comments about some specific parameters, mainly from 714 Table 2 in [RFC7252]: 716 o DEFAULT_LEISURE: This setting is only relevant in multicast 717 scenarios, outside the scope of the EST-coaps draft. 719 o NSTART: Limit the number of simultaneous outstanding interactions 720 that a client maintains to a given server. The default is one, 721 hence is the risk of congestion or out-of-order messages already 722 limited. 724 o PROBING_RATE: A parameter which specifies the rate of re-sending 725 non-confirmable messages. The EST messages are defined to be sent 726 as CoAP confirmable messages, hence the PROBING_RATE setting is 727 not applicable. 729 Finally, the Table 3 parameters are mainly derived from the more 730 basic Table 2 parameters. If the CoAP implementation allows setting 731 them directly, they might need to be updated if the table 2 732 parameters are changed. 734 9. IANA Considerations 736 9.1. Content-Format Registry 738 Additions to the sub-registry "CoAP Content-Formats", within the 739 "CoRE Parameters" registry are specified in Table 2. These can be 740 registered either in the Expert Review range (0-255) or IETF Review 741 range (256-9999). 743 +-------------------------+--------+-----+--------------------------+ 744 | Media type | Encodi | ID | Reference | 745 | | ng | | | 746 +-------------------------+--------+-----+--------------------------+ 747 | application/pkcs7-mime; | - | TBD | [RFC5751] [RFC7030] | 748 | smime-type=server- | | 1 | | 749 | generated-key | | | | 750 | application/pkcs7-mime; | - | TBD | [RFC5751] | 751 | smime-type=certs-only | | 2 | | 752 | application/pkcs7-mime; | - | TBD | [RFC5751] [RFC5273] | 753 | smime-type=CMC-request | | 3 | | 754 | application/pkcs7-mime; | - | TBD | [RFC5751] [RFC5273] | 755 | smime-type=CMC-response | | 4 | | 756 | application/pkcs8 | - | TBD | [RFC5751] [RFC5958] | 757 | | | 5 | | 758 | application/csrattrs | - | TBD | [RFC7030] [RFC7231] | 759 | | | 6 | | 760 | application/pkcs10 | - | TBD | [RFC5751] [RFC5967] | 761 | | | 7 | | 762 | application/multict | - | TBD | [I-D.fossati-core-multip | 763 | | | 8 | art-ct] | 764 +-------------------------+--------+-----+--------------------------+ 766 Table 2: New CoAP Content-Formats 768 9.2. Resource Type registry 770 Additions to the sub-registry "CoAP Resource Type", within the "CoRE 771 Parameters" registry are needed for a new resource type. 773 o rt="ace.est" needs registration with IANA. 775 10. Security Considerations 777 10.1. EST server considerations 779 The security considerations of Section 6 of [RFC7030] are only 780 partially valid for the purposes of this document. As HTTP Basic 781 Authentication is not supported, the considerations expressed for 782 using passwords do not apply. 784 Given that the client has only limited resources and may not be able 785 to generate sufficiently random keys to encrypt its identity, it is 786 possible that the client uses server generated private/public keys to 787 encrypt its certificate. The transport of these keys is inherently 788 risky. A full probability analysis MUST be done to establish whether 789 server side key generation enhances or decreases the probability of 790 identity stealing. 792 When a client uses the Implicit TA database for certificate 793 validation, the client cannot verify that the implicit database can 794 act as an RA. It is RECOMMENDED that such clients include "Linking 795 Identity and POP Information" Section 6 in requests (to prevent such 796 requests from being forwarded to a real EST server by a man in the 797 middle). It is RECOMMENDED that the Implicit Trust Anchor database 798 used for EST server authentication be carefully managed to reduce the 799 chance of a third-party CA with poor certification practices from 800 being trusted. Disabling the Implicit Trust Anchor database after 801 successfully receiving the Distribution of CA certificates response 802 (Section 4.1.3 of [RFC7030]) limits any risk to the first DTLS 803 exchange. 805 In accordance with [RFC7030], TLS cipher suites that include 806 "_EXPORT_" and "_DES_" in their names MUST NOT be used. More 807 information about recommendations of TLS and DTLS are included in 808 [RFC7525]. 810 As described in CMC, Section 6.7 of [RFC5272], "For keys that can be 811 used as signature keys, signing the certification request with the 812 private key serves as a POP on that key pair". The inclusion of tls- 813 unique in the certification request links the proof-of-possession to 814 the TLS proof-of-identity. This implies but does not prove that the 815 authenticated client currently has access to the private key. 817 Regarding the Certificate Signing Request (CSR), an adversary could 818 exclude attributes that a server may want, include attributes that a 819 server may not want, and render meaningless other attributes that a 820 server may want. The CA is expected to be able to enforce policies 821 to recover from improper CSR requests. 823 Interpreters of ASN.1 structures should be aware of the use of 824 invalid ASN.1 length fields and should take appropriate measures to 825 guard against buffer overflows, stack overruns in particular, and 826 malicious content in general. 828 10.2. HTTPS-CoAPS Registrar considerations 830 The Registrar proposed in Section 7 must be deployed with care, and 831 only when the recommended connections are impossible. When POP is 832 used the Registrar terminating the TLS connection establishes a new 833 one with the upstream CA. Thus, it is impossible for POP to be 834 enforced throughout the EST transaction. The EST server could be 835 configured to accept POP linking information that does not match the 836 current TLS session because the authenticated EST Registrar client 837 has verified this information when acting as an EST server. The 838 introduction of an EST-coaps-to-HTTP Registrar assumes the client can 839 trust the registrar using its implicit or explicit TA database. It 840 also assumes the Registrar has a trust relationship with the upstream 841 EST server in order to act on behalf of the clients. 843 In a server-side key generation case, depending on the private key 844 encryption method, the Registrar may be able see the private key as 845 it acts as a man-in-the-middle. Thus, the clients puts its trust on 846 the Registrar not exposing the private key. 848 For some use cases, clients that leverage server-side key generation 849 might prefer for the enrolled keys to be generated by the Registrar 850 if the CA does not support server-side key generation. In these 851 cases the Registrar must support the random number generation using 852 proper entropy. Since the client has no knowledge if the Registrar 853 will be generating the keys and enrolling the certificates with the 854 CA or if the CA will be responsible for generating the keys, the 855 existence of a Registrar requires the client to put its trust on the 856 registrar doing the right thing if it is generating they private 857 keys. 859 11. Acknowledgements 861 The authors are very grateful to Klaus Hartke for his detailed 862 explanations on the use of Block with DTLS and his support for the 863 content-format specification. The authors would like to thank Esko 864 Dijk and Michael Verschoor for the valuable discussions that helped 865 in shaping the solution. They would also like to thank Peter 866 Panburana for his feedback on technical details of the solution. 867 Constructive comments were received from Benjamin Kaduk, Eliot Lear, 868 Jim Schaad, Hannes Tschofenig, Julien Vermillard, and John Manuel. 870 12. Change Log 872 -02: 874 Added paremeter discussion in section 8 876 Concluded content-format specification using multipart-ct draft 878 examples updated 880 -01: 882 Editorials done. 884 Redefinition of proxy to Registrar in Section 7. Explained better 885 the role of https-coaps Registrar, instead of "proxy" 887 Provide "observe" option examples 888 extended block message example. 890 inserted new server key generation text in Section 4.5 and 891 motivated server key generation. 893 Broke down details for DTLS 1.3 895 New media type uses CBOR array for multiple content-format 896 payloads 898 provided new content format tables 900 new media format for IANA 902 -00 904 copied from vanderstok-ace-coap-04 906 13. References 908 13.1. Normative References 910 [I-D.fossati-core-multipart-ct] 911 Bormann, C., "Multipart Content-Format for CoAP", draft- 912 fossati-core-multipart-ct-05 (work in progress), June 913 2018. 915 [I-D.ietf-tls-tls13] 916 Rescorla, E., "The Transport Layer Security (TLS) Protocol 917 Version 1.3", draft-ietf-tls-tls13-28 (work in progress), 918 March 2018. 920 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 921 Requirement Levels", BCP 14, RFC 2119, 922 DOI 10.17487/RFC2119, March 1997, 923 . 925 [RFC5272] Schaad, J. and M. Myers, "Certificate Management over CMS 926 (CMC)", RFC 5272, DOI 10.17487/RFC5272, June 2008, 927 . 929 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 930 Mail Extensions (S/MIME) Version 3.2 Message 931 Specification", RFC 5751, DOI 10.17487/RFC5751, January 932 2010, . 934 [RFC5967] Turner, S., "The application/pkcs10 Media Type", RFC 5967, 935 DOI 10.17487/RFC5967, August 2010, 936 . 938 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 939 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 940 January 2012, . 942 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 943 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 944 . 946 [RFC7030] Pritikin, M., Ed., Yee, P., Ed., and D. Harkins, Ed., 947 "Enrollment over Secure Transport", RFC 7030, 948 DOI 10.17487/RFC7030, October 2013, 949 . 951 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 952 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 953 October 2013, . 955 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 956 Application Protocol (CoAP)", RFC 7252, 957 DOI 10.17487/RFC7252, June 2014, 958 . 960 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 961 the Constrained Application Protocol (CoAP)", RFC 7959, 962 DOI 10.17487/RFC7959, August 2016, 963 . 965 [RFC8075] Castellani, A., Loreto, S., Rahman, A., Fossati, T., and 966 E. Dijk, "Guidelines for Mapping Implementations: HTTP to 967 the Constrained Application Protocol (CoAP)", RFC 8075, 968 DOI 10.17487/RFC8075, February 2017, 969 . 971 13.2. Informative References 973 [I-D.rescorla-tls-dtls-connection-id] 974 Rescorla, E., Tschofenig, H., Fossati, T., and T. Gondrom, 975 "The Datagram Transport Layer Security (DTLS) Connection 976 Identifier", draft-rescorla-tls-dtls-connection-id-02 977 (work in progress), November 2017. 979 [RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, 980 DOI 10.17487/RFC0791, September 1981, 981 . 983 [RFC4492] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and B. 984 Moeller, "Elliptic Curve Cryptography (ECC) Cipher Suites 985 for Transport Layer Security (TLS)", RFC 4492, 986 DOI 10.17487/RFC4492, May 2006, 987 . 989 [RFC4919] Kushalnagar, N., Montenegro, G., and C. Schumacher, "IPv6 990 over Low-Power Wireless Personal Area Networks (6LoWPANs): 991 Overview, Assumptions, Problem Statement, and Goals", 992 RFC 4919, DOI 10.17487/RFC4919, August 2007, 993 . 995 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 996 (TLS) Protocol Version 1.2", RFC 5246, 997 DOI 10.17487/RFC5246, August 2008, 998 . 1000 [RFC5273] Schaad, J. and M. Myers, "Certificate Management over CMS 1001 (CMC): Transport Protocols", RFC 5273, 1002 DOI 10.17487/RFC5273, June 2008, 1003 . 1005 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1006 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 1007 March 2010, . 1009 [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings 1010 for TLS", RFC 5929, DOI 10.17487/RFC5929, July 2010, 1011 . 1013 [RFC5958] Turner, S., "Asymmetric Key Packages", RFC 5958, 1014 DOI 10.17487/RFC5958, August 2010, 1015 . 1017 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 1018 Curve Cryptography Algorithms", RFC 6090, 1019 DOI 10.17487/RFC6090, February 2011, 1020 . 1022 [RFC6402] Schaad, J., "Certificate Management over CMS (CMC) 1023 Updates", RFC 6402, DOI 10.17487/RFC6402, November 2011, 1024 . 1026 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1027 Protocol (HTTP/1.1): Message Syntax and Routing", 1028 RFC 7230, DOI 10.17487/RFC7230, June 2014, 1029 . 1031 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1032 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1033 DOI 10.17487/RFC7231, June 2014, 1034 . 1036 [RFC7251] McGrew, D., Bailey, D., Campagna, M., and R. Dugal, "AES- 1037 CCM Elliptic Curve Cryptography (ECC) Cipher Suites for 1038 TLS", RFC 7251, DOI 10.17487/RFC7251, June 2014, 1039 . 1041 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 1042 "Recommendations for Secure Use of Transport Layer 1043 Security (TLS) and Datagram Transport Layer Security 1044 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 1045 2015, . 1047 [RFC7641] Hartke, K., "Observing Resources in the Constrained 1048 Application Protocol (CoAP)", RFC 7641, 1049 DOI 10.17487/RFC7641, September 2015, 1050 . 1052 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 1053 Security (TLS) / Datagram Transport Layer Security (DTLS) 1054 Profiles for the Internet of Things", RFC 7925, 1055 DOI 10.17487/RFC7925, July 2016, 1056 . 1058 Appendix A. EST messages to EST-coaps 1060 This section takes all examples from Appendix A of [RFC7030], changes 1061 the payload from Base64 to binary and replaces the http headers by 1062 their CoAP equivalents. 1064 The corresponding CoAP headers are only shown in Appendix A.1. 1065 Creating CoAP headers are assumed to be generally known. 1067 Binary payload is a CBOR major type 2 (byte array), that is shown 1068 with a base16 (hexadecimal) CBOR diagnostic notation. 1070 [EDNOTE: The payloads of the examples need to be re-generated with 1071 appropriate tools and example certificates.] 1073 A.1. cacerts 1075 These examples assume that the resource discovery, returned a short 1076 URL of "/est". 1078 In EST-coaps, a coaps cacerts IPv4 message can be: 1080 GET coaps://192.0.2.1:8085/est/crts 1082 The corresponding CoAP header fields are shown below. The use of 1083 block and DTLS are worked out in Appendix B. 1085 Ver = 1 1086 T = 0 (CON) 1087 Code = 0x01 (0.01 is GET) 1088 Token = 0x9a (client generated) 1089 Options 1090 Option1 (Uri-Host) [optional] 1091 Option Delta = 0x3 (option nr = 3) 1092 Option Length = 0x9 1093 Option Value = 192.0.2.1 1094 Option2 (Observe) 1095 Option Delta = 0x1 (option nr = 3+3=6) 1096 Option Length = 0x1 1097 Option Value = 0 (register) 1098 Option3 (Uri-Port) [optional] 1099 Option Delta = 0x1 (option nr = 6+1=7) 1100 Option Length = 0x4 1101 Option Value = 8085 1102 Option4 (Uri-Path) 1103 Option Delta = 0x4 (option nr = 7+4= 11) 1104 Option Length = 0x5 1105 Option Value = "est" 1106 Option5 (Uri-Path) 1107 Option Delta = 0x0 (option nr = 11+0= 11) 1108 Option Length = 0x6 1109 Option Value = "crts" 1110 Option6 (Max-Age) 1111 Option Delta = 0x3 (option nr = 11+3= 14) 1112 Option Length = 0x1 1113 Option Value = 0x1 (1 minute) 1114 Payload = [Empty] 1116 A 2.05 Content response with a cert in EST-coaps will then be: 1118 2.05 Content (Content-Format: TBD2) 1119 {payload} 1121 with CoAP fields 1123 Ver = 1 1124 T = 2 (ACK) 1125 Code = 0x45 (2.05 Content) 1126 Token = 0x9a (copied by server) 1127 Options 1128 Option1 (Observe) 1129 Option Delta = 0x6 (option nr =6) 1130 Option Length = 0x1 1131 Option Value = 12 ( 12 > 0) 1132 Option2 (Content-Format) 1133 Option Delta = 0xC (option nr = 6+6 =12) 1134 Option Length = 0x2 1135 Option Value = TBD2 (defined in this document) 1137 Payload = 1138 h'30233906092a6206734107028c2a3023260201013100300b06092a6206734107018 1139 c0c3020bb302063c20102020900a61e75193b7acc0d06092a620673410105050030 1140 1b31193017060355040313106573744578616d706c654341204f774f301e170d313 1141 3303530393033353333315a170d3134303530393033353333315a301b3119301706 1142 0355040313106573744578616d706c654341204f774f302062300d06092a6206734 1143 10101050003204f0030204a022041003a923a2968bae4aae136ca4e2512c5200680 1144 358482ac39d6f640e4574e654ea35f48b1e054c5da3372872f7a1e429f4edf39584 1145 32efb2106591d3eb783c1034709f251fc86566bda2d541c792389eac4ec9e181f4b 1146 9f596e5ef2679cc321542b11337f90a44df3c85f1516561fa968a1914f265bc0b82 1147 76ebe3106a790d97d34c8c37c74fe1c30b396424664ac426284a9f6022e02693843 1148 6880adfcd95c98ca1dfc2e6d75319b85d0458de28a9d13fb16d620fff7541f6a25d 1149 7daf004355020301000130b040300f0603551d130101f10530030101fc1d0603551 1150 d0e04160414084d321ca0135e77217a486b686b334b00e0603551d0f0101f104030 1151 20106300d06092a62067341010505000320410023703b965746a0c2c978666d787a 1152 94f89b495a11f0d369b28936ec2475c0f0855c8e83f823f2b871a1d92282f323c45 1153 904ba008579216cf5223b8b1bc425a0677262047f7700240631c17f3035d1c3780b 1154 2385241cba1f4a6e98e6be6820306b3a786de5a557795d1893822347b5f825d34a7 1155 ad2876f8feba4d525b31066f6505796f71530003431a3e6bbfe788b4565029a7e20 1156 a51107677552586152d051e8eebf383e92288983421d5c5652a4870c3af74b9bdbe 1157 d6b462e2263d30f6d3020c330206bc20102020101300d06092a6206734101050500 1158 301b31193017060355040313106573744578616d706c654341204f774f301e170d3 1159 133303530393033353333325a170d3134303530393033353333325a301b31193017 1160 060355040313106573744578616d706c654341204e774f302062300d06092a62067 1161 3410101050003204f0030204a02204100ef6b677a3247c1fc03d2b9baf113e5e7e1 1162 1f49e0421120e6b8384160f2bf02630ef544d5fd0d5623b35713c79a7229283a790 1163 8751a634aa420a3e2a4b1f10519d046f02f5a5dd6d760c2a842356e067b7bd94338 1164 d1faa3b3ddd4813060a207b0a097067007e45b052b60fdbae4656e11562c4f5abb7 1165 b0cf87a79d221f1127313c53371ce1245d63db45a1203a23340ba08042c768d03b8 1166 076a028d3a51d87d2ef107bbd6f2305ce5e67668724002fb726df9c14476c37de0f 1167 55033f192a5ad21f9a2a71c20301000134b050300e0603551d0f0101f104030204c 1168 1d0603551d0e04160414112966e304761732fbfe6a2c823c301f0603551d2304183 1169 0165084d321ca0135e77217a486b686b334b00d06092a6206734101050500032041 1170 00b382ba3355a50e287bae15758b3beff63d34d3e357b90031495d018868e49589b 1171 9faf46a4ad49b1d35b06ef380106677440934663c2cc111c183655f4dc41c0b3401 1172 123d35387389db91f1e1b4131b16c291d35730b3f9b33c7475124851555fe5fc647 1173 e8fd029605367c7e01281bf6617110021b0d10847dce0e9f0ca6c764b6334784055 1174 172c3983d1e3a3a82301a54fcc9b0670c543a1c747164619101ff23b240b2a26394 1175 c1f7d38d0e2f4747928ece5c34627a075a8b3122011e9d9158055c28f020c330206 1176 bc20102020102300d06092a6206734101050500301b311930170603550403131065 1177 73744578616d706c654341204e774e301e170d3133303530393033353333325a170 1178 d3134303530393033353333325a301b31193017060355040313106573744578616d 1179 706c654341204f774e302062300d06092a620673410101050003204f0030204a022 1180 041003a923a2968bae4aae136ca4e2512c5200680358482ac39d6f640e4574e654e 1181 a35f48b1e054c5da3372872f7a1e429f4edf3958432efb2106591d3eb783c103470 1182 9f251fc86566bda2d541c792389eac4ec9e181f4b9f596e5ef2679cc321542b1133 1183 7f90a44df3c85f1516561fa968a1914f265bc0b8276ebe3106a790d97d34c8c37c7 1184 4fe1c30b396424664ac426284a9f6022e026938436880adfcd95c98ca1dfc2e6d75 1185 319b85d0458de28a9d13fb16d620fff7541f6a25d7daf004355020301000134b050 1186 300e0603551d0f0101f104030204c1d0603551d0e04160414084d321ca0135e7721 1187 7a486b686b334b01f0603551d230418301653112966e304761732fbfe6a2c823c30 1188 0d06092a6206734101050500032041002e106933a443070acf5594a3a584d08af7e 1189 06c295059370a06639eff9bd418d13bc25a298223164a6cf1856b11a81617282e4a 1190 410d82ef086839c6e235690322763065455351e4c596acc7c016b225dec094706c2 1191 a10608f403b10821984c7c152343b18a768c2ad30238dc45dd653ee6092b0d5cd4c 1192 2f7d236043269357f76d13f95fb5f00d0e19263c6833948e1ba612ce8197af650e2 1193 5d882c12f4b6b9b67252c608ef064aca3f9bc867d71172349d510bb7651cd438837 1194 73d927deb41c4673020bb302063c201020209009b9dda3324700d06092a62067341 1195 01050500301b31193017060355040313106573744578616d706c654341204e774e3 1196 01e170d3133303530393033353333325a170d3134303530393033353333325a301b 1197 31193017060355040313106573744578616d706c654341204e774e302062300d060 1198 92a620673410101050003204f0030204a02204100ef6b677a3247c1fc03d2b9baf1 1199 13e5e7e11f49e0421120e6b8384160f2bf02630ef544d5fd0d5623b35713c79a722 1200 9283a7908751a634aa420a3e2a4b1f10519d046f02f5a5dd6d760c2a842356e067b 1201 7bd94338d1faa3b3ddd4813060a207b0a097067007e45b052b60fdbae4656e11562 1202 c4f5abb7b0cf87a79d221f1127313c53371ce1245d63db45a1203a23340ba08042c 1203 768d03b8076a028d3a51d87d2ef107bbd6f2305ce5e67668724002fb726df9c1447 1204 6c37de0f55033f192a5ad21f9a2a71c20301000130b040300f0603551d130101f10 1205 530030101fc1d0603551d0e04160414112966e304761732fbfe6a2c823c300e0603 1206 551d0f0101f10403020106300d06092a620673410105050003204100423f06d4b76 1207 0f4b42744a279035571696f272a0060f1325a40898509601ad14004f652db6312a1 1208 475c4d7cd50f4b269035585d7856c5337765a66b38462d5bdaa7778aab24bbe2815 1209 e37722cd10e7166c50e75ab75a1271324460211991e7445a2960f47351a1a629253 1210 34119794b90e320bc730d6c1bee496e7ac125ce9a1eca595a3a4c54a865e6b623c9 1211 247bfd0a7c19b56077392555c955e233642bec643ae37c166c5e221d797aea3748f 1212 0391c8d692a5cf9bb71f6d0e37984d6fa673a30d0c006343116f58403100' 1214 The hexadecimal dump of the CBOR payload looks like: 1216 59 09CD # bytes(2509) 1217 30233906092A6206734107028C2A3023260201013100300B06092A62067341070 1218 18C0C3020BB302063C20102020900A61E75193B7ACC0D06092A62067341010505 1219 00301B31193017060355040313106573744578616D706C654341204F774F301E1 1220 70D3133303530393033353333315A170D3134303530393033353333315A301B31 1221 193017060355040313106573744578616D706C654341204F774F302062300D060 1222 92A620673410101050003204F0030204A022041003A923A2968BAE4AAE136CA4E 1223 2512C5200680358482AC39D6F640E4574E654EA35F48B1E054C5DA3372872F7A1 1224 E429F4EDF3958432EFB2106591D3EB783C1034709F251FC86566BDA2D541C7923 1225 89EAC4EC9E181F4B9F596E5EF2679CC321542B11337F90A44DF3C85F1516561FA 1226 968A1914F265BC0B8276EBE3106A790D97D34C8C37C74FE1C30B396424664AC42 1227 6284A9F6022E026938436880ADFCD95C98CA1DFC2E6D75319B85D0458DE28A9D1 1228 3FB16D620FFF7541F6A25D7DAF004355020301000130B040300F0603551D13010 1229 1F10530030101FC1D0603551D0E04160414084D321CA0135E77217A486B686B33 1230 4B00E0603551D0F0101F10403020106300D06092A620673410105050003204100 1231 23703B965746A0C2C978666D787A94F89B495A11F0D369B28936EC2475C0F0855 1232 C8E83F823F2B871A1D92282F323C45904BA008579216CF5223B8B1BC425A06772 1233 62047F7700240631C17F3035D1C3780B2385241CBA1F4A6E98E6BE6820306B3A7 1234 86DE5A557795D1893822347B5F825D34A7AD2876F8FEBA4D525B31066F6505796 1235 F71530003431A3E6BBFE788B4565029A7E20A51107677552586152D051E8EEBF3 1236 83E92288983421D5C5652A4870C3AF74B9BDBED6B462E2263D30F6D3020C33020 1237 6BC20102020101300D06092A6206734101050500301B311930170603550403131 1238 06573744578616D706C654341204F774F301E170D313330353039303335333332 1239 5A170D3134303530393033353333325A301B31193017060355040313106573744 1240 578616D706C654341204E774F302062300D06092A620673410101050003204F00 1241 30204A02204100EF6B677A3247C1FC03D2B9BAF113E5E7E11F49E0421120E6B83 1242 84160F2BF02630EF544D5FD0D5623B35713C79A7229283A7908751A634AA420A3 1243 E2A4B1F10519D046F02F5A5DD6D760C2A842356E067B7BD94338D1FAA3B3DDD48 1244 13060A207B0A097067007E45B052B60FDBAE4656E11562C4F5ABB7B0CF87A79D2 1245 21F1127313C53371CE1245D63DB45A1203A23340BA08042C768D03B8076A028D3 1246 A51D87D2EF107BBD6F2305CE5E67668724002FB726DF9C14476C37DE0F55033F1 1247 92A5AD21F9A2A71C20301000134B050300E0603551D0F0101F104030204C1D060 1248 3551D0E04160414112966E304761732FBFE6A2C823C301F0603551D2304183016 1249 5084D321CA0135E77217A486B686B334B00D06092A62067341010505000320410 1250 0B382BA3355A50E287BAE15758B3BEFF63D34D3E357B90031495D018868E49589 1251 B9FAF46A4AD49B1D35B06EF380106677440934663C2CC111C183655F4DC41C0B3 1252 401123D35387389DB91F1E1B4131B16C291D35730B3F9B33C7475124851555FE5 1253 FC647E8FD029605367C7E01281BF6617110021B0D10847DCE0E9F0CA6C764B633 1254 4784055172C3983D1E3A3A82301A54FCC9B0670C543A1C747164619101FF23B24 1255 0B2A26394C1F7D38D0E2F4747928ECE5C34627A075A8B3122011E9D9158055C28 1256 F020C330206BC20102020102300D06092A6206734101050500301B31193017060 1257 355040313106573744578616D706C654341204E774E301E170D31333035303930 1258 33353333325A170D3134303530393033353333325A301B3119301706035504031 1259 3106573744578616D706C654341204F774E302062300D06092A62067341010105 1260 0003204F0030204A022041003A923A2968BAE4AAE136CA4E2512C520068035848 1261 2AC39D6F640E4574E654EA35F48B1E054C5DA3372872F7A1E429F4EDF3958432E 1262 FB2106591D3EB783C1034709F251FC86566BDA2D541C792389EAC4EC9E181F4B9 1263 F596E5EF2679CC321542B11337F90A44DF3C85F1516561FA968A1914F265BC0B8 1264 276EBE3106A790D97D34C8C37C74FE1C30B396424664AC426284A9F6022E02693 1265 8436880ADFCD95C98CA1DFC2E6D75319B85D0458DE28A9D13FB16D620FFF7541F 1266 6A25D7DAF004355020301000134B050300E0603551D0F0101F104030204C1D060 1267 3551D0E04160414084D321CA0135E77217A486B686B334B01F0603551D2304183 1268 01653112966E304761732FBFE6A2C823C300D06092A6206734101050500032041 1269 002E106933A443070ACF5594A3A584D08AF7E06C295059370A06639EFF9BD418D 1270 13BC25A298223164A6CF1856B11A81617282E4A410D82EF086839C6E235690322 1271 763065455351E4C596ACC7C016B225DEC094706C2A10608F403B10821984C7C15 1272 2343B18A768C2AD30238DC45DD653EE6092B0D5CD4C2F7D236043269357F76D13 1273 F95FB5F00D0E19263C6833948E1BA612CE8197AF650E25D882C12F4B6B9B67252 1274 C608EF064ACA3F9BC867D71172349D510BB7651CD43883773D927DEB41C467302 1275 0BB302063C201020209009B9DDA3324700D06092A6206734101050500301B3119 1276 3017060355040313106573744578616D706C654341204E774E301E170D3133303 1277 530393033353333325A170D3134303530393033353333325A301B311930170603 1278 55040313106573744578616D706C654341204E774E302062300D06092A6206734 1279 10101050003204F0030204A02204100EF6B677A3247C1FC03D2B9BAF113E5E7E1 1280 1F49E0421120E6B8384160F2BF02630EF544D5FD0D5623B35713C79A7229283A7 1281 908751A634AA420A3E2A4B1F10519D046F02F5A5DD6D760C2A842356E067B7BD9 1282 4338D1FAA3B3DDD4813060A207B0A097067007E45B052B60FDBAE4656E11562C4 1283 F5ABB7B0CF87A79D221F1127313C53371CE1245D63DB45A1203A23340BA08042C 1284 768D03B8076A028D3A51D87D2EF107BBD6F2305CE5E67668724002FB726DF9C14 1285 476C37DE0F55033F192A5AD21F9A2A71C20301000130B040300F0603551D13010 1286 1F10530030101FC1D0603551D0E04160414112966E304761732FBFE6A2C823C30 1287 0E0603551D0F0101F10403020106300D06092A620673410105050003204100423 1288 F06D4B760F4B42744A279035571696F272A0060F1325A40898509601AD14004F6 1289 52DB6312A1475C4D7CD50F4B269035585D7856C5337765A66B38462D5BDAA7778 1290 AAB24BBE2815E37722CD10E7166C50E75AB75A1271324460211991E7445A2960F 1291 47351A1A62925334119794B90E320BC730D6C1BEE496E7AC125CE9A1ECA595A3A 1292 4C54A865E6B623C9247BFD0A7C19B56077392555C955E233642BEC643AE37C166 1293 C5E221D797AEA3748F0391C8D692A5CF9BB71F6D0E37984D6FA673A30D0C00634 1294 3116F58403100 1296 After reception of the 2.05 response, the client can forget the 1297 observe. 1299 A.2. csrattrs 1301 In the following valid /csrattrs exchange, the EST-coaps client 1302 authenticates itself with a certificate issued by the connected CA. 1304 The initial DTLS handshake is identical to the enrollment example. 1305 The IPv6 CoAP GET request looks like: 1307 REQ: 1308 GET coaps://[2001:db8::2:1]:61616/est/att 1309 (Content-Format: TBD6)(observe =0)(Max-Age =1) 1311 A 2.05 Content response contains attributes which are relevant for 1312 the authenticated client. In this example, the EST-coaps server 1313 returns two attributes that the client can ignore when they are 1314 unknown to him. 1316 A.3. enroll / reenroll 1318 During the Enroll/Reenroll exchange, the EST-coaps client uses a CSR 1319 (Content-Format TBD7) request in the POST request payload. 1321 After verification of the CSR by the server, a 2.05 Content response 1322 with the issued certificate will be returned to the client. As 1323 described in Section 4.4, if the server is not able to provide a 1324 response, then it ACKs the GET (with no payload), and the payload 1325 will be sent later as part of the OBSERVE processing. 1327 [EDNOTE: When redoing this example, given that proof of possession 1328 (POP) is also used, make sure it is obvious that the 1329 ChallengePassword attribute in the CSR is valid HMAC output. HMAC- 1330 REAL.] 1331 POST [2001:db8::2:1]:61616/est/sen 1332 (token 0x45) 1333 (Content-Format: TBD7)(observe 0) 1334 h'30208530206d020100301f311d301b0603550403131464656d6f7374657034203 1335 1333638313431333532302062300d06092a620673410101050003204f0030204a 1336 022041005d9f4dffd3c5949f646a9584367778560950b355c35b8e34726dd3764 1337 54231734795b4c09b9c6d75d408311307a81f7adef7f5d241f7d5be85620c5d44 1338 38bbb4242cf215c167f2ccf36c364ea2618a62f0536576369d6304e6a96877224 1339 7d86824f079faac7a6f694cfda5b84c42087dc062d462190c525813f210a036a7 1340 37b4f30d8891f4b75559fb72752453146332d51c937557716ccec624f5125c3a4 1341 447ad3115020048113fef54ad554ee88af09a2583aac9024075113db4990b1786 1342 b871691e0f02030100018701f06092a620673410907311213102b72724369722f 1343 372b45597535305434300d06092a620673410105050003204100441b40177a3a6 1344 5501487735a8ad5d3827a4eaa867013920e2afcda87aa81733c7c0353be47e1bf 1345 a7cda5176e7ccc6be22ae03498588d5f2de3b143f2b1a6175ec544e8e7625af6b 1346 836fd4416894c2e55ea99c6606f69075d6d53475d410729aa6d806afbb9986caf 1347 7b844b5b3e4545f19071865ada007060cad6db26a592d4a7bda7d586b68110962 1348 17071103407553155cddc75481e272b5ed553a8593fb7e25100a6f7605085dab4 1349 fc7e0731f0e7fe305703791362d5157e92e6b5c2e3edbcadb40' 1351 RET: 1352 (Content-Format: TBD2)(token =0x45)(observe =12) 1353 2.01 Created 1354 h'3020f806092a62067341070283293020e50201013100300b06092a62067341070 1355 1830b3020c730206fc20102020115300d06092a6206734101050500301b311930 1356 17060355040313106573744578616d706c654341204e774e301e170d313330353 1357 0393233313535335a170d3134303530393233313535335a301f311d301b060355 1358 0403131464656d6f73746570342031333638313431333532302062300d06092a6 1359 20673410101050003204f0030204a022041005d9f4dffd3c5949f646a95843677 1360 78560950b355c35b8e34726dd376454231734795b4c09b9c6d75d408311307a81 1361 f7adef7f5d241f7d5be85620c5d4438bbb4242cf215c167f2ccf36c364ea2618a 1362 62f0536576369d6304e6a968772247d86824f079faac7a6f694cfda5b84c42087 1363 dc062d462190c525813f210a036a737b4f30d8891f4b75559fb72752453146332 1364 d51c937557716ccec624f5125c3a4447ad3115020048113fef54ad554ee88af09 1365 a2583aac9024075113db4990b1786b871691e0f020301000134b050300e060355 1366 1d0f0101f104030204c1d0603551d0e04160414e81d0788aa2710304c5ecd4d1e 1367 065701f0603551d230418301653112966e304761732fbfe6a2c823c300d06092a 1368 6206734101050500032041002910d86f2ffeeb914c046816871de601567d291b4 1369 3fabee0f0e8ff81cea27302a7133e20e9d04029866a8963c7d14e26fbe8a0ab1b 1370 77fbb1214bbcdc906fbc381137ec1de685f79406c3e416b8d82f97174bc691637 1371 5a4e1c4bf744c7572b4b2c6bade9fb35da786392ee0d95e3970542565f3886ad6 1372 7746d1b12484bb02616e63302dc371dc6006e431fb7c457598dd204b367b0b3d3 1373 258760a303f1102db26327f929b7c5a60173e1799491b69150248756026b80553 1374 171e4733ad3d13c0103100' 1376 After reception of the 2.01 response the client can forget the 1377 observe registration 1378 The same example when delays occur (omitting the payloads in the 1379 examples) has a different behavior. The response to the POST is an 1380 empty payload with response code 2.01 (Created) that also returns the 1381 resource to query. The client issues a GET with an observe and a new 1382 token value, and waits for the notification after possibly receiving 1383 an empty payload first. 1385 POST [2001:db8::2:1]:61616/est/sen 1386 (token 0x45)(observe = 0) 1387 (Content-Format: TBD7)(Max-Age=120) 1388 [payload] 1389 RET: 1390 (token =0x45)(observe =12)(Location-Path=/est/1245) 1391 2.01 Created 1392 [empty payload] 1394 GET [2001:db8::2:1]:61616/est/1245 1395 (token 0x53) 1396 (observe =0)(Max-Age=120) 1398 RET: 1399 (token =0x53)(observe = 5) 1400 2.01 Created 1401 [empty payload] 1403 RET: 1404 (token =0x53)(observe = 6) 1405 (Content-Format: TBD2) 1406 2.04 Changed 1407 [payload] 1409 A.4. serverkeygen 1411 During this valid /serverkeygen exchange, the EST-coaps client 1412 authenticates itself using the certificate provided by the connected 1413 CA. 1415 The initial DTLS handshake is identical to the enrollment example. 1416 The CoAP GET request looks like: 1418 [EDNOTE: same comment as HMAC-REAL above applies.] 1420 [EDNOTE: Suggestion to have only one example with complete encrypted 1421 payload (the short one) and point out the different fields. Update 1422 this example according to the agreed upon solution from Section 4.5. 1423 ] 1424 POST coaps://192.0.2.1:8085/est/skg 1425 (token 0xa5)(observe = 0) 1426 (Content-Format: TBD7)(Max-Age=120) 1428 h'302081302069020100305b313e303c060355040313357365727665724b6579476 1429 56e2072657120627920636c69656e7420696e2064656d6f207374657020313220 1430 3133363831343139353531193017060355040513105049443a576964676574205 1431 34e3a3130302062300d06092a620673410101050003204f0030204a02204100f4 1432 dfa6c03f7f2766b23776c333d2c0f9d1a7a6ee36d01499bbe6f075d1e38a57e98 1433 ecc197f51b75228454b7f19652332de5e52e4a974c6ae34e1df80b33f15f47d3b 1434 cbf76116bb0e4d3e04a9651218a476a13fc186c2a255e4065ff7c271cff104e47 1435 31fad53c22b21a1e5138bf9ad0187314ac39445949a48805392390e78c7659621 1436 6d3e61327a534f5ea7721d2b1343c7362b37da502717cfc2475653c7a3860c5f4 1437 0612a5db6d33794d755264b6327e3a3263b149628585b85e57e42f6b3277591b0 1438 2030100018701f06092a6206734109073112131064467341586d4a6e6a6f6b427 1439 4447672300d06092a620673410105050003204100472d11007e5a2b2c2023d47a 1440 6d71d046c307701d8ebc9e47272713378390b4ee321462a3dbe54579f5a514f6f 1441 4050af497f428189b63655d03a194ef729f101743e5d03fbc6ae1e84486d1300a 1442 f9288724381909188c851fa9a5059802eb64449f2a3c9e441353d136768da27ff 1443 4f277651d676a6a7e51931b08f56135a2230891fd184960e1313e7a1a9139ed19 1444 28196867079a456cd2266cb754a45151b7b1b939e381be333fea61580fe5d25bf 1445 4823dbd2d6a98445b46305c10637e202856611' 1447 RET: 1448 2.01 Content (Content-Format: TBD8) 1449 (observe = 5)(token=0xa5) 1451 [TBD5, 1452 h'30213e020100300d06092a6206734101010500042128302124020100022041003 1453 c0bc2748f2003e3e8ea15f746f2a71e83f585412b92cf6f8e64de02e056153274 1454 dd01c95dd9cff3112aa141774ab655c3d56359c3b3df055294692ed848e7e30a1 1455 1bf14e47e0693d93017022b4cdb3e6d40325356152b213c8b535851e681a7074c 1456 0c6d2b60e7c32fc0336b28e743eba4e5921074d47195d3c05e43c527526e692d5 1457 45e562578d2d4b5f2191bff89d3eef0222764a2674637a1f99257216647df6704 1458 efec5adbf54dab24231844eb595875795000e673dd6862310a146ad7e31083010 1459 001022041004e6b3f78b7791d6377f33117c17844531c81111fb8000282816264 1460 915565bc7c3f3f643b537a2c69140a31c22550fa97e5132c61b74166b68626704 1461 260620333050f510096b6570f5880e7e1c15dc0ca6ce2b5f187e2325da14ab705 1462 ad004717f3b2f779127b5c535e0cee6a343b502722f2397a26126e0af606b5aa7 1463 f96313511c0b7eb26354f91b82269de62757e3def807a6afdf83ddcbb0614bb7c 1464 542e6975d6456554e7bd9988fbd1930cd44d0e01ee9182ca54539418653150254 1465 1ad1a2a11e5021040bfce554b642c29131e7d65455e83c5406d76771912f758f5 1466 ee3ee36af386f38ffa313c0f661880c5a2b0970485d36f528e7f77a2e55b4ad76 1467 1242d1c2f75939c8061217d31491d305d3e07d6161c43e26f7de4477b1811de92 1468 33dc75b426302104015bf48ac376f52887813461fc54635517bcb67293837053e 1469 8ce1a33da7a35565a75a370dc14555b5316cb55742380350774d769d151ff0456 1470 0214389a232a2258326163167504cfce44cd316f63bb8a52da53a4cb74fd87194 1471 c0844881f791f23b0813ea0921325edd14459d41c8a1593f04316388e40b35fef 1472 7d2a195a5930fa54774427ac821eee2c62790d2c17bd192af794c611011506557 1473 83d4efe22185cbd83368786f2b1e68a5a27067e321066f0217b4b6d7971a3c21a 1474 241366b7907187583b511102103369047e5cce0b65012200df5ec697b5827575c 1475 db6821ff299d6a69574b31ddf0fbe9245ea2f74396c24b3a7565067e41366423b 1476 5bdd2b2a78194094dbe333f493d159b8e07722f2280d48388db7f1c9f0633bb0e 1477 173de2c3aa1f200af535411c7090210401421e2ea217e37312dcc606f453a6634 1478 f3df4dc31a9e910614406412e70eec9247f10672a500947a64356c015a845a7d1 1479 50e2e3911a2b3b61070a73247166da10bb45474cc97d1ec2bc392524307f35118 1480 f917438f607f18181684376e13a39e07', 1481 TBD2, 1482 h'3020c506092a62067341070283363020f20201013100300b06092a62067341070 1483 183183020d430207cc20102020116300d06092a6206734101050500301b311930 1484 17060355040313106573744578616d706c654341204e774e301e170d313330353 1485 0393233323535365a170d3134303530393233323535365a302c312a3028060355 1486 0403132173657276657273696465206b65792067656e657261746564207265737 1487 06f6e7365302062300d06092a620673410101050003204f0030204a022041003c 1488 0bc2748f2003e3e8ea15f746f2a71e83f585412b92cf6f8e64de02e056153274d 1489 d01c95dd9cff3112aa141774ab655c3d56359c3b3df055294692ed848e7e30a11 1490 bf14e47e0693d93017022b4cdb3e6d40325356152b213c8b535851e681a7074c0 1491 c6d2b60e7c32fc0336b28e743eba4e5921074d47195d3c05e43c527526e692d54 1492 5e562578d2d4b5f2191bff89d3eef0222764a2674637a1f99257216647df6704e 1493 fec5adbf54dab24231844eb595875795000e673dd6862310a146ad7e310830100 1494 0134b050300e0603551d0f0101f104030204c1d0603551d0e04160414764b1bd5 1495 e69935626e476b195a1a8c1f0603551d230418301653112966e304761732fbfe6 1496 a2c823c300d06092a620673410105050003204100474e5100a9cdaaa813b30f48 1497 40340fb17e7d6d6063064a5a7f2162301c464b5a8176623dfb1a4a484e618de1c 1498 3c3c5927cf590f4541233ff3c251e772a9a3f2c5fc6e5ef2fe155e5e385deb846 1499 b36eb4c3c7ef713f2d137ae8be4c022715fd033a818d55250f4e6077718180755 1500 a4fa677130da60818175ca4ab2af1d15563624c51e13dfdcf381881b72327e2f4 1501 9b7467e631a27b5b5c7d542bd2edaf78c0ac294f3972278996bdf673a334ff74c 1502 84aa7d65726310252f6a4f41281ec10ca2243864e3c5743103100'] 1504 Without the DecryptKeyIdentifier attribute, the response has no 1505 additional encryption beyond DTLS. 1507 The response contains first a preamble that can be ignored. The EST- 1508 coaps server can use the preamble to include additional explanations, 1509 like ownership or support information 1511 Appendix B. EST-coaps Block message examples 1513 Two examples are presented: (1) a cacerts exchange shows the use of 1514 Block2 and the block headers, and (2) a enroll exchange shows the 1515 Block1 and Block2 size negotiation for request and response payloads. 1517 B.1. cacerts block example 1519 This section provides a detailed example of the messages using DTLS 1520 and BLOCK option Block2. The minimum PMTU is 1280 bytes, which is 1521 the example value assumed for the DTLS datagram size. The example 1522 block length is taken as 64 which gives an SZX value of 2. 1524 The following is an example of a valid /cacerts exchange over DTLS. 1525 The content length of the cacerts response in appendix A.1 of 1526 [RFC7030] is 4246 bytes using base64. This leads to a length of 2509 1527 bytes in binary. The CoAP message adds around 10 bytes, the DTLS 1528 record 29 bytes. To avoid IP fragmentation, the CoAP block option is 1529 used and an MTU of 127 is assumed to stay within one IEEE 802.15.4 1530 packet. To stay below the MTU of 127, the payload is split in 39 1531 packets with a payload of 64 bytes each, followed by a packet of 13 1532 bytes. The client sends an IPv6 packet containing the UDP datagram 1533 with the DTLS record that encapsulates the CoAP Request 40 times. 1534 The server returns an IPv6 packet containing the UDP datagram with 1535 the DTLS record that encapsulates the CoAP response. The CoAP 1536 request-response exchange with block option is shown below. Block 1537 option is shown in a decomposed way (block-option:NUM/M/size) 1538 indicating the kind of Block option (2 in this case because used in 1539 the response) followed by a colon, and then the block number (NUM), 1540 the more bit (M = 0 in lock2 response means last block), and block 1541 size with exponent (2**(SZX+4)) separated by slashes. The Length 64 1542 is used with SZX= 2 to avoid IP fragmentation. The CoAP Request is 1543 sent with confirmable (CON) option and the content format of the 1544 Response is /application/cacerts. 1546 GET /192.0.2.1:8085/est/crts (2:0/0/64) --> 1547 <-- (2:0/1/64) 2.05 Content 1548 GET /192.0.2.1:8085/est/crts (2:1/0/64) --> 1549 <-- (2:1/1/64) 2.05 Content 1550 | 1551 | 1552 | 1553 GET /192.0.2.1:8085/est/crts (2:39/0/64) --> 1554 <-- (2:39/0/64) 2.05 Content 1556 40 blocks have been sent with partially filled block NUM=39 as last 1557 block. 1559 For further detailing the CoAP headers, the first two blocks are 1560 written out. 1562 The header of the first GET looks like: 1564 Ver = 1 1565 T = 0 (CON) 1566 Code = 0x01 (0.1 GET) 1567 Token = 0x9a (client generated) 1568 Options 1569 Option1 (Uri-Host) [optional] 1570 Option Delta = 0x3 (option nr = 3) 1571 Option Length = 0x9 1572 Option Value = 192.0.2.1 1573 Option2 (Observe) 1574 Option Delta = 0x3 (option nr = 3+3=6) 1575 Option Length = 0x1 1576 Option Value = 0 (register) 1577 Option3 (Uri-Port) [optional] 1578 Option Delta = 0x4 (option nr = 3+4=7) 1579 Option Length = 0x4 1580 Option Value = 8085 1581 Option4 (Uri-Path) 1582 Option Delta = 0x4 (option nr = 7+4=11) 1583 Option Length = 0x5 1584 Option Value = "est" 1585 Option5 (Uri-Path) 1586 Option Delta = 0x0 (option nr = 11+0=11) 1587 Option Length = 0x6 1588 Option Value = "crts" 1589 Option6 (Max-Age) 1590 Option Delta = 0x3 (option nr = 11+3=14) 1591 Option Length = 0x1 1592 Option Value = 0x1 ( 1 minute) 1593 Payload = [Empty] 1595 The header of the first response looks like: 1597 Ver = 1 1598 T = 2 (ACK) 1599 Code = 0x45 (2.05 Content) 1600 Token = 0x9a (copied by server) 1601 Options 1602 Option1 (Observe) 1603 Option Delta = 0x6 (option nr=6) 1604 Option Length = 0x1 1605 Option Value = 12 (12 > 0) 1606 Option2 (Content-Format) 1607 Option Delta = 0xC (option nr =6+6=12) 1608 Option Length = 0x2 1609 Option Value = TBD2 1610 Option2 (Block2) 1611 Option Delta = 0xB (option 23 = 12 + 11) 1612 Option Length = 0x1 1613 Option Value = 0x0A (block number = 0, M=1, SZX=2) 1614 Payload = 1615 h'30233906092a6206734107028c2a3023260201013100300b06092a6206734107018 1616 c0c3020bb302063c20102020900a61e75193b7acc0d06092a6206734101' 1618 The second Block2: 1620 Ver = 1 1621 T = 2 (means ACK) 1622 Code = 0x45 (2.05 Content) 1623 Token = 0x9a (copied by server) 1624 Options 1625 Option1 (Observe) 1626 Option Delta = 0x6 (option nr=6) 1627 Option Length = 0x1 1628 Option Value = 16 (16 > 12) 1629 Option2 (Content-Format) 1630 Option Delta = 0xC (option nr =6+6=12) 1631 Option Length = 0x2 1632 Option Value = TBD2 1633 Option2 (Block2) 1634 Option Delta = 0xB (option 23 = 12 + 11) 1635 Option Length = 0x1 1636 Option Value = 0x1A (block number = 1, M=1, SZX=2) 1637 Payload = 1638 h'05050030 1639 1b31193017060355040313106573744578616d706c654341204f774f301e170d313 1640 3303530393033353333315a170d3134303530393033353333315a' 1642 The 40th and final Block2: 1644 Ver = 1 1645 T = 2 (means ACK) 1646 Code = 0x45 (2.05 Content) 1647 Token = 0x9a (copied by server) 1648 Options 1649 Option1 (Observe) 1650 Option Delta = 0x6 (option nr=6) 1651 Option Length = 0x1 1652 Option Value = 55 (55 > 12) 1653 Option2 (Content-Format) 1654 Option Delta = 0xC (option nr =6+6=12) 1655 Option Length = 0x2 1656 Option Value = TBD2 1657 Option2 (Block2) 1658 Option Delta = 0xB (option 23 = 12 + 11) 1659 Option Length = 0x2 1660 Option Value = 0x272 (block number = 39, M=0, SZX=2) 1661 Payload = h'73a30d0c006343116f58403100' 1663 B.2. enroll block example 1665 In this example the requested block2 size of 256 bytes, required by 1666 the client, is transferred to the server in the very first request 1667 message. The request/response consists of two parts: part1 1668 containing the CSR transferred to the server, and part2 contains the 1669 certificate transferred back to the client. The block size 1670 256=(2**(SZX+4)) which gives SZX=4. The notation for block numbering 1671 is the same as in Appendix B.1. It is assumed that CSR takes N1+1 1672 blocks and Cert response takes N2+1 blocks. The header fields and 1673 the payload are omitted to show the block exchange. The type of 1674 payload is shown within curly brackets. 1676 POST [2001:db8::2:1]:61616/est/sen (CON)(1:0/1/256) {CSR req} --> 1677 <-- (ACK) (1:0/1/256) (2.31 Continue) 1678 POST [2001:db8::2:1]:61616/est/sen (CON)(1:1/1/256) {CSR req} --> 1679 <-- (ACK) (1:1/1/256) (2.31 Continue) 1680 . 1681 . 1682 . 1683 POST [2001:db8::2:1]:61616/est/sen (CON)(1:N1/0/256){CSR req} --> 1684 <-- (ACK) (1:N1/0/256) (2:0/1/256) (2.04 Changed)(Cert resp} 1685 POST [2001:db8::2:1]:61616/est/sen (CON)(2:1/0/256) --> 1686 <-- (ACK) (2:1/1/256) (2.04 Changed) (Cert resp} 1687 . 1688 . 1689 . 1690 POST [2001:db8::2:1]:61616/est/sen (CON)(2:N2/0/256) --> 1691 <-- (ACK) (2:N2/0/256) (2.04 Changed) (Cert resp} 1693 N1+1 blocks have been transferred from client to server and N2+1 1694 blocks have been transferred from server to client. 1696 Authors' Addresses 1698 Peter van der Stok 1699 Consultant 1701 Email: consultancy@vanderstok.org 1703 Panos Kampanakis 1704 Cisco Systems 1706 Email: pkampana@cisco.com 1708 Sandeep S. Kumar 1709 Philips Lighting Research 1710 High Tech Campus 7 1711 Eindhoven 5656 AE 1712 NL 1714 Email: ietf@sandeep.de 1715 Michael C. Richardson 1716 Sandelman Software Works 1718 Email: mcr+ietf@sandelman.ca 1719 URI: http://www.sandelman.ca/ 1721 Martin Furuhed 1722 Nexus Group 1724 Email: martin.furuhed@nexusgroup.com 1726 Shahid Raza 1727 RISE SICS 1728 Isafjordsgatan 22 1729 Kista, Stockholm 16440 1730 SE 1732 Email: shahid@sics.se