idnits 2.17.1 draft-ietf-lake-edhoc-13.txt: -(3): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(2672): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(2695): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding 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: ---------------------------------------------------------------------------- == There are 9 instances of lines with non-ascii characters in the document. 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 (18 April 2022) is 738 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) -- Looks like a reference, but probably isn't: '5' on line 1843 -- Looks like a reference, but probably isn't: '6' on line 1843 -- Looks like a reference, but probably isn't: '9' on line 1839 -- Looks like a reference, but probably isn't: '8' on line 1843 -- Looks like a reference, but probably isn't: '7' on line 1843 ** Downref: Normative reference to an Informational draft: draft-ietf-cose-rfc8152bis-algs (ref. 'I-D.ietf-cose-rfc8152bis-algs') -- Possible downref: Normative reference to a draft: ref. 'I-D.ietf-cose-rfc8152bis-struct' == Outdated reference: A later version (-09) exists of draft-ietf-cose-x509-08 ** Downref: Normative reference to an Informational RFC: RFC 5869 ** Downref: Normative reference to an Informational RFC: RFC 6090 ** Downref: Normative reference to an Informational RFC: RFC 6979 ** Downref: Normative reference to an Informational RFC: RFC 7624 ** Downref: Normative reference to an Informational RFC: RFC 7748 ** Downref: Normative reference to an Informational RFC: RFC 8376 == Outdated reference: A later version (-11) exists of draft-ietf-core-oscore-edhoc-03 == Outdated reference: A later version (-09) exists of draft-ietf-cose-cbor-encoded-cert-03 == Outdated reference: A later version (-07) exists of draft-ietf-lwig-security-protocol-comparison-05 == Outdated reference: A later version (-05) exists of draft-selander-ace-ake-authz-04 Summary: 7 errors (**), 0 flaws (~~), 7 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group G. Selander 3 Internet-Draft J. Preuß Mattsson 4 Intended status: Standards Track F. Palombini 5 Expires: 20 October 2022 Ericsson 6 18 April 2022 8 Ephemeral Diffie-Hellman Over COSE (EDHOC) 9 draft-ietf-lake-edhoc-13 11 Abstract 13 This document specifies Ephemeral Diffie-Hellman Over COSE (EDHOC), a 14 very compact and lightweight authenticated Diffie-Hellman key 15 exchange with ephemeral keys. EDHOC provides mutual authentication, 16 forward secrecy, and identity protection. EDHOC is intended for 17 usage in constrained scenarios and a main use case is to establish an 18 OSCORE security context. By reusing COSE for cryptography, CBOR for 19 encoding, and CoAP for transport, the additional code size can be 20 kept very low. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on 20 October 2022. 39 Copyright Notice 41 Copyright (c) 2022 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 46 license-info) in effect on the date of publication of this document. 47 Please review these documents carefully, as they describe your rights 48 and restrictions with respect to this document. Code Components 49 extracted from this document must include Revised BSD License text as 50 described in Section 4.e of the Trust Legal Provisions and are 51 provided without warranty as described in the Revised BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 56 1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 3 57 1.2. Use of EDHOC . . . . . . . . . . . . . . . . . . . . . . 5 58 1.3. Message Size Examples . . . . . . . . . . . . . . . . . . 5 59 1.4. Document Structure . . . . . . . . . . . . . . . . . . . 6 60 1.5. Terminology and Requirements Language . . . . . . . . . . 6 61 2. EDHOC Outline . . . . . . . . . . . . . . . . . . . . . . . . 7 62 3. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 8 63 3.1. General . . . . . . . . . . . . . . . . . . . . . . . . . 9 64 3.2. Method . . . . . . . . . . . . . . . . . . . . . . . . . 10 65 3.3. Connection Identifiers . . . . . . . . . . . . . . . . . 10 66 3.4. Transport . . . . . . . . . . . . . . . . . . . . . . . . 11 67 3.5. Authentication Parameters . . . . . . . . . . . . . . . . 12 68 3.6. Cipher Suites . . . . . . . . . . . . . . . . . . . . . . 18 69 3.7. Ephemeral Public Keys . . . . . . . . . . . . . . . . . . 19 70 3.8. External Authorization Data (EAD) . . . . . . . . . . . . 20 71 3.9. Applicability Statement . . . . . . . . . . . . . . . . . 21 72 4. Key Derivation . . . . . . . . . . . . . . . . . . . . . . . 22 73 4.1. Extract . . . . . . . . . . . . . . . . . . . . . . . . . 23 74 4.2. Expand . . . . . . . . . . . . . . . . . . . . . . . . . 24 75 4.3. EDHOC-Exporter . . . . . . . . . . . . . . . . . . . . . 25 76 4.4. EDHOC-KeyUpdate . . . . . . . . . . . . . . . . . . . . . 26 77 5. Message Formatting and Processing . . . . . . . . . . . . . . 26 78 5.1. Message Processing Outline . . . . . . . . . . . . . . . 27 79 5.2. EDHOC Message 1 . . . . . . . . . . . . . . . . . . . . . 28 80 5.3. EDHOC Message 2 . . . . . . . . . . . . . . . . . . . . . 29 81 5.4. EDHOC Message 3 . . . . . . . . . . . . . . . . . . . . . 32 82 5.5. EDHOC Message 4 . . . . . . . . . . . . . . . . . . . . . 35 83 6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 37 84 6.1. Success . . . . . . . . . . . . . . . . . . . . . . . . . 38 85 6.2. Unspecified . . . . . . . . . . . . . . . . . . . . . . . 38 86 6.3. Wrong Selected Cipher Suite . . . . . . . . . . . . . . . 38 87 7. Mandatory-to-Implement Compliance Requirements . . . . . . . 41 88 8. Security Considerations . . . . . . . . . . . . . . . . . . . 42 89 8.1. Security Properties . . . . . . . . . . . . . . . . . . . 42 90 8.2. Cryptographic Considerations . . . . . . . . . . . . . . 44 91 8.3. Cipher Suites and Cryptographic Algorithms . . . . . . . 45 92 8.4. Post-Quantum Considerations . . . . . . . . . . . . . . . 46 93 8.5. Unprotected Data . . . . . . . . . . . . . . . . . . . . 46 94 8.6. Denial-of-Service . . . . . . . . . . . . . . . . . . . . 47 95 8.7. Implementation Considerations . . . . . . . . . . . . . . 47 96 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 49 97 9.1. EDHOC Exporter Label Registry . . . . . . . . . . . . . . 49 98 9.2. EDHOC Cipher Suites Registry . . . . . . . . . . . . . . 49 99 9.3. EDHOC Method Type Registry . . . . . . . . . . . . . . . 51 100 9.4. EDHOC Error Codes Registry . . . . . . . . . . . . . . . 51 101 9.5. EDHOC External Authorization Data Registry . . . . . . . 52 102 9.6. COSE Header Parameters Registry . . . . . . . . . . . . . 52 103 9.7. COSE Header Parameters Registry . . . . . . . . . . . . . 52 104 9.8. COSE Key Common Parameters Registry . . . . . . . . . . . 53 105 9.9. CWT Confirmation Methods Registry . . . . . . . . . . . . 53 106 9.10. The Well-Known URI Registry . . . . . . . . . . . . . . . 53 107 9.11. Media Types Registry . . . . . . . . . . . . . . . . . . 54 108 9.12. CoAP Content-Formats Registry . . . . . . . . . . . . . . 55 109 9.13. Resource Type (rt=) Link Target Attribute Values 110 Registry . . . . . . . . . . . . . . . . . . . . . . . . 55 111 9.14. Expert Review Instructions . . . . . . . . . . . . . . . 55 112 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 56 113 10.1. Normative References . . . . . . . . . . . . . . . . . . 56 114 10.2. Informative References . . . . . . . . . . . . . . . . . 59 115 Appendix A. Use with OSCORE and Transfer over CoAP . . . . . . . 61 116 A.1. Selecting EDHOC Connection Identifier . . . . . . . . . . 62 117 A.2. Deriving the OSCORE Security Context . . . . . . . . . . 62 118 A.3. Transferring EDHOC over CoAP . . . . . . . . . . . . . . 64 119 Appendix B. Compact Representation . . . . . . . . . . . . . . . 67 120 Appendix C. Use of CBOR, CDDL and COSE in EDHOC . . . . . . . . 67 121 C.1. CBOR and CDDL . . . . . . . . . . . . . . . . . . . . . . 68 122 C.2. CDDL Definitions . . . . . . . . . . . . . . . . . . . . 69 123 C.3. COSE . . . . . . . . . . . . . . . . . . . . . . . . . . 70 124 Appendix D. Applicability Template . . . . . . . . . . . . . . . 72 125 Appendix E. EDHOC Message Deduplication . . . . . . . . . . . . 73 126 Appendix F. Transports Not Natively Providing Correlation . . . 74 127 Appendix G. Change Log . . . . . . . . . . . . . . . . . . . . . 74 128 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 79 129 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 80 131 1. Introduction 133 1.1. Motivation 135 Many Internet of Things (IoT) deployments require technologies which 136 are highly performant in constrained environments [RFC7228]. IoT 137 devices may be constrained in various ways, including memory, 138 storage, processing capacity, and power. The connectivity for these 139 settings may also exhibit constraints such as unreliable and lossy 140 channels, highly restricted bandwidth, and dynamic topology. The 141 IETF has acknowledged this problem by standardizing a range of 142 lightweight protocols and enablers designed for the IoT, including 143 the Constrained Application Protocol (CoAP, [RFC7252]), Concise 144 Binary Object Representation (CBOR, [RFC8949]), and Static Context 145 Header Compression (SCHC, [RFC8724]). 147 The need for special protocols targeting constrained IoT deployments 148 extends also to the security domain [I-D.ietf-lake-reqs]. Important 149 characteristics in constrained environments are the number of round 150 trips and protocol message sizes, which if kept low can contribute to 151 good performance by enabling transport over a small number of radio 152 frames, reducing latency due to fragmentation or duty cycles, etc. 153 Another important criteria is code size, which may be prohibitive for 154 certain deployments due to device capabilities or network load during 155 firmware update. Some IoT deployments also need to support a variety 156 of underlying transport technologies, potentially even with a single 157 connection. 159 Some security solutions for such settings exist already. CBOR Object 160 Signing and Encryption (COSE, [I-D.ietf-cose-rfc8152bis-struct]) 161 specifies basic application-layer security services efficiently 162 encoded in CBOR. Another example is Object Security for Constrained 163 RESTful Environments (OSCORE, [RFC8613]) which is a lightweight 164 communication security extension to CoAP using CBOR and COSE. In 165 order to establish good quality cryptographic keys for security 166 protocols such as COSE and OSCORE, the two endpoints may run an 167 authenticated Diffie-Hellman key exchange protocol, from which shared 168 secret key material can be derived. Such a key exchange protocol 169 should also be lightweight; to prevent bad performance in case of 170 repeated use, e.g., due to device rebooting or frequent rekeying for 171 security reasons; or to avoid latencies in a network formation 172 setting with many devices authenticating at the same time. 174 This document specifies Ephemeral Diffie-Hellman Over COSE (EDHOC), a 175 lightweight authenticated key exchange protocol providing good 176 security properties including forward secrecy, identity protection, 177 and cipher suite negotiation. Authentication can be based on raw 178 public keys (RPK) or public key certificates and requires the 179 application to provide input on how to verify that endpoints are 180 trusted. This specification focuses on referencing instead of 181 transporting credentials to reduce message overhead. EDHOC does 182 currently not support pre-shared key (PSK) authentication as 183 authentication with static Diffie-Hellman public keys by reference 184 produces equally small message sizes but with much simpler key 185 distribution and identity protection. 187 EDHOC makes use of known protocol constructions, such as SIGMA 188 [SIGMA] and Extract-and-Expand [RFC5869]. EDHOC uses COSE for 189 cryptography and identification of credentials (including COSE_Key, 190 CWT, CCS, X.509, C509, see Section 3.5.3). COSE provides crypto 191 agility and enables the use of future algorithms and credentials 192 targeting IoT. 194 1.2. Use of EDHOC 196 EDHOC is designed for highly constrained settings making it 197 especially suitable for low-power wide area networks [RFC8376] such 198 as Cellular IoT, 6TiSCH, and LoRaWAN. A main objective for EDHOC is 199 to be a lightweight authenticated key exchange for OSCORE, i.e., to 200 provide authentication and session key establishment for IoT use 201 cases such as those built on CoAP [RFC7252]. CoAP is a specialized 202 web transfer protocol for use with constrained nodes and networks, 203 providing a request/response interaction model between application 204 endpoints. As such, EDHOC is targeting a large variety of use cases 205 involving 'things' with embedded microcontrollers, sensors, and 206 actuators. 208 A typical setting is when one of the endpoints is constrained or in a 209 constrained network, and the other endpoint is a node on the Internet 210 (such as a mobile phone) or at the edge of the constrained network 211 (such as a gateway). Thing-to-thing interactions over constrained 212 networks are also relevant since both endpoints would then benefit 213 from the lightweight properties of the protocol. EDHOC could e.g., 214 be run when a device connects for the first time, or to establish 215 fresh keys which are not revealed by a later compromise of the long- 216 term keys. Further security properties are described in Section 8.1. 218 EDHOC enables the reuse of the same lightweight primitives as OSCORE: 219 CBOR for encoding, COSE for cryptography, and CoAP for transport. By 220 reusing existing libraries, the additional code size can be kept very 221 low. Note that, while CBOR and COSE primitives are built into the 222 protocol messages, EDHOC is not bound to a particular transport. 223 Transfer of EDHOC messages in CoAP payloads is detailed in 224 Appendix A.3. 226 1.3. Message Size Examples 228 Compared to the DTLS 1.3 handshake [I-D.ietf-tls-dtls13] with ECDHE 229 and connection ID, the number of bytes in EDHOC + CoAP can be less 230 than 1/6 when RPK authentication is used, see 231 [I-D.ietf-lwig-security-protocol-comparison]. Figure 1 shows 232 examples of message sizes for EDHOC with different kinds of 233 authentication keys and different COSE header parameters for 234 identification: static Diffie-Hellman keys or signature keys, either 235 in CBOR Web Token (CWT) / CWT Claims Set (CCS) [RFC8392] identified 236 by a key identifier using 'kid' [I-D.ietf-cose-rfc8152bis-struct], or 237 in X.509 certificates identified by a hash value using 'x5t' 238 [I-D.ietf-cose-x509]. 240 ======================================================== 241 Static DH Keys Signature Keys 242 -------------- -------------- 243 kid x5t kid x5t 244 -------------------------------------------------------- 245 message_1 37 37 37 37 246 message_2 45 58 102 115 247 message_3 19 33 77 90 248 -------------------------------------------------------- 249 Total 101 128 216 242 250 ======================================================== 252 Figure 1: Example of message sizes in bytes. 254 1.4. Document Structure 256 The remainder of the document is organized as follows: Section 2 257 outlines EDHOC authenticated with digital signatures, Section 3 258 describes the protocol elements of EDHOC, including formatting of the 259 ephemeral public keys, Section 4 specifies the key derivation, 260 Section 5 specifies message processing for EDHOC authenticated with 261 signature keys or static Diffie-Hellman keys, Section 6 describes the 262 error messages, and Appendix A shows how to transfer EDHOC with CoAP 263 and establish an OSCORE security context. 265 1.5. Terminology and Requirements Language 267 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 268 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 269 "OPTIONAL" in this document are to be interpreted as described in BCP 270 14 [RFC2119] [RFC8174] when, and only when, they appear in all 271 capitals, as shown here. 273 Readers are expected to be familiar with the terms and concepts 274 described in CBOR [RFC8949], CBOR Sequences [RFC8742], COSE 275 structures and processing [I-D.ietf-cose-rfc8152bis-struct], COSE 276 algorithms [I-D.ietf-cose-rfc8152bis-algs], CWT and CWT Claims Set 277 [RFC8392], and CDDL [RFC8610]. The Concise Data Definition Language 278 (CDDL) is used to express CBOR data structures [RFC8949]. Examples 279 of CBOR and CDDL are provided in Appendix C.1. When referring to 280 CBOR, this specification always refers to Deterministically Encoded 281 CBOR as specified in Sections 4.2.1 and 4.2.2 of [RFC8949]. The 282 single output from authenticated encryption (including the 283 authentication tag) is called "ciphertext", following [RFC5116]. 285 2. EDHOC Outline 287 EDHOC specifies different authentication methods of the Diffie- 288 Hellman key exchange: digital signatures and static Diffie-Hellman 289 keys. This section outlines the digital signature-based method. 290 Further details of protocol elements and other authentication methods 291 are provided in the remainder of this document. 293 SIGMA (SIGn-and-MAc) is a family of theoretical protocols with a 294 large number of variants [SIGMA]. Like IKEv2 [RFC7296] and (D)TLS 295 1.3 [RFC8446], EDHOC authenticated with digital signatures is built 296 on a variant of the SIGMA protocol which provides identity protection 297 of the initiator (SIGMA-I) against active attackers, and like IKEv2 298 [RFC7296], EDHOC implements the MAC-then-Sign variant of the SIGMA-I 299 protocol shown in Figure 2. 301 Initiator Responder 302 | G_X | 303 +------------------------------------------------------------------>| 304 | | 305 | G_Y, Enc( ID_CRED_R, Sig( R; MAC( CRED_R, G_X, G_Y ) ) ) | 306 |<------------------------------------------------------------------+ 307 | | 308 | AEAD( ID_CRED_I, Sig( I; MAC( CRED_I, G_Y, G_X ) ) ) | 309 +------------------------------------------------------------------>| 310 | | 312 Figure 2: MAC-then-Sign variant of the SIGMA-I protocol. 314 The parties exchanging messages are called Initiator (I) and 315 Responder (R). They exchange ephemeral public keys, compute a shared 316 secret, and derive symmetric application keys used to protect 317 application data. 319 * G_X and G_Y are the ECDH ephemeral public keys of I and R, 320 respectively. 322 * CRED_I and CRED_R are the credentials containing the public 323 authentication keys of I and R, respectively. 325 * ID_CRED_I and ID_CRED_R are credential identifiers enabling the 326 recipient party to retrieve the credential of I and R, 327 respectively. 329 * Sig(I; . ) and Sig(R; . ) denote signatures made with the private 330 authentication key of I and R, respectively. 332 * Enc(), AEAD(), and MAC() denotes encryption, authenticated 333 encryption with additional data, and message authentication code 334 using keys derived from the shared secret. 336 In order to create a "full-fledged" protocol some additional protocol 337 elements are needed. EDHOC adds: 339 * Transcript hashes (hashes of message data) TH_2, TH_3, TH_4 used 340 for key derivation and as additional authenticated data. 342 * Computationally independent keys derived from the ECDH shared 343 secret and used for authenticated encryption of different 344 messages. 346 * An optional fourth message giving explicit key confirmation to I 347 in deployments where no protected application data is sent from R 348 to I. 350 * A key material exporter and a key update function with forward 351 secrecy. 353 * Verification of a common preferred cipher suite. 355 * Method types and error handling. 357 * Selection of connection identifiers C_I and C_R which may be used 358 to identify established keys or protocol state. 360 * Transport of external authorization data. 362 EDHOC is designed to encrypt and integrity protect as much 363 information as possible, and all symmetric keys are derived using as 364 much previous information as possible. EDHOC is furthermore designed 365 to be as compact and lightweight as possible, in terms of message 366 sizes, processing, and the ability to reuse already existing CBOR, 367 COSE, and CoAP libraries. 369 To simplify for implementors, the use of CBOR and COSE in EDHOC is 370 summarized in Appendix C. Test vectors including CBOR diagnostic 371 notation are provided in [I-D.selander-lake-traces]. 373 3. Protocol Elements 374 3.1. General 376 The EDHOC protocol consists of three mandatory messages (message_1, 377 message_2, message_3) between Initiator and Responder, an optional 378 fourth message (message_4), and an error message. All EDHOC messages 379 are CBOR Sequences [RFC8742]. Figure 3 illustrates an EDHOC message 380 flow with the optional fourth message as well as the content of each 381 message. The protocol elements in the figure are introduced in 382 Section 3 and Section 5. Message formatting and processing is 383 specified in Section 5 and Section 6. 385 Application data may be protected using the agreed application 386 algorithms (AEAD, hash) in the selected cipher suite (see 387 Section 3.6) and the application can make use of the established 388 connection identifiers C_I and C_R (see Section 3.3). EDHOC may be 389 used with the media type application/edhoc defined in Section 9. 391 The Initiator can derive symmetric application keys after creating 392 EDHOC message_3, see Section 4.3. Protected application data can 393 therefore be sent in parallel or together with EDHOC message_3. 394 EDHOC message_4 is typically not sent. 396 Initiator Responder 397 | METHOD, SUITES_I, G_X, C_I, EAD_1 | 398 +------------------------------------------------------------------>| 399 | message_1 | 400 | | 401 | G_Y, Enc( ID_CRED_R, Signature_or_MAC_2, EAD_2 ), C_R | 402 |<------------------------------------------------------------------+ 403 | message_2 | 404 | | 405 | AEAD( ID_CRED_I, Signature_or_MAC_3, EAD_3 ) | 406 +------------------------------------------------------------------>| 407 | message_3 | 408 | | 409 | AEAD( EAD_4 ) | 410 |<- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 411 | message_4 | 413 Figure 3: EDHOC Message Flow with the Optional Fourth Message 415 3.2. Method 417 The data item METHOD in message_1 (see Section 5.2.1), is an integer 418 specifying the authentication method. EDHOC supports authentication 419 with signature or static Diffie-Hellman keys, as defined in the four 420 authentication methods: 0, 1, 2, and 3, see Figure 4. When using a 421 static Diffie-Hellman key the authentication is provided by a Message 422 Authentication Code (MAC) computed from an ephemeral-static ECDH 423 shared secret which enables significant reductions in message sizes. 425 The Initiator and the Responder need to have agreed on a single 426 method to be used for EDHOC, see Section 3.9. 428 +-------+-------------------+-------------------+-------------------+ 429 | Value | Initiator | Responder | Reference | 430 +-------+-------------------+-------------------+-------------------+ 431 | 0 | Signature Key | Signature Key | [[this document]] | 432 | 1 | Signature Key | Static DH Key | [[this document]] | 433 | 2 | Static DH Key | Signature Key | [[this document]] | 434 | 3 | Static DH Key | Static DH Key | [[this document]] | 435 +-------+-------------------+-------------------+-------------------+ 437 Figure 4: Method Types 439 3.3. Connection Identifiers 441 EDHOC includes the selection of connection identifiers (C_I, C_R) 442 identifying a connection for which keys are agreed. 444 Connection identifiers may be used to correlate EDHOC messages and 445 facilitate the retrieval of protocol state during EDHOC protocol 446 execution (see Section 3.4) or in a subsequent application protocol, 447 e.g., OSCORE (see Section 3.3.2). The connection identifiers do not 448 have any cryptographic purpose in EDHOC. 450 Connection identifiers in EDHOC are byte strings or integers, encoded 451 in CBOR. One byte connection identifiers (the integers -24 to 23 and 452 the empty CBOR byte string h'') are realistic in many scenarios as 453 most constrained devices only have a few connections. 455 3.3.1. Selection of Connection Identifiers 457 C_I and C_R are chosen by I and R, respectively. The Initiator 458 selects C_I and sends it in message_1 for the Responder to use as a 459 reference to the connection in communications with the Initiator. 460 The Responder selects C_R and sends in message_2 for the Initiator to 461 use as a reference to the connection in communications with the 462 Responder. 464 If connection identifiers are used by an application protocol for 465 which EDHOC establishes keys then the selected connection identifiers 466 SHALL adhere to the requirements for that protocol, see Section 3.3.2 467 for an example. 469 3.3.2. Use of Connection Identifiers with OSCORE 471 For OSCORE, the choice of a connection identifier results in the 472 endpoint selecting its Recipient ID, see Section 3.1 of [RFC8613], 473 for which certain uniqueness requirements apply, see Section 3.3 of 474 [RFC8613]. Therefore, the Initiator and the Responder MUST NOT 475 select connection identifiers such that it results in same OSCORE 476 Recipient ID. Since the Recipient ID is a byte string and a EDHOC 477 connection identifier is either a CBOR byte string or a CBOR integer, 478 care must be taken when selecting the connection identifiers and 479 converting them to Recipient IDs. A mapping from EDHOC connection 480 identifier to OSCORE Recipient ID is specified in Appendix A.1. 482 3.4. Transport 484 Cryptographically, EDHOC does not put requirements on the lower 485 layers. EDHOC is not bound to a particular transport layer and can 486 even be used in environments without IP. The transport is 487 responsible, where necessary, to handle: 489 * message loss, 491 * message reordering, 493 * message duplication, 495 * fragmentation, 497 * demultiplex EDHOC messages from other types of messages, 499 * denial-of-service protection, 501 * message correlation. 503 The Initiator and the Responder need to have agreed on a transport to 504 be used for EDHOC, see Section 3.9. 506 3.4.1. Use of Connection Identifiers for EDHOC Message Correlation 508 The transport needs to support the correlation between EDHOC messages 509 and facilitate the retrieval of protocol state during EDHOC protocol 510 execution, including an indication of a message being message_1. The 511 correlation may reuse existing mechanisms in the transport protocol. 512 For example, the CoAP Token may be used to correlate EDHOC messages 513 in a CoAP response and an associated CoAP request. 515 Connection identifiers may be used to correlate EDHOC messages and 516 facilitate the retrieval of protocol state during EDHOC protocol 517 execution. EDHOC transports that do not inherently provide 518 correlation across all messages of an exchange can send connection 519 identifiers along with EDHOC messages to gain that required 520 capability, e.g., by prepending the appropriate connection identifier 521 (when available from the EDHOC protocol) to the EDHOC message. 522 Transport of EDHOC in CoAP payloads is described in Appendix A.3, 523 which also shows how to use connection identifiers and message_1 524 indication with CoAP. 526 3.5. Authentication Parameters 528 EDHOC supports various settings for how the other endpoint's 529 authentication (public) key is transported, identified, and trusted 530 as described in this section. 532 The authentication key (see Section 3.5.2) is used in several parts 533 of EDHOC: 535 1. as part of the authentication credential included in the 536 integrity calculation 538 2. for verification of the Signature_or_MAC field in message_2 and 539 message_3 (see Section 5.3.2 and Section 5.4.2) 541 3. in the key derivation (in case of a static Diffie-Hellman key, 542 see Section 4). 544 The authentication credential (CRED_x) contains, in addition to the 545 authentication key, also the authentication key algorithm and 546 optionally other parameters such as identity, key usage, expiry, 547 issuer, etc. (see Section 3.5.3). Identical authentication 548 credentials need to be established in both endpoints to be able to 549 verify integrity. For many settings it is not necessary to transport 550 the authentication credential within EDHOC over constrained links, 551 for example, it may be pre-provisioned or acquired out-of-band over 552 less constrained links. 554 EDHOC relies on COSE for identification of authentication credentials 555 (using ID_CRED_x, see Section 3.5.4) and supports all credential 556 types for which COSE header parameters are defined (see 557 Section 3.5.3). 559 The choice of authentication credential depends also on the trust 560 model (see Section 3.5.1). For example, a certificate or CWT may 561 rely on a trusted third party, whereas a CCS or a self-signed 562 certificate/CWT may be used when trust in the public key can be 563 achieved by other means, or in the case of trust-on-first-use. 565 The type of authentication key, authentication credential, and the 566 way to identify the credential have a large impact on the message 567 size. For example, the signature_or_MAC field is much smaller with a 568 static DH key than with a signature key. A CCS is much smaller than 569 a self-signed certificate/CWT, but if it is possible to reference the 570 credential with a COSE header like 'kid', then that is typically much 571 smaller than to transport a CCS. 573 3.5.1. Identities and trust anchors 575 Policies for what connections to allow are typically set based on the 576 identity of the other party, and parties typically only allow 577 connections from a specific identity or a small restricted set of 578 identities. For example, in the case of a device connecting to a 579 network, the network may only allow connections from devices which 580 authenticate with certificates having a particular range of serial 581 numbers and signed by a particular CA. On the other hand, the device 582 may only be allowed to connect to a network which authenticates with 583 a particular public key (information of which may be provisioned, 584 e.g., out of band or in the external authorization data, see 585 Section 3.8). The EDHOC implementation or the application must 586 enforce information about the intended endpoint, and in particular 587 whether it is a specific identity or a set of identities. Either 588 EDHOC passes information about identity to the application for a 589 decision, or EDHOC needs to have access to relevant information and 590 makes the decision on its own. 592 EDHOC assumes the existence of mechanisms (certification authority, 593 trusted third party, pre-provisioning, etc.) for specifying and 594 distributing authentication credentials. 596 * When a Public Key Infrastructure (PKI) is used with certificates, 597 the trust anchor is a Certification Authority (CA) certificate, 598 and the identity is the subject whose unique name (e.g., a domain 599 name, NAI, or EUI) is included in the endpoint's certificate. In 600 order to run EDHOC each party needs at least one CA public key 601 certificate, or just the public key, and a specific identity or 602 set of identities it is allowed to communicate with. Only 603 validated public-key certificates with an allowed subject name, as 604 specified by the application, are to be accepted. EDHOC provides 605 proof that the other party possesses the private authentication 606 key corresponding to the public authentication key in its 607 certificate. The certification path provides proof that the 608 subject of the certificate owns the public key in the certificate. 610 * Similarly, when a PKI is used with CWTs, each party needs to have 611 a trusted third party public key as trust anchor to verify the 612 end-entity CWTs, and a specific identity or set of identities in 613 the 'sub' (subject) claim of the CWT to determine if it is allowed 614 to communicate with. The trusted third party public key can, 615 e.g., be stored in a self-signed CWT or in a CCS. 617 * When PKI is not used (CCS, self-signed certificate/CWT), the trust 618 anchor is the authentication key of the other party. In this 619 case, the identity is typically directly associated to the 620 authentication key of the other party. For example, the name of 621 the subject may be a canonical representation of the public key. 622 Alternatively, if identities can be expressed in the form of 623 unique subject names assigned to public keys, then a binding to 624 identity can be achieved by including both public key and 625 associated subject name in the protocol message computation: 626 CRED_I or CRED_R may be a self-signed certificate/CWT or CCS 627 containing the authentication key and the subject name, see 628 Section 3.5.3. In order to run EDHOC, each endpoint needs a 629 specific authentication key/unique associated subject name, or a 630 set of public authentication keys/unique associated subject names, 631 which it is allowed to communicate with. EDHOC provides the proof 632 that the other party possesses the private authentication key 633 corresponding to the public authentication key. 635 To prevent misbinding attacks in systems where an attacker can 636 register public keys without proving knowledge of the private key, 637 SIGMA [SIGMA] enforces a MAC to be calculated over the "identity". 638 EDHOC follows SIGMA by calculating a MAC over the whole credential, 639 which in case of an X.509 or C509 certificate includes the "subject" 640 and "subjectAltName" fields, and in the case of CWT or CCS includes 641 the "sub" claim. While the SIGMA paper only focuses on the identity, 642 the same principle is true for other information such as policies 643 associated to the public key. 645 3.5.2. Authentication Keys 647 The authentication key (i.e. the public key used for authentication) 648 MUST be a signature key or static Diffie-Hellman key. The Initiator 649 and the Responder MAY use different types of authentication keys, 650 e.g., one uses a signature key and the other uses a static Diffie- 651 Hellman key. The authentication key algorithm needs to be compatible 652 with the method and the cipher suite. The authentication key 653 algorithm needs to be compatible with the EDHOC key exchange 654 algorithm when static Diffie-Hellman authentication is used, and 655 compatible with the EDHOC signature algorithm when signature 656 authentication is used. 658 Note that for most signature algorithms, the signature is determined 659 by the signature algorithm and the authentication key algorithm 660 together. When using static Diffie-Hellman keys the Initiator's and 661 Responder's private authentication keys are called I and R, 662 respectively, and the public authentication keys are called G_I and 663 G_R, respectively. 665 For X.509 the authentication key is represented with a 666 SubjectPublicKeyInfo field. For CWT and CCS, the authentication key 667 is represented with a 'cnf' claim [RFC8747] containing a COSE_Key 668 [I-D.ietf-cose-rfc8152bis-struct]. 670 3.5.3. Authentication Credentials 672 The authentication credentials, CRED_I and CRED_R, contain the public 673 authentication key of the Initiator and the Responder, respectively. 675 EDHOC relies on COSE for identification of authentication credentials 676 (see Section 3.5.4) and supports all credential types for which COSE 677 header parameters are defined including X.509 [RFC5280], C509 678 [I-D.ietf-cose-cbor-encoded-cert], CWT [RFC8392] and CWT Claims Set 679 (CCS) [RFC8392]. When the identified credential is a chain or bag, 680 CRED_x is just the end-entity X.509 or C509 certificate / CWT. In 681 X.509 and C509 certificates, signature keys typically have key usage 682 "digitalSignature" and Diffie-Hellman public keys typically have key 683 usage "keyAgreement". 685 CRED_x needs to be defined such that it is identical when used by 686 Initiator or Responder. The Initiator and Responder are expected to 687 agree on a specific encoding of the credential, see Section 3.9. It 688 is RECOMMENDED that the COSE 'kid' parameter, when used, refers to a 689 specific encoding. The Initiator and Responder SHOULD use an 690 available authentication credential (transported in EDHOC or 691 otherwise provisioned) without re-encoding. If for some reason re- 692 encoding of the authentication credential may occur, then a potential 693 common encoding for CBOR based credentials is bytewise lexicographic 694 order of their deterministic encodings as specified in Section 4.2.1 695 of [RFC8949]. 697 * When the authentication credential is an X.509 certificate, CRED_x 698 SHALL be the end-entity DER encoded certificate, encoded as a bstr 699 [I-D.ietf-cose-x509]. 701 * When the authentication credential is a C509 certificate, CRED_x 702 SHALL be the end-entity C509Certificate 703 [I-D.ietf-cose-cbor-encoded-cert] 705 * When the authentication credential is a COSE_Key in a CWT, CRED_x 706 SHALL be the untagged CWT. 708 * When the authentication credential is a COSE_Key but not in a CWT, 709 CRED_x SHALL be an untagged CCS. 711 - Naked COSE_Keys are thus dressed as CCS when used in EDHOC, 712 which is done by prefixing the COSE_Key with 0xA108A101. 714 An example of a CRED_x is shown below: 716 { /CCS/ 717 2 : "42-50-31-FF-EF-37-32-39", /sub/ 718 8 : { /cnf/ 719 1 : { /COSE_Key/ 720 1 : 1, /kty/ 721 2 : 0, /kid/ 722 -1 : 4, /crv/ 723 -2 : h'b1a3e89460e88d3a8d54211dc95f0b90 /x/ 724 3ff205eb71912d6db8f4af980d2db83a' 725 } 726 } 727 } 729 Figure 5: A CCS Containing an X25519 Static Diffie-Hellman Key 730 and an EUI-64 Identity. 732 3.5.4. Identification of Credentials 734 ID_CRED_R and ID_CRED_I are transported in message_2 and message_3, 735 respectively (see Section 5.3.2 and Section 5.4.2). They are used to 736 identify and optionally transport the authentication keys of the 737 Initiator and the Responder, respectively. ID_CRED_I and ID_CRED_R 738 do not have any cryptographic purpose in EDHOC since EDHOC integrity 739 protects the authentication credential. EDHOC relies on COSE for 740 identification of authentication credentials and supports all types 741 of COSE header parameters used to identify authentication credentials 742 including X.509, C509, CWT and CCS. 744 * ID_CRED_R is intended to facilitate for the Initiator to retrieve 745 the Responder's authentication key. 747 * ID_CRED_I is intended to facilitate for the Responder to retrieve 748 the Initiator's authentication key. 750 ID_CRED_I and ID_CRED_R are COSE header maps and contains one or more 751 COSE header parameter. ID_CRED_I and ID_CRED_R MAY contain different 752 header parameters. The header parameters typically provide some 753 information about the format of authentication credential. 755 Note that COSE header parameters in ID_CRED_x are used to identify 756 the sender's authentication credential. There is therefore no reason 757 to use the "-sender" header parameters, such as x5t-sender, defined 758 in Section 3 of [I-D.ietf-cose-x509]. Instead, the corresponding 759 parameter without "-sender", such as x5t, SHOULD be used. 761 Example: X.509 certificates can be identified by a hash value using 762 the 'x5t' parameter: 764 * ID_CRED_x = { 34 : COSE_CertHash }, for x = I or R, 766 Example: CWT or CCS can be identified by a key identifier using the 767 'kid' parameter: 769 * ID_CRED_x = { 4 : key_id_x }, where key_id_x : kid, for x = I or 770 R. 772 Note that 'kid' is extended to support int values to allow more one- 773 byte identifiers (see Section 9.7 and Section 9.8) which may be 774 useful in many scenarios since constrained devices only have a few 775 keys. As stated in Section 3.1 of [I-D.ietf-cose-rfc8152bis-struct], 776 applications MUST NOT assume that 'kid' values are unique and several 777 keys associated with a 'kid' may need to be checked before the 778 correct one is found. Applications might use additional information 779 such as 'kid context' or lower layers to determine which key to try 780 first. Applications should strive to make ID_CRED_x as unique as 781 possible, since the recipient may otherwise have to try several keys. 783 See Appendix C.3 for more examples. 785 3.6. Cipher Suites 787 An EDHOC cipher suite consists of an ordered set of algorithms from 788 the "COSE Algorithms" and "COSE Elliptic Curves" registries as well 789 as the EDHOC MAC length. Algorithms need to be specified with enough 790 parameters to make them completely determined. EDHOC is currently 791 only specified for use with key exchange algorithms of type ECDH 792 curves, but any Key Encapsulation Method (KEM), including Post- 793 Quantum Cryptography (PQC) KEMs, can be used in method 0, see 794 Section 8.4. Use of other types of key exchange algorithms to 795 replace static DH authentication (method 1,2,3) would likely require 796 a specification updating EDHOC with new methods. 798 EDHOC supports all signature algorithms defined by COSE, including 799 PQC signature algorithms such as HSS-LMS. Just like in TLS 1.3 800 [RFC8446] and IKEv2 [RFC7296], a signature in COSE is determined by 801 the signature algorithm and the authentication key algorithm 802 together, see Section 3.5.2. The exact details of the authentication 803 key algorithm depend on the type of authentication credential. COSE 804 supports different formats for storing the public authentication keys 805 including COSE_Key and X.509, which have different names and ways to 806 represent the authentication key and the authentication key 807 algorithm. 809 An EDHOC cipher suite consists of the following parameters: 811 * EDHOC AEAD algorithm 813 * EDHOC hash algorithm 815 * EDHOC MAC length in bytes (Static DH) 817 * EDHOC key exchange algorithm (ECDH curve) 819 * EDHOC signature algorithm 821 * Application AEAD algorithm 823 * Application hash algorithm 825 Each cipher suite is identified with a pre-defined int label. 827 EDHOC can be used with all algorithms and curves defined for COSE. 828 Implementation can either use any combination of COSE algorithms and 829 parameters to define their own private cipher suite, or use one of 830 the pre-defined cipher suites. Private cipher suites can be 831 identified with any of the four values -24, -23, -22, -21. The pre- 832 defined cipher suites are listed in the IANA registry (Section 9.2) 833 with initial content outlined here: 835 * Cipher suites 0-3, based on AES-CCM, are intended for constrained 836 IoT where message overhead is a very important factor. Note that 837 AES-CCM-16-64-128 and AES-CCM-16-64-128 are compatible with the 838 IEEE CCM* mode. 840 - Cipher suites 1 and 3 use a larger tag length (128-bit) in 841 EDHOC than in the Application AEAD algorithm (64-bit). 843 * Cipher suites 4 and 5, based on ChaCha20, are intended for less 844 constrained applications and only use 128-bit tag lengths. 846 * Cipher suite 6, based on AES-GCM, is for general non-constrained 847 applications. It uses high performance algorithms that are widely 848 supported. 850 * Cipher suites 24 and 25 are intended for high security 851 applications such as government use and financial applications. 852 These cipher suites do not share any algorithms. Cipher suite 24 853 is compatible with the CNSA suite [CNSA]. 855 The different methods (Section 3.2) use the same cipher suites, but 856 some algorithms are not used in some methods. The EDHOC signature 857 algorithm is not used in methods without signature authentication. 859 The Initiator needs to have a list of cipher suites it supports in 860 order of preference. The Responder needs to have a list of cipher 861 suites it supports. SUITES_I contains cipher suites supported by the 862 Initiator, formatted and processed as detailed in Section 5.2.1 to 863 secure the cipher suite negotiation. Examples of cipher suite 864 negotiation are given in Section 6.3.2. 866 3.7. Ephemeral Public Keys 868 EDHOC always uses compact representation of elliptic curve points, 869 see Appendix B. In COSE compact representation is achieved by 870 formatting the ECDH ephemeral public keys as COSE_Keys of type EC2 or 871 OKP according to Sections 7.1 and 7.2 of 872 [I-D.ietf-cose-rfc8152bis-algs], but only including the 'x' parameter 873 in G_X and G_Y. For Elliptic Curve Keys of type EC2, compact 874 representation MAY be used also in the COSE_Key. If the COSE 875 implementation requires an 'y' parameter, the value y = false SHALL 876 be used. COSE always use compact output for Elliptic Curve Keys of 877 type EC2. 879 3.8. External Authorization Data (EAD) 881 In order to reduce round trips and number of messages or to simplify 882 processing, external security applications may be integrated into 883 EDHOC by transporting authorization related data in the messages. 884 One example is third-party identity and authorization information 885 protected out of scope of EDHOC [I-D.selander-ace-ake-authz]. 886 Another example is a certificate enrolment request or the resulting 887 issued certificate. 889 EDHOC allows opaque external authorization data (EAD) to be sent in 890 the EDHOC messages. External authorization data sent in message_1 891 (EAD_1) or message_2 (EAD_2) should be considered unprotected by 892 EDHOC, see Section 8.5. External authorization data sent in 893 message_3 (EAD_3) or message_4 (EAD_4) is protected between Initiator 894 and Responder. 896 External authorization data is a CBOR sequence (see Appendix C.1) 897 consisting of one or more (ead_label, ead_value) pairs as defined 898 below: 900 ead = 1* ( 901 ead_label : int, 902 ead_value : any, 903 ) 905 Applications using external authorization data need to specify 906 format, processing, and security considerations and register the 907 (ead_label, ead_value) pair, see Section 9.5. The CDDL type of 908 ead_value is determined by the int ead_label and MUST be specified. 910 The EAD fields of EDHOC are not intended for generic application 911 data. Since data carried in EAD_1 and EAD_2 fields may not be 912 protected, special considerations need to be made such that it does 913 not violate security and privacy requirements of the service which 914 uses this data. Moreover, the content in an EAD field may impact the 915 security properties provided by EDHOC. Security applications making 916 use of the EAD fields must perform the necessary security analysis. 918 3.9. Applicability Statement 920 EDHOC requires certain parameters to be agreed upon between Initiator 921 and Responder. Some parameters can be agreed through the protocol 922 execution (specifically cipher suite negotiation, see Section 3.6) 923 but other parameters may need to be known out-of-band (e.g., which 924 authentication method is used, see Section 3.2). 926 The purpose of the applicability statement is to describe the 927 intended use of EDHOC to allow for the relevant processing and 928 verifications to be made, including things like: 930 1. How the endpoint detects that an EDHOC message is received. This 931 includes how EDHOC messages are transported, for example in the 932 payload of a CoAP message with a certain Uri-Path or Content- 933 Format; see Appendix A.3. 935 * The method of transporting EDHOC messages may also describe 936 data carried along with the messages that are needed for the 937 transport to satisfy the requirements of Section 3.4, e.g., 938 connection identifiers used with certain messages, see 939 Appendix A.3. 941 2. Authentication method (METHOD; see Section 3.2). 943 3. Profile for authentication credentials (CRED_I, CRED_R; see 944 Section 3.5.3), e.g., profile for certificate or CCS, including 945 supported authentication key algorithms (subject public key 946 algorithm in X.509 or C509 certificate). 948 4. Type used to identify authentication credentials (ID_CRED_I, 949 ID_CRED_R; see Section 3.5.4). 951 5. Use and type of external authorization data (EAD_1, EAD_2, EAD_3, 952 EAD_4; see Section 3.8). 954 6. Identifier used as identity of endpoint; see Section 3.5.1. 956 7. If message_4 shall be sent/expected, and if not, how to ensure a 957 protected application message is sent from the Responder to the 958 Initiator; see Section 5.5. 960 The applicability statement may also contain information about 961 supported cipher suites. The procedure for selecting and verifying 962 cipher suite is still performed as described in Section 5.2.1 and 963 Section 6.3, but it may become simplified by this knowledge. 965 An example of an applicability statement is shown in Appendix D. 967 For some parameters, like METHOD, ID_CRED_x, type of EAD, the 968 receiver is able to verify compliance with applicability statement, 969 and if it needs to fail because of incompliance, to infer the reason 970 why the protocol failed. 972 For other parameters, like CRED_x in the case that it is not 973 transported, it may not be possible to verify that incompliance with 974 applicability statement was the reason for failure: Integrity 975 verification in message_2 or message_3 may fail not only because of 976 wrong authentication credential. For example, in case the Initiator 977 uses public key certificate by reference (i.e., not transported 978 within the protocol) then both endpoints need to use an identical 979 data structure as CRED_I or else the integrity verification will 980 fail. 982 Note that it is not necessary for the endpoints to specify a single 983 transport for the EDHOC messages. For example, a mix of CoAP and 984 HTTP may be used along the path, and this may still allow correlation 985 between messages. 987 The applicability statement may be dependent on the identity of the 988 other endpoint, or other information carried in an EDHOC message, but 989 it then applies only to the later phases of the protocol when such 990 information is known. (The Initiator does not know identity of 991 Responder before having verified message_2, and the Responder does 992 not know identity of the Initiator before having verified message_3.) 994 Other conditions may be part of the applicability statement, such as 995 target application or use (if there is more than one application/use) 996 to the extent that EDHOC can distinguish between them. In case 997 multiple applicability statements are used, the receiver needs to be 998 able to determine which is applicable for a given session, for 999 example based on URI or external authorization data type. 1001 4. Key Derivation 1003 EDHOC uses Extract-and-Expand [RFC5869] with the EDHOC hash algorithm 1004 in the selected cipher suite to derive keys used in EDHOC and in the 1005 application. Extract is used to derive fixed-length uniformly 1006 pseudorandom keys (PRK) from ECDH shared secrets. Expand is used to 1007 derive additional output keying material (OKM) from the PRKs. 1009 This section defines Extract, Expand and other key derivation 1010 functions based on these: Expand is used to define EDHOC-KDF and in 1011 turn EDHOC-Exporter, whereas Extract is used to define EDHOC- 1012 KeyUpdate. 1014 4.1. Extract 1016 The pseudorandom keys (PRKs) are derived using Extract. 1018 PRK = Extract( salt, IKM ) 1020 where the input keying material (IKM) and salt are defined for each 1021 PRK below. 1023 The definition of Extract depends on the EDHOC hash algorithm of the 1024 selected cipher suite: 1026 * if the EDHOC hash algorithm is SHA-2, then Extract( salt, IKM ) = 1027 HKDF-Extract( salt, IKM ) [RFC5869] 1029 * if the EDHOC hash algorithm is SHAKE128, then Extract( salt, IKM ) 1030 = KMAC128( salt, IKM, 256, "" ) 1032 * if the EDHOC hash algorithm is SHAKE256, then Extract( salt, IKM ) 1033 = KMAC256( salt, IKM, 512, "" ) 1035 4.1.1. PRK_2e 1037 PRK_2e is used to derive a keystream to encrypt message_2. PRK_2e is 1038 derived with the following input: 1040 * The salt SHALL be a zero-length byte string. Note that [RFC5869] 1041 specifies that if the salt is not provided, it is set to a string 1042 of zeros (see Section 2.2 of [RFC5869]). For implementation 1043 purposes, not providing the salt is the same as setting the salt 1044 to the zero-length byte string (0x). 1046 * The IKM SHALL be the ephemeral-ephemeral ECDH shared secret G_XY 1047 (calculated from G_X and Y or G_Y and X) as defined in 1048 Section 6.3.1 of [I-D.ietf-cose-rfc8152bis-algs]. The use of G_XY 1049 gives forward secrecy, in the sense that compromise of the private 1050 authentication keys does not compromise past session keys. 1052 Example: Assuming the use of curve25519, the ECDH shared secret G_XY 1053 is the output of the X25519 function [RFC7748]: 1055 G_XY = X25519( Y, G_X ) = X25519( X, G_Y ) 1057 Example: Assuming the use of SHA-256 the extract phase of HKDF 1058 produces PRK_2e as follows: 1060 PRK_2e = HMAC-SHA-256( salt, G_XY ) 1062 where salt = 0x (zero-length byte string). 1064 4.1.2. PRK_3e2m 1066 PRK_3e2m is used to produce a MAC in message_2 and to encrypt 1067 message_3. PRK_3e2m is derived as follows: 1069 If the Responder authenticates with a static Diffie-Hellman key, then 1070 PRK_3e2m = Extract( PRK_2e, G_RX ), where G_RX is the ECDH shared 1071 secret calculated from G_R and X, or G_X and R, else PRK_3e2m = 1072 PRK_2e. 1074 4.1.3. PRK_4x3m 1076 PRK_4x3m is used to produce a MAC in message_3, to encrypt message_4, 1077 and to derive application specific data. PRK_4x3m is derived as 1078 follows: 1080 If the Initiator authenticates with a static Diffie-Hellman key, then 1081 PRK_4x3m = Extract( PRK_3e2m, G_IY ), where G_IY is the ECDH shared 1082 secret calculated from G_I and Y, or G_Y and I, else PRK_4x3m = 1083 PRK_3e2m. 1085 4.2. Expand 1087 The keys, IVs and MACs used in EDHOC are derived from the PRKs using 1088 Expand, and instantiated with the EDHOC AEAD algorithm in the 1089 selected cipher suite. 1091 OKM = EDHOC-KDF( PRK, transcript_hash, label, context, length ) 1092 = Expand( PRK, info, length ) 1094 where info is encoded as the CBOR sequence 1096 info = ( 1097 transcript_hash : bstr, 1098 label : tstr, 1099 context : bstr, 1100 length : uint, 1101 ) 1103 where 1105 * transcript_hash is a bstr set to one of the transcript hashes 1106 TH_2, TH_3, or TH_4 as defined in Sections 5.3.1, 5.4.1, and 4.3. 1108 * label is a tstr set to the name of the derived key, IV or MAC; 1109 i.e., "KEYSTREAM_2", "MAC_2", "K_3", "IV_3", or "MAC_3". 1111 * context is a bstr 1113 * length is the length of output keying material (OKM) in bytes 1115 The definition of Expand depends on the EDHOC hash algorithm of the 1116 selected cipher suite: 1118 * if the EDHOC hash algorithm is SHA-2, then Expand( PRK, info, 1119 length ) = HKDF-Expand( PRK, info, length ) [RFC5869] 1121 * if the EDHOC hash algorithm is SHAKE128, then Expand( PRK, info, 1122 length ) = KMAC128( PRK, info, L, "" ) 1124 * if the EDHOC hash algorithm is SHAKE256, then Expand( PRK, info, 1125 length ) = KMAC256( PRK, info, L, "" ) 1127 where L = 8*length, the output length in bits. 1129 The keys, IVs and MACs are derived as follows: 1131 * KEYSTREAM_2 is derived using the transcript hash TH_2 and the 1132 pseudorandom key PRK_2e. 1134 * MAC_2 is derived using the transcript hash TH_2 and the 1135 pseudorandom key PRK_3e2m. 1137 * K_3 and IV_3 are derived using the transcript hash TH_3 and the 1138 pseudorandom key PRK_3e2m. IVs are only used if the EDHOC AEAD 1139 algorithm uses IVs. 1141 * MAC_3 is derived using the transcript hash TH_3 and the 1142 pseudorandom key PRK_4x3m. 1144 KEYSTREAM_2, K_3, and IV_3 use an empty CBOR byte string h'' as 1145 context. MAC_2 and MAC_3 use context as defined in Section 5.3.2 and 1146 Section 5.4.2, respectively. 1148 4.3. EDHOC-Exporter 1150 Application keys and other application specific data can be derived 1151 using the EDHOC-Exporter interface defined as: 1153 EDHOC-Exporter(label, context, length) 1154 = EDHOC-KDF(PRK_4x3m, TH_4, label, context, length) 1156 where label is a registered tstr from the EDHOC Exporter Label 1157 registry (Section 9.1), context is a bstr defined by the application, 1158 and length is a uint defined by the application. The (label, 1159 context) pair must be unique, i.e., a (label, context) MUST NOT be 1160 used for two different purposes. However an application can re- 1161 derive the same key several times as long as it is done in a secure 1162 way. For example, in most encryption algorithms the same key kan be 1163 reused with different nonces. The context can for example be the 1164 empty (zero-length) sequence or a single CBOR byte string. 1166 The transcript hash TH_4 is a CBOR encoded bstr and the input to the 1167 hash function is a CBOR Sequence. 1169 TH_4 = H( TH_3, CIPHERTEXT_3 ) 1171 where H() is the hash function in the selected cipher suite. 1172 Examples of use of the EDHOC-Exporter are given in Section 5.5.2 and 1173 Appendix A. 1175 * K_4 and IV_4 are derived with the EDHOC-Exporter using the empty 1176 CBOR byte string h'' as context, and labels "EDHOC_K_4" and 1177 "EDHOC_IV_4", respectively. IVs are only used if the EDHOC AEAD 1178 algorithm uses IVs. 1180 4.4. EDHOC-KeyUpdate 1182 To provide forward secrecy in an even more efficient way than re- 1183 running EDHOC, EDHOC provides the function EDHOC-KeyUpdate. When 1184 EDHOC-KeyUpdate is called the old PRK_4x3m is deleted and the new 1185 PRK_4x3m is calculated as a "hash" of the old key using the Extract 1186 function as illustrated by the following pseudocode: 1188 EDHOC-KeyUpdate( nonce ): 1189 PRK_4x3m = Extract( nonce, PRK_4x3m ) 1191 The EDHOC-KeyUpdate takes a nonce as input to guarantee that there 1192 are no short cycles. The Initiator and the Responder need to agree 1193 on the nonce, which can e.g., be a counter or a random number. While 1194 the KeyUpdate method provides forward secrecy it does not give as 1195 strong security properties as re-running EDHOC, see Section 8. 1197 5. Message Formatting and Processing 1199 This section specifies formatting of the messages and processing 1200 steps. Error messages are specified in Section 6. Annotated traces 1201 of EDHOC protocol runs are provided in [I-D.selander-lake-traces]. 1203 An EDHOC message is encoded as a sequence of CBOR data items (CBOR 1204 Sequence, [RFC8742]). Additional optimizations are made to reduce 1205 message overhead. 1207 While EDHOC uses the COSE_Key, COSE_Sign1, and COSE_Encrypt0 1208 structures, only a subset of the parameters is included in the EDHOC 1209 messages, see Appendix C.3. The unprotected COSE header in 1210 COSE_Sign1, and COSE_Encrypt0 (not included in the EDHOC message) MAY 1211 contain parameters (e.g., 'alg'). 1213 5.1. Message Processing Outline 1215 This section outlines the message processing of EDHOC. 1217 For each new/ongoing session, the endpoints are assumed to keep an 1218 associated protocol state containing identifiers, keying material, 1219 etc. used for subsequent processing of protocol related data. The 1220 protocol state is assumed to be associated to an applicability 1221 statement (Section 3.9) which provides the context for how messages 1222 are transported, identified, and processed. 1224 EDHOC messages SHALL be processed according to the current protocol 1225 state. The following steps are expected to be performed at reception 1226 of an EDHOC message: 1228 1. Detect that an EDHOC message has been received, for example by 1229 means of port number, URI, or media type (Section 3.9). 1231 2. Retrieve the protocol state according to the message correlation 1232 provided by the transport, see Section 3.4. If there is no 1233 protocol state, in the case of message_1, a new protocol state is 1234 created. The Responder endpoint needs to make use of available 1235 Denial-of-Service mitigation (Section 8.6). 1237 3. If the message received is an error message, then process 1238 according to Section 6, else process as the expected next message 1239 according to the protocol state. 1241 If the processing fails for some reason then, typically, an error 1242 message is sent, the protocol is discontinued, and the protocol state 1243 erased. Further details are provided in the following subsections 1244 and in Section 6. 1246 Different instances of the same message MUST NOT be processed in one 1247 session. Note that processing will fail if the same message appears 1248 a second time for EDHOC processing because the state of the protocol 1249 has moved on and now expects something else. This assumes that 1250 message duplication due to re-transmissions is handled by the 1251 transport protocol, see Section 3.4. The case when the transport 1252 does not support message deduplication is addressed in Appendix E. 1254 5.2. EDHOC Message 1 1256 5.2.1. Formatting of Message 1 1258 message_1 SHALL be a CBOR Sequence (see Appendix C.1) as defined 1259 below 1261 message_1 = ( 1262 METHOD : int, 1263 SUITES_I : suites, 1264 G_X : bstr, 1265 C_I : bstr / int, 1266 ? EAD_1 : ead, 1267 ) 1269 suites = [ 2* int ] / int 1271 where: 1273 * METHOD - authentication method, see Section 3.2. 1275 * SUITES_I - array of cipher suites which the Initiator supports in 1276 order of preference, starting with the most preferred and ending 1277 with the cipher suite selected for this session. If the most 1278 preferred cipher suite is selected then SUITES_I is encoded as 1279 that cipher suite, i.e., as an int. The processing steps are 1280 detailed below and in Section 6.3. 1282 * G_X - the ephemeral public key of the Initiator 1284 * C_I - variable length connection identifier 1286 * EAD_1 - unprotected external authorization data, see Section 3.8. 1288 5.2.2. Initiator Processing of Message 1 1290 The Initiator SHALL compose message_1 as follows: 1292 * SUITES_I contains a list of supported cipher suites, in order of 1293 preference, truncated after the cipher suite selected for this 1294 session. 1296 - The Initiator MUST select its most preferred cipher suite, 1297 conditioned on what it can assume to be supported by the 1298 Responder. 1300 - The selected cipher suite MAY be changed between sessions, 1301 e.g., based on previous error messages (see next bullet), but 1302 all cipher suites which are more preferred than the selected 1303 cipher suite in the list MUST be included in SUITES_I. 1305 - If the Initiator previously received from the Responder an 1306 error message with error code 2 (see Section 6.3) indicating 1307 cipher suites supported by the Responder, then the Initiator 1308 SHOULD select the most preferred supported cipher suite among 1309 those (note that error messages are not authenticated and may 1310 be forged). 1312 - The supported cipher suites and the order of preference MUST 1313 NOT be changed based on previous error messages. 1315 * Generate an ephemeral ECDH key pair using the curve in the 1316 selected cipher suite and format it as a COSE_Key. Let G_X be the 1317 'x' parameter of the COSE_Key. 1319 * Choose a connection identifier C_I and store it for the length of 1320 the protocol. 1322 * Encode message_1 as a sequence of CBOR encoded data items as 1323 specified in Section 5.2.1 1325 5.2.3. Responder Processing of Message 1 1327 The Responder SHALL process message_1 as follows: 1329 * Decode message_1 (see Appendix C.1). 1331 * Verify that the selected cipher suite is supported and that no 1332 prior cipher suite in SUITES_I is supported. 1334 * Pass EAD_1 to the security application. 1336 If any processing step fails, the Responder SHOULD send an EDHOC 1337 error message back, formatted as defined in Section 6, and the 1338 session MUST be discontinued. Sending error messages is essential 1339 for debugging but MAY e.g., be skipped due to denial-of-service 1340 reasons, see Section 8.6. If an error message is sent, the session 1341 MUST be discontinued. 1343 5.3. EDHOC Message 2 1344 5.3.1. Formatting of Message 2 1346 message_2 SHALL be a CBOR Sequence (see Appendix C.1) as defined 1347 below 1349 message_2 = ( 1350 G_Y_CIPHERTEXT_2 : bstr, 1351 C_R : bstr / int, 1352 ) 1354 where: 1356 * G_Y_CIPHERTEXT_2 - the concatenation of G_Y, the ephemeral public 1357 key of the Responder, and CIPHERTEXT_2 1359 * C_R - variable length connection identifier 1361 5.3.2. Responder Processing of Message 2 1363 The Responder SHALL compose message_2 as follows: 1365 * Generate an ephemeral ECDH key pair using the curve in the 1366 selected cipher suite and format it as a COSE_Key. Let G_Y be the 1367 'x' parameter of the COSE_Key. 1369 * Choose a connection identifier C_R and store it for the length of 1370 the protocol. 1372 * Compute the transcript hash TH_2 = H( H(message_1), G_Y, C_R ) 1373 where H() is the hash function in the selected cipher suite. The 1374 transcript hash TH_2 is a CBOR encoded bstr and the input to the 1375 hash function is a CBOR Sequence. Note that H(message_1) can be 1376 computed and cached already in the processing of message_1. 1378 * Compute MAC_2 = EDHOC-KDF( PRK_3e2m, TH_2, "MAC_2", << ID_CRED_R, 1379 CRED_R, ? EAD_2 >>, mac_length_2 ). If the Responder 1380 authenticates with a static Diffie-Hellman key (method equals 1 or 1381 3), then mac_length_2 is the EDHOC MAC length given by the 1382 selected cipher suite. If the Responder authenticates with a 1383 signature key (method equals 0 or 2), then mac_length_2 is equal 1384 to the output size of the EDHOC hash algorithm given by the 1385 selected cipher suite. 1387 - ID_CRED_R - identifier to facilitate retrieval of CRED_R, see 1388 Section 3.5.4 1390 - CRED_R - CBOR item containing the credential of the Responder, 1391 see Section 3.5.3 1393 - EAD_2 - unprotected external authorization data, see 1394 Section 3.8 1396 * If the Responder authenticates with a static Diffie-Hellman key 1397 (method equals 1 or 3), then Signature_or_MAC_2 is MAC_2. If the 1398 Responder authenticates with a signature key (method equals 0 or 1399 2), then Signature_or_MAC_2 is the 'signature' field of a 1400 COSE_Sign1 object as defined in Section 4.4 of 1401 [I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm of 1402 the selected cipher suite, the private authentication key of the 1403 Responder, and the following parameters as input (see 1404 Appendix C.3): 1406 - protected = << ID_CRED_R >> 1408 - external_aad = << TH_2, CRED_R, ? EAD_2 >> 1410 - payload = MAC_2 1412 * CIPHERTEXT_2 is calculated by using the Expand function as a 1413 binary additive stream cipher. 1415 - plaintext = ( ID_CRED_R / bstr / int, Signature_or_MAC_2, ? 1416 EAD_2 ) 1418 o If ID_CRED_R contains a single 'kid' parameter, i.e., 1419 ID_CRED_R = { 4 : kid_R }, then only the byte string or 1420 integer kid_R is conveyed in the plaintext encoded 1421 accordingly as bstr or int. 1423 - Compute KEYSTREAM_2 = EDHOC-KDF( PRK_2e, TH_2, "KEYSTREAM_2", 1424 h'', plaintext_length ), where plaintext_length is the length 1425 of the plaintext. 1427 - CIPHERTEXT_2 = plaintext XOR KEYSTREAM_2 1429 * Encode message_2 as a sequence of CBOR encoded data items as 1430 specified in Section 5.3.1. 1432 5.3.3. Initiator Processing of Message 2 1434 The Initiator SHALL process message_2 as follows: 1436 * Decode message_2 (see Appendix C.1). 1438 * Retrieve the protocol state using the message correlation provided 1439 by the transport (e.g., the CoAP Token, the 5-tuple, or the 1440 prepended C_I, see Appendix A.3). 1442 * Decrypt CIPHERTEXT_2, see Section 5.3.2. 1444 * Pass EAD_2 to the security application. 1446 * Verify that the identity of the Responder is an allowed identity 1447 for this connection, see Section 3.5.1. 1449 * Verify Signature_or_MAC_2 using the algorithm in the selected 1450 cipher suite. The verification process depends on the method, see 1451 Section 5.3.2. 1453 If any processing step fails, the Initiator SHOULD send an EDHOC 1454 error message back, formatted as defined in Section 6. Sending error 1455 messages is essential for debugging but MAY e.g., be skipped if a 1456 session cannot be found or due to denial-of-service reasons, see 1457 Section 8.6. If an error message is sent, the session MUST be 1458 discontinued. 1460 5.4. EDHOC Message 3 1462 5.4.1. Formatting of Message 3 1464 message_3 SHALL be a CBOR Sequence (see Appendix C.1) as defined 1465 below 1467 message_3 = ( 1468 CIPHERTEXT_3 : bstr, 1469 ) 1471 5.4.2. Initiator Processing of Message 3 1473 The Initiator SHALL compose message_3 as follows: 1475 * Compute the transcript hash TH_3 = H(TH_2, CIPHERTEXT_2) where H() 1476 is the hash function in the selected cipher suite. The transcript 1477 hash TH_3 is a CBOR encoded bstr and the input to the hash 1478 function is a CBOR Sequence. Note that H(TH_2, CIPHERTEXT_2) can 1479 be computed and cached already in the processing of message_2. 1481 * Compute MAC_3 = EDHOC-KDF( PRK_4x3m, TH_3, "MAC_3", << ID_CRED_I, 1482 CRED_I, ? EAD_3 >>, mac_length_3 ). If the Initiator 1483 authenticates with a static Diffie-Hellman key (method equals 2 or 1484 3), then mac_length_3 is the EDHOC MAC length given by the 1485 selected cipher suite. If the Initiator authenticates with a 1486 signature key (method equals 0 or 1), then mac_length_3 is equal 1487 to the output size of the EDHOC hash algorithm given by the 1488 selected cipher suite. 1490 - ID_CRED_I - identifier to facilitate retrieval of CRED_I, see 1491 Section 3.5.4 1493 - CRED_I - CBOR item containing the credential of the Initiator, 1494 see Section 3.5.3 1496 - EAD_3 - protected external authorization data, see Section 3.8 1498 * If the Initiator authenticates with a static Diffie-Hellman key 1499 (method equals 2 or 3), then Signature_or_MAC_3 is MAC_3. If the 1500 Initiator authenticates with a signature key (method equals 0 or 1501 1), then Signature_or_MAC_3 is the 'signature' field of a 1502 COSE_Sign1 object as defined in Section 4.4 of 1503 [I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm of 1504 the selected cipher suite, the private authentication key of the 1505 Initiator, and the following parameters as input (see 1506 Appendix C.3): 1508 - protected = << ID_CRED_I >> 1510 - external_aad = << TH_3, CRED_I, ? EAD_3 >> 1512 - payload = MAC_3 1514 * Compute a COSE_Encrypt0 object as defined in Section 5.3 of 1515 [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm 1516 of the selected cipher suite, using the encryption key K_3, the 1517 initialization vector IV_3, the plaintext P, and the following 1518 parameters as input (see Appendix C.3): 1520 - protected = h'' 1522 - external_aad = TH_3 1524 where 1526 - K_3 = EDHOC-KDF( PRK_3e2m, TH_3, "K_3", h'', key_length ) 1528 o key_length - length of the encryption key of the EDHOC AEAD 1529 algorithm 1531 - IV_3 = EDHOC-KDF( PRK_3e2m, TH_3, "IV_3", h'', iv_length ) 1533 o iv_length - length of the intialization vector of the EDHOC 1534 AEAD algorithm 1536 - P = ( ID_CRED_I / bstr / int, Signature_or_MAC_3, ? EAD_3 ) 1537 o If ID_CRED_I contains a single 'kid' parameter, i.e., 1538 ID_CRED_I = { 4 : kid_I }, only the byte string or integer 1539 kid_I is conveyed in the plaintext encoded accordingly as 1540 bstr or int. 1542 CIPHERTEXT_3 is the 'ciphertext' of COSE_Encrypt0. 1544 * Encode message_3 as a CBOR data item as specified in 1545 Section 5.4.1. 1547 Pass the connection identifiers (C_I, C_R) and the application 1548 algorithms in the selected cipher suite to the application. The 1549 application can now derive application keys using the EDHOC-Exporter 1550 interface, see Section 4.3. 1552 After sending message_3, the Initiator is assured that no other party 1553 than the Responder can compute the key PRK_4x3m (implicit key 1554 authentication). The Initiator can securely derive application keys 1555 and send protected application data. However, the Initiator does not 1556 know that the Responder has actually computed the key PRK_4x3m and 1557 therefore the Initiator SHOULD NOT permanently store the keying 1558 material PRK_4x3m and TH_4, or derived application keys, until the 1559 Initiator is assured that the Responder has actually computed the key 1560 PRK_4x3m (explicit key confirmation). This is similar to waiting for 1561 acknowledgement (ACK) in a transport protocol. Explicit key 1562 confirmation is e.g., assured when the Initiator has verified an 1563 OSCORE message or message_4 from the Responder. 1565 5.4.3. Responder Processing of Message 3 1567 The Responder SHALL process message_3 as follows: 1569 * Decode message_3 (see Appendix C.1). 1571 * Retrieve the protocol state using the message correlation provided 1572 by the transport (e.g., the CoAP Token, the 5-tuple, or the 1573 prepended C_I, see Appendix A.3). 1575 * Decrypt and verify the COSE_Encrypt0 as defined in Section 5.3 of 1576 [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm 1577 in the selected cipher suite, and the parameters defined in 1578 Section 5.4.2. 1580 * Pass EAD_3 to the security application. 1582 * Verify that the identity of the Initiator is an allowed identity 1583 for this connection, see Section 3.5.1. 1585 * Verify Signature_or_MAC_3 using the algorithm in the selected 1586 cipher suite. The verification process depends on the method, see 1587 Section 5.4.2. 1589 * Pass the connection identifiers (C_I, C_R), and the application 1590 algorithms in the selected cipher suite to the security 1591 application. The application can now derive application keys 1592 using the EDHOC-Exporter interface. 1594 If any processing step fails, the Responder SHOULD send an EDHOC 1595 error message back, formatted as defined in Section 6. Sending error 1596 messages is essential for debugging but MAY e.g., be skipped if a 1597 session cannot be found or due to denial-of-service reasons, see 1598 Section 8.6. If an error message is sent, the session MUST be 1599 discontinued. 1601 After verifying message_3, the Responder is assured that the 1602 Initiator has calculated the key PRK_4x3m (explicit key confirmation) 1603 and that no other party than the Responder can compute the key. The 1604 Responder can securely send protected application data and store the 1605 keying material PRK_4x3m and TH_4. 1607 5.5. EDHOC Message 4 1609 This section specifies message_4 which is OPTIONAL to support. Key 1610 confirmation is normally provided by sending an application message 1611 from the Responder to the Initiator protected with a key derived with 1612 the EDHOC-Exporter, e.g., using OSCORE (see Appendix A). In 1613 deployments where no protected application message is sent from the 1614 Responder to the Initiator, the Responder MUST send message_4. Two 1615 examples of such deployments: 1617 1. When EDHOC is only used for authentication and no application 1618 data is sent. 1620 2. When application data is only sent from the Initiator to the 1621 Responder. 1623 Further considerations about when to use message_4 are provided in 1624 Section 3.9 and Section 8.1. 1626 5.5.1. Formatting of Message 4 1628 message_4 SHALL be a CBOR Sequence (see Appendix C.1) as defined 1629 below 1630 message_4 = ( 1631 CIPHERTEXT_4 : bstr, 1632 ) 1634 5.5.2. Responder Processing of Message 4 1636 The Responder SHALL compose message_4 as follows: 1638 * Compute a COSE_Encrypt0 as defined in Section 5.3 of 1639 [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm 1640 of the selected cipher suite, using the encryption key K_4, the 1641 initialization vector IV_4, the plaintext P, and the following 1642 parameters as input (see Appendix C.3): 1644 - protected = h'' 1646 - external_aad = TH_4 1648 where 1650 - K_4 = EDHOC-Exporter( "EDHOC_K_4", h'', key_length ) 1652 o key_length - length of the encryption key of the EDHOC AEAD 1653 algorithm 1655 - IV_4 = EDHOC-Exporter( "EDHOC_IV_4", h'', iv_length ) 1657 o iv_length - length of the intialization vector of the EDHOC 1658 AEAD algorithm 1660 - P = ( ? EAD_4 ) 1662 o EAD_4 - protected external authorization data, see 1663 Section 3.8. 1665 CIPHERTEXT_4 is the 'ciphertext' of COSE_Encrypt0. 1667 * Encode message_4 as a CBOR data item as specified in 1668 Section 5.5.1. 1670 5.5.3. Initiator Processing of Message 4 1672 The Initiator SHALL process message_4 as follows: 1674 * Decode message_4 (see Appendix C.1). 1676 * Retrieve the protocol state using the message correlation provided 1677 by the transport (e.g., the CoAP Token, the 5-tuple, or the 1678 prepended C_I, see Appendix A.3). 1680 * Decrypt and verify the COSE_Encrypt0 as defined in Section 5.3 of 1681 [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm 1682 in the selected cipher suite, and the parameters defined in 1683 Section 5.5.2. 1685 * Pass EAD_4 to the security application. 1687 If any processing step fails, the Responder SHOULD send an EDHOC 1688 error message back, formatted as defined in Section 6. Sending error 1689 messages is essential for debugging but MAY e.g., be skipped if a 1690 session cannot be found or due to denial-of-service reasons, see 1691 Section 8.6. If an error message is sent, the session MUST be 1692 discontinued. 1694 6. Error Handling 1696 This section defines the format for error messages. 1698 An EDHOC error message can be sent by either endpoint as a reply to 1699 any non-error EDHOC message. How errors at the EDHOC layer are 1700 transported depends on lower layers, which need to enable error 1701 messages to be sent and processed as intended. 1703 Errors in EDHOC are fatal. After sending an error message, the 1704 sender MUST discontinue the protocol. The receiver SHOULD treat an 1705 error message as an indication that the other party likely has 1706 discontinued the protocol. But as the error message is not 1707 authenticated, a received error message might also have been sent by 1708 an attacker and the receiver MAY therefore try to continue the 1709 protocol. 1711 error SHALL be a CBOR Sequence (see Appendix C.1) as defined below 1713 error = ( 1714 ERR_CODE : int, 1715 ERR_INFO : any, 1716 ) 1718 Figure 6: EDHOC Error Message 1720 where: 1722 * ERR_CODE - error code encoded as an integer. The value 0 is used 1723 for success, all other values (negative or positive) indicate 1724 errors. 1726 * ERR_INFO - error information. Content and encoding depend on 1727 error code. 1729 The remainder of this section specifies the currently defined error 1730 codes, see Figure 7. Additional error codes and corresponding error 1731 information may be specified. 1733 +----------+---------------+----------------------------------------+ 1734 | ERR_CODE | ERR_INFO Type | Description | 1735 +==========+===============+========================================+ 1736 | 0 | any | Success | 1737 +----------+---------------+----------------------------------------+ 1738 | 1 | tstr | Unspecified | 1739 +----------+---------------+----------------------------------------+ 1740 | 2 | suites | Wrong selected cipher suite | 1741 +----------+---------------+----------------------------------------+ 1743 Figure 7: Error Codes and Error Information 1745 6.1. Success 1747 Error code 0 MAY be used internally in an application to indicate 1748 success, e.g., in log files. ERR_INFO can contain any type of CBOR 1749 item. Error code 0 MUST NOT be used as part of the EDHOC message 1750 exchange flow. 1752 6.2. Unspecified 1754 Error code 1 is used for errors that do not have a specific error 1755 code defined. ERR_INFO MUST be a text string containing a human- 1756 readable diagnostic message written in English. The diagnostic text 1757 message is mainly intended for software engineers that during 1758 debugging need to interpret it in the context of the EDHOC 1759 specification. The diagnostic message SHOULD be provided to the 1760 calling application where it SHOULD be logged. 1762 6.3. Wrong Selected Cipher Suite 1764 Error code 2 MUST only be used in a response to message_1 in case the 1765 cipher suite selected by the Initiator is not supported by the 1766 Responder, or if the Responder supports a cipher suite more preferred 1767 by the Initiator than the selected cipher suite, see Section 5.2.3. 1768 ERR_INFO is in this case denoted SUITES_R and is of type suites, see 1769 Section 5.2.1. If the Responder does not support the selected cipher 1770 suite, then SUITES_R MUST include one or more supported cipher 1771 suites. If the Responder supports a cipher suite in SUITES_I other 1772 than the selected cipher suite (independently of if the selected 1773 cipher suite is supported or not) then SUITES_R MUST include the 1774 supported cipher suite in SUITES_I which is most preferred by the 1775 Initiator. SUITES_R MAY include a single cipher suite, i.e., be 1776 encoded as an int. If the Responder does not support any cipher 1777 suite in SUITES_I, then it SHOULD include all its supported cipher 1778 suites in SUITES_R in any order. 1780 6.3.1. Cipher Suite Negotiation 1782 After receiving SUITES_R, the Initiator can determine which cipher 1783 suite to select (if any) for the next EDHOC run with the Responder. 1785 If the Initiator intends to contact the Responder in the future, the 1786 Initiator SHOULD remember which selected cipher suite to use until 1787 the next message_1 has been sent, otherwise the Initiator and 1788 Responder will likely run into an infinite loop where the Initiator 1789 selects its most preferred and the Responder sends an error with 1790 supported cipher suites. After a successful run of EDHOC, the 1791 Initiator MAY remember the selected cipher suite to use in future 1792 EDHOC sessions. Note that if the Initiator or Responder is updated 1793 with new cipher suite policies, any cached information may be 1794 outdated. 1796 6.3.2. Examples 1798 Assume that the Initiator supports the five cipher suites 5, 6, 7, 8, 1799 and 9 in decreasing order of preference. Figures 8 and 9 show 1800 examples of how the Initiator can format SUITES_I and how SUITES_R is 1801 used by Responders to give the Initiator information about the cipher 1802 suites that the Responder supports. 1804 In the first example (Figure 8), the Responder supports cipher suite 1805 6 but not the initially selected cipher suite 5. 1807 Initiator Responder 1808 | METHOD, SUITES_I = 5, G_X, C_I, EAD_1 | 1809 +------------------------------------------------------------------>| 1810 | message_1 | 1811 | | 1812 | ERR_CODE = 2, SUITES_R = 6 | 1813 |<------------------------------------------------------------------+ 1814 | error | 1815 | | 1816 | METHOD, SUITES_I = [5, 6], G_X, C_I, EAD_1 | 1817 +------------------------------------------------------------------>| 1818 | message_1 | 1820 Figure 8: Example of Responder supporting suite 6 but not suite 5. 1822 In the second example (Figure 9), the Responder supports cipher 1823 suites 8 and 9 but not the more preferred (by the Initiator) cipher 1824 suites 5, 6 or 7. To illustrate the negotiation mechanics we let the 1825 Initiator first make a guess that the Responder supports suite 6 but 1826 not suite 5. Since the Responder supports neither 5 nor 6, it 1827 responds with SUITES_R containing the supported suites, after which 1828 the Initiator selects its most preferred supported suite. The order 1829 of cipher suites in SUITES_R does not matter. (If the Responder had 1830 supported suite 5, it would have included it in SUITES_R of the 1831 response, and it would in that case have become the selected suite in 1832 the second message_1.) 1834 Initiator Responder 1835 | METHOD, SUITES_I = [5, 6], G_X, C_I, EAD_1 | 1836 +------------------------------------------------------------------>| 1837 | message_1 | 1838 | | 1839 | ERR_CODE = 2, SUITES_R = [9, 8] | 1840 |<------------------------------------------------------------------+ 1841 | error | 1842 | | 1843 | METHOD, SUITES_I = [5, 6, 7, 8], G_X, C_I, EAD_1 | 1844 +------------------------------------------------------------------>| 1845 | message_1 | 1847 Figure 9: Example of Responder supporting suites 8 and 9 but not 1848 5, 6 or 7. 1850 Note that the Initiator's list of supported cipher suites and order 1851 of preference is fixed (see Section 5.2.1 and Section 5.2.2). 1852 Furthermore, the Responder shall only accept message_1 if the 1853 selected cipher suite is the first cipher suite in SUITES_I that the 1854 Responder supports (see Section 5.2.3). Following this procedure 1855 ensures that the selected cipher suite is the most preferred (by the 1856 Initiator) cipher suite supported by both parties. 1858 If the selected cipher suite is not the first cipher suite which the 1859 Responder supports in SUITES_I received in message_1, then Responder 1860 MUST discontinue the protocol, see Section 5.2.3. If SUITES_I in 1861 message_1 is manipulated, then the integrity verification of 1862 message_2 containing the transcript hash TH_2 will fail and the 1863 Initiator will discontinue the protocol. 1865 7. Mandatory-to-Implement Compliance Requirements 1867 An implementation may support only Initiator or only Responder. 1869 An implementation may support only a single method. None of the 1870 methods are mandatory-to-implement. 1872 Implementations MUST support 'kid' parameters of type int. None of 1873 the other COSE header parameters are mandatory-to-implement. 1875 An implementation may support only a single credential type (CCS, 1876 CWT, X.509, C509). None of the credential types are mandatory-to- 1877 implement. 1879 Implementations MUST support the EDHOC-Exporter. Implementations 1880 SHOULD support EDHOC-KeyUpdate. 1882 Implementations MAY support message_4. Error codes 1 and 2 MUST be 1883 supported. 1885 Implementations MAY support EAD. 1887 For many constrained IoT devices it is problematic to support more 1888 than one cipher suite. Existing devices can be expected to support 1889 either ECDSA or EdDSA. To enable as much interoperability as we can 1890 reasonably achieve, less constrained devices SHOULD implement both 1891 cipher suite 0 (AES-CCM-16-64-128, SHA-256, 8, X25519, EdDSA, AES- 1892 CCM-16-64-128, SHA-256) and cipher suite 2 (AES-CCM-16-64-128, SHA- 1893 256, 8, P-256, ES256, AES-CCM-16-64-128, SHA-256). Constrained 1894 endpoints SHOULD implement cipher suite 0 or cipher suite 2. 1895 Implementations only need to implement the algorithms needed for 1896 their supported methods. 1898 8. Security Considerations 1900 8.1. Security Properties 1902 EDHOC inherits its security properties from the theoretical SIGMA-I 1903 protocol [SIGMA]. Using the terminology from [SIGMA], EDHOC provides 1904 forward secrecy, mutual authentication with aliveness, consistency, 1905 and peer awareness. As described in [SIGMA], peer awareness is 1906 provided to the Responder, but not to the Initiator. 1908 As described in [SIGMA], different levels of identity protection is 1909 provided to the Initiator and the Responder. EDHOC protects the 1910 credential identifier of the Initiator against active attacks and the 1911 credential identifier of the Responder against passive attacks. The 1912 roles should be assigned to protect the most sensitive identity/ 1913 identifier, typically that which is not possible to infer from 1914 routing information in the lower layers. 1916 Compared to [SIGMA], EDHOC adds an explicit method type and expands 1917 the message authentication coverage to additional elements such as 1918 algorithms, external authorization data, and previous messages. This 1919 protects against an attacker replaying messages or injecting messages 1920 from another session. 1922 EDHOC also adds selection of connection identifiers and downgrade 1923 protected negotiation of cryptographic parameters, i.e., an attacker 1924 cannot affect the negotiated parameters. A single session of EDHOC 1925 does not include negotiation of cipher suites, but it enables the 1926 Responder to verify that the selected cipher suite is the most 1927 preferred cipher suite by the Initiator which is supported by both 1928 the Initiator and the Responder. 1930 As required by [RFC7258], IETF protocols need to mitigate pervasive 1931 monitoring when possible. EDHOC therefore only supports methods with 1932 ephemeral Diffie-Hellman and provides a KeyUpdate function for 1933 lightweight application protocol rekeying with forward secrecy, in 1934 the sense that compromise of the private authentication keys does not 1935 compromise past session keys, and compromise of a session key does 1936 not compromise past session keys. 1938 While the KeyUpdate method can be used to meet cryptographic limits 1939 and provide partial protection against key leakage, it provides 1940 significantly weaker security properties than re-running EDHOC with 1941 ephemeral Diffie-Hellman. Even with frequent use of KeyUpdate, 1942 compromise of one session key compromises all future session keys, 1943 and an attacker therefore only needs to perform static key 1944 exfiltration [RFC7624]. Frequently re-running EDHOC with ephemeral 1945 Diffie-Hellman forces attackers to perform dynamic key exfiltration 1946 instead of static key exfiltration [RFC7624]. In the dynamic case, 1947 the attacker must have continuous interactions with the collaborator, 1948 which is more complicated and has a higher risk profile than the 1949 static case. 1951 To limit the effect of breaches, it is important to limit the use of 1952 symmetrical group keys for bootstrapping. EDHOC therefore strives to 1953 make the additional cost of using raw public keys and self-signed 1954 certificates as small as possible. Raw public keys and self-signed 1955 certificates are not a replacement for a public key infrastructure 1956 but SHOULD be used instead of symmetrical group keys for 1957 bootstrapping. 1959 Compromise of the long-term keys (private signature or static DH 1960 keys) does not compromise the security of completed EDHOC exchanges. 1961 Compromising the private authentication keys of one party lets an 1962 active attacker impersonate that compromised party in EDHOC exchanges 1963 with other parties but does not let the attacker impersonate other 1964 parties in EDHOC exchanges with the compromised party. Compromise of 1965 the long-term keys does not enable a passive attacker to compromise 1966 future session keys. Compromise of the HDKF input parameters (ECDH 1967 shared secret) leads to compromise of all session keys derived from 1968 that compromised shared secret. Compromise of one session key does 1969 not compromise other session keys. Compromise of PRK_4x3m leads to 1970 compromise of all exported keying material derived after the last 1971 invocation of the EDHOC-KeyUpdate function. 1973 EDHOC provides a minimum of 64-bit security against online brute 1974 force attacks and a minimum of 128-bit security against offline brute 1975 force attacks. This is in line with IPsec, TLS, and COSE. To break 1976 64-bit security against online brute force an attacker would on 1977 average have to send 4.3 billion messages per second for 68 years, 1978 which is infeasible in constrained IoT radio technologies. 1980 After sending message_3, the Initiator is assured that no other party 1981 than the Responder can compute the key PRK_4x3m (implicit key 1982 authentication). The Initiator does however not know that the 1983 Responder has actually computed the key PRK_4x3m. While the 1984 Initiator can securely send protected application data, the Initiator 1985 SHOULD NOT permanently store the keying material PRK_4x3m and TH_4 1986 until the Initiator is assured that the Responder has actually 1987 computed the key PRK_4x3m (explicit key confirmation). Explicit key 1988 confirmation is e.g., assured when the Initiator has verified an 1989 OSCORE message or message_4 from the Responder. After verifying 1990 message_3, the Responder is assured that the Initiator has calculated 1991 the key PRK_4x3m (explicit key confirmation) and that no other party 1992 than the Responder can compute the key. The Responder can securely 1993 send protected application data and store the keying material 1994 PRK_4x3m and TH_4. 1996 Key compromise impersonation (KCI): In EDHOC authenticated with 1997 signature keys, EDHOC provides KCI protection against an attacker 1998 having access to the long-term key or the ephemeral secret key. With 1999 static Diffie-Hellman key authentication, KCI protection would be 2000 provided against an attacker having access to the long-term Diffie- 2001 Hellman key, but not to an attacker having access to the ephemeral 2002 secret key. Note that the term KCI has typically been used for 2003 compromise of long-term keys, and that an attacker with access to the 2004 ephemeral secret key can only attack that specific session. 2006 Repudiation: In EDHOC authenticated with signature keys, the 2007 Initiator could theoretically prove that the Responder performed a 2008 run of the protocol by presenting the private ephemeral key, and vice 2009 versa. Note that storing the private ephemeral keys violates the 2010 protocol requirements. With static Diffie-Hellman key 2011 authentication, both parties can always deny having participated in 2012 the protocol. 2014 Two earlier versions of EDHOC have been formally analyzed [Norrman20] 2015 [Bruni18] and the specification has been updated based on the 2016 analysis. 2018 8.2. Cryptographic Considerations 2020 The SIGMA protocol requires that the encryption of message_3 provides 2021 confidentiality against active attackers and EDHOC message_4 relies 2022 on the use of authenticated encryption. Hence the message 2023 authenticating functionality of the authenticated encryption in EDHOC 2024 is critical: authenticated encryption MUST NOT be replaced by plain 2025 encryption only, even if authentication is provided at another level 2026 or through a different mechanism. 2028 To reduce message overhead EDHOC does not use explicit nonces and 2029 instead rely on the ephemeral public keys to provide randomness to 2030 each session. A good amount of randomness is important for the key 2031 generation, to provide liveness, and to protect against interleaving 2032 attacks. For this reason, the ephemeral keys MUST NOT be used in 2033 more than one EDHOC message, and both parties SHALL generate fresh 2034 random ephemeral key pairs. Note that an ephemeral key may be used 2035 to calculate several ECDH shared secrets. When static Diffie-Hellman 2036 authentication is used the same ephemeral key is used in both 2037 ephemeral-ephemeral and ephemeral-static ECDH. 2039 As discussed in [SIGMA], the encryption of message_2 does only need 2040 to protect against passive attacker as active attackers can always 2041 get the Responders identity by sending their own message_1. EDHOC 2042 uses the Expand function (typically HKDF-Expand) as a binary additive 2043 stream cipher. HKDF-Expand provides better confidentiality than AES- 2044 CTR but is not often used as it is slow on long messages, and most 2045 applications require both IND-CCA confidentiality as well as 2046 integrity protection. For the encryption of message_2, any speed 2047 difference is negligible, IND-CCA does not increase security, and 2048 integrity is provided by the inner MAC (and signature depending on 2049 method). 2051 Requirement for how to securely generate, validate, and process the 2052 ephemeral public keys depend on the elliptic curve. For X25519 and 2053 X448, the requirements are defined in [RFC7748]. For secp256r1, 2054 secp384r1, and secp521r1, the requirements are defined in Section 5 2055 of [SP-800-56A]. For secp256r1, secp384r1, and secp521r1, at least 2056 partial public-key validation MUST be done. 2058 8.3. Cipher Suites and Cryptographic Algorithms 2060 When using private cipher suite or registering new cipher suites, the 2061 choice of key length used in the different algorithms needs to be 2062 harmonized, so that a sufficient security level is maintained for 2063 certificates, EDHOC, and the protection of application data. The 2064 Initiator and the Responder should enforce a minimum security level. 2066 The hash algorithms SHA-1 and SHA-256/64 (SHA-256 truncated to 2067 64-bits) SHALL NOT be supported for use in EDHOC except for 2068 certificate identification with x5t and c5t. Note that secp256k1 is 2069 only defined for use with ECDSA and not for ECDH. Note that some 2070 COSE algorithms are marked as not recommended in the COSE IANA 2071 registry. 2073 8.4. Post-Quantum Considerations 2075 As of the publication of this specification, it is unclear when or 2076 even if a quantum computer of sufficient size and power to exploit 2077 public key cryptography will exist. Deployments that need to 2078 consider risks decades into the future should transition to Post- 2079 Quantum Cryptography (PQC) in the not-too-distant future. Many other 2080 systems should take a slower wait-and-see approach where PQC is 2081 phased in when the quantum threat is more imminent. Current PQC 2082 algorithms have limitations compared to Elliptic Curve Cryptography 2083 (ECC) and the data sizes would be problematic in many constrained IoT 2084 systems. 2086 Symmetric algorithms used in EDHOC such as SHA-256 and AES-CCM- 2087 16-64-128 are practically secure against even large quantum 2088 computers. EDHOC supports all signature algorithms defined by COSE, 2089 including PQC signature algorithms such as HSS-LMS. EDHOC is 2090 currently only specified for use with key exchange algorithms of type 2091 ECDH curves, but any Key Encapsulation Method (KEM), including PQC 2092 KEMs, can be used in method 0. While the key exchange in method 0 is 2093 specified with terms of the Diffie-Hellman protocol, the key exchange 2094 adheres to a KEM interface: G_X is then the public key of the 2095 Initiator, G_Y is the encapsulation, and G_XY is the shared secret. 2096 Use of PQC KEMs to replace static DH authentication would likely 2097 require a specification updating EDHOC with new methods. 2099 8.5. Unprotected Data 2101 The Initiator and the Responder must make sure that unprotected data 2102 and metadata do not reveal any sensitive information. This also 2103 applies for encrypted data sent to an unauthenticated party. In 2104 particular, it applies to EAD_1, ID_CRED_R, EAD_2, and error 2105 messages. Using the same EAD_1 in several EDHOC sessions allows 2106 passive eavesdroppers to correlate the different sessions. Another 2107 consideration is that the list of supported cipher suites may 2108 potentially be used to identify the application. 2110 The Initiator and the Responder must also make sure that 2111 unauthenticated data does not trigger any harmful actions. In 2112 particular, this applies to EAD_1 and error messages. 2114 8.6. Denial-of-Service 2116 As CoAP provides Denial-of-Service protection in the form of the Echo 2117 option [RFC9175], EDHOC itself does not provide countermeasures 2118 against Denial-of-Service attacks. By sending a number of new or 2119 replayed message_1 an attacker may cause the Responder to allocate 2120 state, perform cryptographic operations, and amplify messages. To 2121 mitigate such attacks, an implementation SHOULD rely on lower layer 2122 mechanisms such as the Echo option in CoAP that forces the initiator 2123 to demonstrate reachability at its apparent network address. 2125 An attacker can also send faked message_2, message_3, message_4, or 2126 error in an attempt to trick the receiving party to send an error 2127 message and discontinue the session. EDHOC implementations MAY 2128 evaluate if a received message is likely to have been forged by an 2129 attacker and ignore it without sending an error message or 2130 discontinuing the session. 2132 8.7. Implementation Considerations 2134 The availability of a secure random number generator is essential for 2135 the security of EDHOC. If no true random number generator is 2136 available, a truly random seed MUST be provided from an external 2137 source and used with a cryptographically secure pseudorandom number 2138 generator. As each pseudorandom number must only be used once, an 2139 implementation needs to get a new truly random seed after reboot, or 2140 continuously store state in nonvolatile memory, see ([RFC8613], 2141 Appendix B.1.1) for issues and solution approaches for writing to 2142 nonvolatile memory. Intentionally or unintentionally weak or 2143 predictable pseudorandom number generators can be abused or exploited 2144 for malicious purposes. [RFC8937] describes a way for security 2145 protocol implementations to augment their (pseudo)random number 2146 generators using a long-term private key and a deterministic 2147 signature function. This improves randomness from broken or 2148 otherwise subverted random number generators. The same idea can be 2149 used with other secrets and functions such as a Diffie-Hellman 2150 function or a symmetric secret and a PRF like HMAC or KMAC. It is 2151 RECOMMENDED to not trust a single source of randomness and to not put 2152 unaugmented random numbers on the wire. 2154 If ECDSA is supported, "deterministic ECDSA" as specified in 2155 [RFC6979] MAY be used. Pure deterministic elliptic-curve signatures 2156 such as deterministic ECDSA and EdDSA have gained popularity over 2157 randomized ECDSA as their security do not depend on a source of high- 2158 quality randomness. Recent research has however found that 2159 implementations of these signature algorithms may be vulnerable to 2160 certain side-channel and fault injection attacks due to their 2161 determinism. See e.g., Section 1 of 2163 [I-D.mattsson-cfrg-det-sigs-with-noise] for a list of attack papers. 2164 As suggested in Section 6.1.2 of [I-D.ietf-cose-rfc8152bis-algs] this 2165 can be addressed by combining randomness and determinism. 2167 All private keys, symmetric keys, and IVs MUST be secret. 2168 Implementations should provide countermeasures to side-channel 2169 attacks such as timing attacks. Intermediate computed values such as 2170 ephemeral ECDH keys and ECDH shared secrets MUST be deleted after key 2171 derivation is completed. 2173 The Initiator and the Responder are responsible for verifying the 2174 integrity of certificates. The selection of trusted CAs should be 2175 done very carefully and certificate revocation should be supported. 2176 The private authentication keys MUST be kept secret, only the 2177 Responder SHALL have access to the Responder's private authentication 2178 key and only the Initiator SHALL have access to the Initiator's 2179 private authentication key. 2181 The Initiator and the Responder are allowed to select the connection 2182 identifiers C_I and C_R, respectively, for the other party to use in 2183 the ongoing EDHOC protocol as well as in a subsequent application 2184 protocol (e.g., OSCORE [RFC8613]). The choice of connection 2185 identifier is not security critical in EDHOC but intended to simplify 2186 the retrieval of the right security context in combination with using 2187 short identifiers. If the wrong connection identifier of the other 2188 party is used in a protocol message it will result in the receiving 2189 party not being able to retrieve a security context (which will 2190 terminate the protocol) or retrieve the wrong security context (which 2191 also terminates the protocol as the message cannot be verified). 2193 If two nodes unintentionally initiate two simultaneous EDHOC message 2194 exchanges with each other even if they only want to complete a single 2195 EDHOC message exchange, they MAY terminate the exchange with the 2196 lexicographically smallest G_X. If the two G_X values are equal, the 2197 received message_1 MUST be discarded to mitigate reflection attacks. 2198 Note that in the case of two simultaneous EDHOC exchanges where the 2199 nodes only complete one and where the nodes have different preferred 2200 cipher suites, an attacker can affect which of the two nodes' 2201 preferred cipher suites will be used by blocking the other exchange. 2203 If supported by the device, it is RECOMMENDED that at least the long- 2204 term private keys are stored in a Trusted Execution Environment (TEE) 2205 and that sensitive operations using these keys are performed inside 2206 the TEE. To achieve even higher security it is RECOMMENDED that 2207 additional operations such as ephemeral key generation, all 2208 computations of shared secrets, and storage of the PRK keys can be 2209 done inside the TEE. The use of a TEE enforces that code within that 2210 environment cannot be tampered with, and that any data used by such 2211 code cannot be read or tampered with by code outside that 2212 environment. 2214 9. IANA Considerations 2216 9.1. EDHOC Exporter Label Registry 2218 IANA has created a new registry titled "EDHOC Exporter Label" under 2219 the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The 2220 registration procedure is "Expert Review". The columns of the 2221 registry are Label, Description, and Reference. All columns are text 2222 strings where Label consists only of the printable ASCII characters 2223 0x21 - 0x7e. Labels beginning with "PRIVATE" MAY be used for private 2224 use without registration. All other label values MUST be registered. 2225 The initial contents of the registry are: 2227 Label: EDHOC_K_4 2228 Description: Key used to protect EDHOC message_4 2229 Reference: [[this document]] 2231 Label: EDHOC_IV_4 2232 Description: IV used to protect EDHOC message_4 2233 Reference: [[this document]] 2235 Label: OSCORE_Master_Secret 2236 Description: Derived OSCORE Master Secret 2237 Reference: [[this document]] 2239 Label: OSCORE_Master_Salt 2240 Description: Derived OSCORE Master Salt 2241 Reference: [[this document]] 2243 9.2. EDHOC Cipher Suites Registry 2245 IANA has created a new registry titled "EDHOC Cipher Suites" under 2246 the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The 2247 registration procedure is "Expert Review". The columns of the 2248 registry are Value, Array, Description, and Reference, where Value is 2249 an integer and the other columns are text strings. The initial 2250 contents of the registry are: 2252 Value: -24 2253 Algorithms: N/A 2254 Desc: Reserved for Private Use 2255 Reference: [[this document]] 2257 Value: -23 2258 Algorithms: N/A 2259 Desc: Reserved for Private Use 2260 Reference: [[this document]] 2262 Value: -22 2263 Algorithms: N/A 2264 Desc: Reserved for Private Use 2265 Reference: [[this document]] 2267 Value: -21 2268 Algorithms: N/A 2269 Desc: Reserved for Private Use 2270 Reference: [[this document]] 2272 Value: 0 2273 Array: 10, -16, 8, 4, -8, 10, -16 2274 Desc: AES-CCM-16-64-128, SHA-256, 8, X25519, EdDSA, 2275 AES-CCM-16-64-128, SHA-256 2276 Reference: [[this document]] 2278 Value: 1 2279 Array: 30, -16, 16, 4, -8, 10, -16 2280 Desc: AES-CCM-16-128-128, SHA-256, 16, X25519, EdDSA, 2281 AES-CCM-16-64-128, SHA-256 2282 Reference: [[this document]] 2284 Value: 2 2285 Array: 10, -16, 8, 1, -7, 10, -16 2286 Desc: AES-CCM-16-64-128, SHA-256, 8, P-256, ES256, 2287 AES-CCM-16-64-128, SHA-256 2288 Reference: [[this document]] 2290 Value: 3 2291 Array: 30, -16, 16, 1, -7, 10, -16 2292 Desc: AES-CCM-16-128-128, SHA-256, 16, P-256, ES256, 2293 AES-CCM-16-64-128, SHA-256 2294 Reference: [[this document]] 2295 Value: 4 2296 Array: 24, -16, 16, 4, -8, 24, -16 2297 Desc: ChaCha20/Poly1305, SHA-256, 16, X25519, EdDSA, 2298 ChaCha20/Poly1305, SHA-256 2299 Reference: [[this document]] 2301 Value: 5 2302 Array: 24, -16, 16, 1, -7, 24, -16 2303 Desc: ChaCha20/Poly1305, SHA-256, 16, P-256, ES256, 2304 ChaCha20/Poly1305, SHA-256 2305 Reference: [[this document]] 2307 Value: 6 2308 Array: 1, -16, 16, 4, -7, 1, -16 2309 Desc: A128GCM, SHA-256, 16, X25519, ES256, 2310 A128GCM, SHA-256 2311 Reference: [[this document]] 2313 Value: 24 2314 Array: 3, -43, 16, 2, -35, 3, -43 2315 Desc: A256GCM, SHA-384, 16, P-384, ES384, 2316 A256GCM, SHA-384 2317 Reference: [[this document]] 2319 Value: 25 2320 Array: 24, -45, 16, 5, -8, 24, -45 2321 Desc: ChaCha20/Poly1305, SHAKE256, 16, X448, EdDSA, 2322 ChaCha20/Poly1305, SHAKE256 2323 Reference: [[this document]] 2325 9.3. EDHOC Method Type Registry 2327 IANA has created a new registry entitled "EDHOC Method Type" under 2328 the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The 2329 registration procedure is "Expert Review". The columns of the 2330 registry are Value, Description, and Reference, where Value is an 2331 integer and the other columns are text strings. The initial contents 2332 of the registry are shown in Figure 4. 2334 9.4. EDHOC Error Codes Registry 2336 IANA has created a new registry entitled "EDHOC Error Codes" under 2337 the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The 2338 registration procedure is "Expert Review". The columns of the 2339 registry are ERR_CODE, ERR_INFO Type and Description, where ERR_CODE 2340 is an integer, ERR_INFO is a CDDL defined type, and Description is a 2341 text string. The initial contents of the registry are shown in 2342 Figure 7. 2344 9.5. EDHOC External Authorization Data Registry 2346 IANA has created a new registry entitled "EDHOC External 2347 Authorization Data" under the new group name "Ephemeral Diffie- 2348 Hellman Over COSE (EDHOC)". The registration procedure is "Expert 2349 Review". The columns of the registry are Label, Description, Value 2350 Type, and Reference, where Label is an integer and the other columns 2351 are text strings. 2353 9.6. COSE Header Parameters Registry 2355 IANA has registered the following entries in the "COSE Header 2356 Parameters" registry under the group name "CBOR Object Signing and 2357 Encryption (COSE)". The value of the 'kcwt' header parameter is a 2358 COSE Web Token (CWT) [RFC8392], and the value of the 'kccs' header 2359 parameter is an CWT Claims Set (CCS), see Section 1.5. The CWT/CCS 2360 must contain a COSE_Key in a 'cnf' claim [RFC8747]. The Value 2361 Registry for this item is empty and omitted from the table below. 2363 +-----------+-------+----------------+---------------------------+ 2364 | Name | Label | Value Type | Description | 2365 +===========+=======+================+===========================+ 2366 | kcwt | TBD1 | COSE_Messages | A CBOR Web Token (CWT) | 2367 | | | | containing a COSE_Key in | 2368 | | | | a 'cnf' claim | 2369 +-----------+-------+----------------+---------------------------+ 2370 | kccs | TBD2 | map / #6(map) | A CWT Claims Set (CCS) | 2371 | | | | containing a COSE_Key in | 2372 | | | | a 'cnf' claim | 2373 +-----------+-------+----------------+---------------------------+ 2375 9.7. COSE Header Parameters Registry 2377 IANA has extended the Value Type of 'kid' in the "COSE Header 2378 Parameters" registry under the group name "CBOR Object Signing and 2379 Encryption (COSE)" to also allow the Value Type int. The resulting 2380 Value Type is bstr / int. The Value Registry for this item is empty 2381 and omitted from the table below. 2383 +------+-------+------------+----------------+-------------------+ 2384 | Name | Label | Value Type | Description | Reference | 2385 +------+-------+------------+----------------+-------------------+ 2386 | kid | 4 | bstr / int | Key identifier | [[This document]] | 2387 +------+-------+------------+----------------+-------------------+ 2389 9.8. COSE Key Common Parameters Registry 2391 IANA has extended the Value Type of 'kid' in the "COSE Key Common 2392 Parameters" registry under the group name "CBOR Object Signing and 2393 Encryption (COSE)" to also allow the Value Type int. The resulting 2394 Value Type is bstr / int. The Value Registry for this item is empty 2395 and omitted from the table below. 2397 +------+-------+------------+----------------+-------------------+ 2398 | Name | Label | Value Type | Description | Reference | 2399 +------+-------+------------+----------------+-------------------+ 2400 | kid | 2 | bstr / int | Key identifi- | [[This document]] | 2401 | | | | cation value - | | 2402 | | | | match to kid | | 2403 | | | | in message | | 2404 +------+-------+------------+----------------+-------------------+ 2406 9.9. CWT Confirmation Methods Registry 2408 IANA has extended the Value Type of 'kid' in the "CWT Confirmation 2409 Methods" registry under the group name "CBOR Web Token (CWT) Claims" 2410 to also allow the Value Type int. The incorrect term binary string 2411 has been corrected to bstr. The resulting Value Type is bstr / int. 2412 The new updated content for the 'kid' method is shown in the list 2413 below. 2415 * Confirmation Method Name: kid 2417 * Confirmation Method Description: Key Identifier 2419 * JWT Confirmation Method Name: kid 2421 * Confirmation Key: 3 2423 * Confirmation Value Type(s): bstr / int 2425 * Change Controller: IESG 2427 * Specification Document(s): Section 3.4 of RFC 8747 [[This 2428 document]] 2430 9.10. The Well-Known URI Registry 2432 IANA has added the well-known URI "edhoc" to the "Well-Known URIs" 2433 registry under the group name "Well-Known URIs". 2435 * URI suffix: edhoc 2436 * Change controller: IETF 2438 * Specification document(s): [[this document]] 2440 * Related information: None 2442 9.11. Media Types Registry 2444 IANA has added the media type "application/edhoc" to the "Media 2445 Types" registry. 2447 * Type name: application 2449 * Subtype name: edhoc 2451 * Required parameters: N/A 2453 * Optional parameters: N/A 2455 * Encoding considerations: binary 2457 * Security considerations: See Section 7 of this document. 2459 * Interoperability considerations: N/A 2461 * Published specification: [[this document]] (this document) 2463 * Applications that use this media type: To be identified 2465 * Fragment identifier considerations: N/A 2467 * Additional information: 2469 - Magic number(s): N/A 2471 - File extension(s): N/A 2473 - Macintosh file type code(s): N/A 2475 * Person & email address to contact for further information: See 2476 "Authors' Addresses" section. 2478 * Intended usage: COMMON 2480 * Restrictions on usage: N/A 2482 * Author: See "Authors' Addresses" section. 2484 * Change Controller: IESG 2486 9.12. CoAP Content-Formats Registry 2488 IANA has added the media type "application/edhoc" to the "CoAP 2489 Content-Formats" registry under the group name "Constrained RESTful 2490 Environments (CoRE) Parameters". 2492 * Media Type: application/edhoc 2494 * Encoding: 2496 * ID: TBD42 2498 * Reference: [[this document]] 2500 9.13. Resource Type (rt=) Link Target Attribute Values Registry 2502 IANA has added the resource type "core.edhoc" to the "Resource Type 2503 (rt=) Link Target Attribute Values" registry under the group name 2504 "Constrained RESTful Environments (CoRE) Parameters". 2506 * Value: "core.edhoc" 2508 * Description: EDHOC resource. 2510 * Reference: [[this document]] 2512 Client applications can use this resource type to discover a server's 2513 resource for EDHOC, where to send a request for executing the EDHOC 2514 protocol. 2516 9.14. Expert Review Instructions 2518 The IANA Registries established in this document is defined as 2519 "Expert Review". This section gives some general guidelines for what 2520 the experts should be looking for, but they are being designated as 2521 experts for a reason so they should be given substantial latitude. 2523 Expert reviewers should take into consideration the following points: 2525 * Clarity and correctness of registrations. Experts are expected to 2526 check the clarity of purpose and use of the requested entries. 2527 Expert needs to make sure the values of algorithms are taken from 2528 the right registry, when that is required. Expert should consider 2529 requesting an opinion on the correctness of registered parameters 2530 from relevant IETF working groups. Encodings that do not meet 2531 these objective of clarity and completeness should not be 2532 registered. 2534 * Experts should take into account the expected usage of fields when 2535 approving point assignment. The length of the encoded value 2536 should be weighed against how many code points of that length are 2537 left, the size of device it will be used on, and the number of 2538 code points left that encode to that size. 2540 * Specifications are recommended. When specifications are not 2541 provided, the description provided needs to have sufficient 2542 information to verify the points above. 2544 10. References 2546 10.1. Normative References 2548 [I-D.ietf-cose-rfc8152bis-algs] 2549 Schaad, J., "CBOR Object Signing and Encryption (COSE): 2550 Initial Algorithms", Work in Progress, Internet-Draft, 2551 draft-ietf-cose-rfc8152bis-algs-12, 24 September 2020, 2552 . 2555 [I-D.ietf-cose-rfc8152bis-struct] 2556 Schaad, J., "CBOR Object Signing and Encryption (COSE): 2557 Structures and Process", Work in Progress, Internet-Draft, 2558 draft-ietf-cose-rfc8152bis-struct-15, 1 February 2021, 2559 . 2562 [I-D.ietf-cose-x509] 2563 Schaad, J., "CBOR Object Signing and Encryption (COSE): 2564 Header parameters for carrying and referencing X.509 2565 certificates", Work in Progress, Internet-Draft, draft- 2566 ietf-cose-x509-08, 14 December 2020, 2567 . 2570 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2571 Requirement Levels", BCP 14, RFC 2119, 2572 DOI 10.17487/RFC2119, March 1997, 2573 . 2575 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 2576 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 2577 . 2579 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 2580 Housley, R., and W. Polk, "Internet X.509 Public Key 2581 Infrastructure Certificate and Certificate Revocation List 2582 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 2583 . 2585 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 2586 Key Derivation Function (HKDF)", RFC 5869, 2587 DOI 10.17487/RFC5869, May 2010, 2588 . 2590 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 2591 Curve Cryptography Algorithms", RFC 6090, 2592 DOI 10.17487/RFC6090, February 2011, 2593 . 2595 [RFC6979] Pornin, T., "Deterministic Usage of the Digital Signature 2596 Algorithm (DSA) and Elliptic Curve Digital Signature 2597 Algorithm (ECDSA)", RFC 6979, DOI 10.17487/RFC6979, August 2598 2013, . 2600 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 2601 Application Protocol (CoAP)", RFC 7252, 2602 DOI 10.17487/RFC7252, June 2014, 2603 . 2605 [RFC7624] Barnes, R., Schneier, B., Jennings, C., Hardie, T., 2606 Trammell, B., Huitema, C., and D. Borkmann, 2607 "Confidentiality in the Face of Pervasive Surveillance: A 2608 Threat Model and Problem Statement", RFC 7624, 2609 DOI 10.17487/RFC7624, August 2015, 2610 . 2612 [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves 2613 for Security", RFC 7748, DOI 10.17487/RFC7748, January 2614 2016, . 2616 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 2617 the Constrained Application Protocol (CoAP)", RFC 7959, 2618 DOI 10.17487/RFC7959, August 2016, 2619 . 2621 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2622 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2623 May 2017, . 2625 [RFC8376] Farrell, S., Ed., "Low-Power Wide Area Network (LPWAN) 2626 Overview", RFC 8376, DOI 10.17487/RFC8376, May 2018, 2627 . 2629 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 2630 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 2631 May 2018, . 2633 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 2634 Definition Language (CDDL): A Notational Convention to 2635 Express Concise Binary Object Representation (CBOR) and 2636 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 2637 June 2019, . 2639 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 2640 "Object Security for Constrained RESTful Environments 2641 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 2642 . 2644 [RFC8724] Minaburo, A., Toutain, L., Gomez, C., Barthel, D., and JC. 2645 Zuniga, "SCHC: Generic Framework for Static Context Header 2646 Compression and Fragmentation", RFC 8724, 2647 DOI 10.17487/RFC8724, April 2020, 2648 . 2650 [RFC8742] Bormann, C., "Concise Binary Object Representation (CBOR) 2651 Sequences", RFC 8742, DOI 10.17487/RFC8742, February 2020, 2652 . 2654 [RFC8747] Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. 2655 Tschofenig, "Proof-of-Possession Key Semantics for CBOR 2656 Web Tokens (CWTs)", RFC 8747, DOI 10.17487/RFC8747, March 2657 2020, . 2659 [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object 2660 Representation (CBOR)", STD 94, RFC 8949, 2661 DOI 10.17487/RFC8949, December 2020, 2662 . 2664 [RFC9175] Amsüss, C., Preuß Mattsson, J., and G. Selander, 2665 "Constrained Application Protocol (CoAP): Echo, Request- 2666 Tag, and Token Processing", RFC 9175, 2667 DOI 10.17487/RFC9175, February 2022, 2668 . 2670 10.2. Informative References 2672 [Bruni18] Bruni, A., Sahl Jørgensen, T., Grønbech Petersen, T., and 2673 C. Schürmann, "Formal Verification of Ephemeral Diffie- 2674 Hellman Over COSE (EDHOC)", November 2018, 2675 . 2679 [CborMe] Bormann, C., "CBOR Playground", May 2018, 2680 . 2682 [CNSA] (Placeholder), ., "Commercial National Security Algorithm 2683 Suite", August 2015, 2684 . 2687 [I-D.ietf-core-oscore-edhoc] 2688 Palombini, F., Tiloca, M., Hoeglund, R., Hristozov, S., 2689 and G. Selander, "Profiling EDHOC for CoAP and OSCORE", 2690 Work in Progress, Internet-Draft, draft-ietf-core-oscore- 2691 edhoc-03, 7 March 2022, . 2694 [I-D.ietf-core-resource-directory] 2695 Amsüss, C., Shelby, Z., Koster, M., Bormann, C., and P. V. 2696 D. Stok, "CoRE Resource Directory", Work in Progress, 2697 Internet-Draft, draft-ietf-core-resource-directory-28, 7 2698 March 2021, . 2701 [I-D.ietf-cose-cbor-encoded-cert] 2702 Mattsson, J. P., Selander, G., Raza, S., Höglund, J., and 2703 M. Furuhed, "CBOR Encoded X.509 Certificates (C509 2704 Certificates)", Work in Progress, Internet-Draft, draft- 2705 ietf-cose-cbor-encoded-cert-03, 10 January 2022, 2706 . 2709 [I-D.ietf-lake-reqs] 2710 Vucinic, M., Selander, G., Mattsson, J. P., and D. Garcia- 2711 Carrillo, "Requirements for a Lightweight AKE for OSCORE", 2712 Work in Progress, Internet-Draft, draft-ietf-lake-reqs-04, 2713 8 June 2020, . 2716 [I-D.ietf-lwig-security-protocol-comparison] 2717 Mattsson, J. P., Palombini, F., and M. Vucinic, 2718 "Comparison of CoAP Security Protocols", Work in Progress, 2719 Internet-Draft, draft-ietf-lwig-security-protocol- 2720 comparison-05, 2 November 2020, 2721 . 2724 [I-D.ietf-tls-dtls13] 2725 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 2726 Datagram Transport Layer Security (DTLS) Protocol Version 2727 1.3", Work in Progress, Internet-Draft, draft-ietf-tls- 2728 dtls13-43, 30 April 2021, . 2731 [I-D.mattsson-cfrg-det-sigs-with-noise] 2732 Mattsson, J. P., Thormarker, E., and S. Ruohomaa, 2733 "Deterministic ECDSA and EdDSA Signatures with Additional 2734 Randomness", Work in Progress, Internet-Draft, draft- 2735 mattsson-cfrg-det-sigs-with-noise-04, 15 February 2022, 2736 . 2739 [I-D.selander-ace-ake-authz] 2740 Selander, G., Mattsson, J. P., Vučinić, M., Richardson, 2741 M., and A. Schellenbaum, "Lightweight Authorization for 2742 Authenticated Key Exchange.", Work in Progress, Internet- 2743 Draft, draft-selander-ace-ake-authz-04, 22 October 2021, 2744 . 2747 [I-D.selander-lake-traces] 2748 Selander, G. and J. P. Mattsson, "Traces of EDHOC", Work 2749 in Progress, Internet-Draft, draft-selander-lake-traces- 2750 02, 20 October 2021, . 2753 [Norrman20] 2754 Norrman, K., Sundararajan, V., and A. Bruni, "Formal 2755 Analysis of EDHOC Key Establishment for Constrained IoT 2756 Devices", September 2020, 2757 . 2759 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 2760 Constrained-Node Networks", RFC 7228, 2761 DOI 10.17487/RFC7228, May 2014, 2762 . 2764 [RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an 2765 Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May 2766 2014, . 2768 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 2769 Kivinen, "Internet Key Exchange Protocol Version 2 2770 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 2771 2014, . 2773 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 2774 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 2775 . 2777 [RFC8937] Cremers, C., Garratt, L., Smyshlyaev, S., Sullivan, N., 2778 and C. Wood, "Randomness Improvements for Security 2779 Protocols", RFC 8937, DOI 10.17487/RFC8937, October 2020, 2780 . 2782 [SECG] "Standards for Efficient Cryptography 1 (SEC 1)", May 2783 2009, . 2785 [SIGMA] Krawczyk, H., "SIGMA - The 'SIGn-and-MAc' Approach to 2786 Authenticated Diffie-Hellman and Its Use in the IKE- 2787 Protocols (Long version)", June 2003, 2788 . 2790 [SP-800-56A] 2791 Barker, E., Chen, L., Roginsky, A., Vassilev, A., and R. 2792 Davis, "Recommendation for Pair-Wise Key-Establishment 2793 Schemes Using Discrete Logarithm Cryptography", 2794 NIST Special Publication 800-56A Revision 3, April 2018, 2795 . 2797 Appendix A. Use with OSCORE and Transfer over CoAP 2799 This appendix describes how to select EDHOC connection identifiers 2800 and derive an OSCORE security context when OSCORE is used with EDHOC, 2801 and how to transfer EDHOC messages over CoAP. 2803 A.1. Selecting EDHOC Connection Identifier 2805 This section specifies a rule for converting from EDHOC connection 2806 identifier to OSCORE Sender/Recipient ID. (An identifier is Sender 2807 ID or Recipient ID depending on from which endpoint is the point of 2808 view, see Section 3.1 of [RFC8613].) 2810 * If the EDHOC connection identifier is numeric, i.e., encoded as a 2811 CBOR integer on the wire, it is converted to a (naturally byte- 2812 string shaped) OSCORE Sender/Recipient ID equal to its CBOR 2813 encoded form. 2815 For example, a numeric C_R equal to 10 (0x0A in CBOR encoding) is 2816 converted to a (typically client) Sender ID equal to 0x0A, while a 2817 numeric C_I equal to -12 (0x2B in CBOR encoding) is converted to a 2818 (typically client) Sender ID equal to 0x2B. 2820 * If the EDHOC connection identifier is byte-valued, hence encoded 2821 as a CBOR byte string on the wire, it is converted to an OSCORE 2822 Sender/Recipient ID equal to the byte string. 2824 For example, a byte-string valued C_R equal to 0xFF (0x41FF in CBOR 2825 encoding) is converted to a (typically client) Sender ID equal to 2826 0xFF. 2828 Two EDHOC connection identifiers are called "equivalent" if and only 2829 if, by applying the conversion above, they both result in the same 2830 OSCORE Sender/Recipient ID. For example, the two EDHOC connection 2831 identifiers with CBOR encoding 0x0A (numeric) and 0x410A (byte- 2832 valued) are equivalent since they both result in the same OSCORE 2833 Sender/Recipient ID 0x0A. 2835 When EDHOC is used to establish an OSCORE security context, the 2836 connection identifiers C_I and C_R MUST NOT be equivalent. 2837 Furthermore, in case of multiple OSCORE security contexts with 2838 potentially different endpoints, to facilitate retrieval of the 2839 correct OSCORE security context, an endpoint SHOULD select an EDHOC 2840 connection identifier that when converted to OSCORE Recipient ID does 2841 not coincide with its other Recipient IDs. 2843 A.2. Deriving the OSCORE Security Context 2845 This section specifies how to use EDHOC output to derive the OSCORE 2846 security context. 2848 After successful processing of EDHOC message_3, Client and Server 2849 derive Security Context parameters for OSCORE as follows (see 2850 Section 3.2 of [RFC8613]): 2852 * The Master Secret and Master Salt are derived by using the EDHOC- 2853 Exporter interface, see Section 4.3. 2855 The EDHOC Exporter Labels for deriving the OSCORE Master Secret and 2856 the OSCORE Master Salt, are "OSCORE_Master_Secret" and 2857 "OSCORE_Master_Salt", respectively. 2859 The context parameter is h'' (0x40), the empty CBOR byte string. 2861 By default, key_length is the key length (in bytes) of the 2862 application AEAD Algorithm of the selected cipher suite for the EDHOC 2863 session. Also by default, salt_length has value 8. The Initiator 2864 and Responder MAY agree out-of-band on a longer key_length than the 2865 default and on a different salt_length. 2867 Master Secret = EDHOC-Exporter("OSCORE_Master_Secret", h'', key_length) 2868 Master Salt = EDHOC-Exporter("OSCORE_Master_Salt", h'', salt_length) 2870 * The AEAD Algorithm is the application AEAD algorithm of the 2871 selected cipher suite for the EDHOC session. 2873 * The HKDF Algorithm is the one based on the application hash 2874 algorithm of the selected cipher suite for the EDHOC session. For 2875 example, if SHA-256 is the application hash algorithm of the 2876 selected cipher suite, HKDF SHA-256 is used as HKDF Algorithm in 2877 the OSCORE Security Context. 2879 * In case the Client is Initiator and the Server is Responder, the 2880 Client's OSCORE Sender ID and the Server's OSCORE Sender ID are 2881 determined from the EDHOC connection identifiers C_R and C_I for 2882 the EDHOC session, respectively, by applying the conversion in 2883 Appendix A.1. The reverse applies in case the Client is the 2884 Responder and the Server is the Initiator. 2886 Client and Server use the parameters above to establish an OSCORE 2887 Security Context, as per Section 3.2.1 of [RFC8613]. 2889 From then on, Client and Server retrieve the OSCORE protocol state 2890 using the Recipient ID, and optionally other transport information 2891 such as the 5-tuple. 2893 A.3. Transferring EDHOC over CoAP 2895 This section specifies one instance for how EDHOC can be transferred 2896 as an exchange of CoAP [RFC7252] messages. CoAP provides a reliable 2897 transport that can preserve packet ordering and handle message 2898 duplication. CoAP can also perform fragmentation and protect against 2899 denial-of-service attacks. The underlying CoAP transport should be 2900 used in reliable mode, in particular when fragmentation is used, to 2901 avoid, e.g., situations with hanging endpoints waiting for each 2902 other. 2904 By default, the CoAP client is the Initiator and the CoAP server is 2905 the Responder, but the roles SHOULD be chosen to protect the most 2906 sensitive identity, see Section 8. According to this specification, 2907 EDHOC is transferred in POST requests and 2.04 (Changed) responses to 2908 the Uri-Path: "/.well-known/edhoc". An application may define its 2909 own path that can be discovered, e.g., using resource directory 2910 [I-D.ietf-core-resource-directory]. 2912 By default, the message flow is as follows: EDHOC message_1 is sent 2913 in the payload of a POST request from the client to the server's 2914 resource for EDHOC. EDHOC message_2 or the EDHOC error message is 2915 sent from the server to the client in the payload of a 2.04 (Changed) 2916 response. EDHOC message_3 or the EDHOC error message is sent from 2917 the client to the server's resource in the payload of a POST request. 2918 If needed, an EDHOC error message is sent from the server to the 2919 client in the payload of a 2.04 (Changed) response. Alternatively, 2920 if EDHOC message_4 is used, it is sent from the server to the client 2921 in the payload of a 2.04 (Changed) response analogously to message_2. 2923 In order to correlate a message received from a client to a message 2924 previously sent by the server, messages sent by the client are 2925 prepended with the CBOR serialization of the connection identifier 2926 which the server has chosen. This applies independently of if the 2927 CoAP server is Responder or Initiator. For the default case when the 2928 server is Responder, the prepended connection identifier is C_R, and 2929 C_I if the server is Initiator. If message_1 is sent to the server, 2930 the CBOR simple value "true" (0xf5) is sent in its place (given that 2931 the server has not selected C_R yet). 2933 These identifiers are encoded in CBOR and thus self-delimiting. They 2934 are sent in front of the actual EDHOC message, and only the part of 2935 the body following the identifier is used for EDHOC processing. 2937 Consequently, the application/edhoc media type does not apply to 2938 these messages; their media type is unnamed. 2940 An example of a successful EDHOC exchange using CoAP is shown in 2941 Figure 10. In this case the CoAP Token enables correlation on the 2942 Initiator side, and the prepended C_R enables correlation on the 2943 Responder (server) side. 2945 Client Server 2946 | | 2947 +--------->| Header: POST (Code=0.02) 2948 | POST | Uri-Path: "/.well-known/edhoc" 2949 | | Payload: true, EDHOC message_1 2950 | | 2951 |<---------+ Header: 2.04 Changed 2952 | 2.04 | Content-Format: application/edhoc 2953 | | Payload: EDHOC message_2 2954 | | 2955 +--------->| Header: POST (Code=0.02) 2956 | POST | Uri-Path: "/.well-known/edhoc" 2957 | | Payload: C_R, EDHOC message_3 2958 | | 2959 |<---------+ Header: 2.04 Changed 2960 | 2.04 | 2961 | | 2963 Figure 10: Transferring EDHOC in CoAP when the Initiator is CoAP 2964 Client 2966 The exchange in Figure 10 protects the client identity against active 2967 attackers and the server identity against passive attackers. 2969 An alternative exchange that protects the server identity against 2970 active attackers and the client identity against passive attackers is 2971 shown in Figure 11. In this case the CoAP Token enables the 2972 Responder to correlate message_2 and message_3, and the prepended C_I 2973 enables correlation on the Initiator (server) side. If EDHOC 2974 message_4 is used, C_I is prepended, and it is transported with CoAP 2975 in the payload of a POST request with a 2.04 (Changed) response. 2977 Client Server 2978 | | 2979 +--------->| Header: POST (Code=0.02) 2980 | POST | Uri-Path: "/.well-known/edhoc" 2981 | | 2982 |<---------+ Header: 2.04 Changed 2983 | 2.04 | Content-Format: application/edhoc 2984 | | Payload: EDHOC message_1 2985 | | 2986 +--------->| Header: POST (Code=0.02) 2987 | POST | Uri-Path: "/.well-known/edhoc" 2988 | | Payload: C_I, EDHOC message_2 2989 | | 2990 |<---------+ Header: 2.04 Changed 2991 | 2.04 | Content-Format: application/edhoc 2992 | | Payload: EDHOC message_3 2993 | | 2995 Figure 11: Transferring EDHOC in CoAP when the Initiator is CoAP 2996 Server 2998 To protect against denial-of-service attacks, the CoAP server MAY 2999 respond to the first POST request with a 4.01 (Unauthorized) 3000 containing an Echo option [RFC9175]. This forces the initiator to 3001 demonstrate its reachability at its apparent network address. If 3002 message fragmentation is needed, the EDHOC messages may be fragmented 3003 using the CoAP Block-Wise Transfer mechanism [RFC7959]. 3005 EDHOC does not restrict how error messages are transported with CoAP, 3006 as long as the appropriate error message can to be transported in 3007 response to a message that failed (see Section 6). EDHOC error 3008 messages transported with CoAP are carried in the payload. 3010 A.3.1. Transferring EDHOC and OSCORE over CoAP 3012 When using EDHOC over CoAP for establishing an OSCORE Security 3013 Context, EDHOC error messages sent as CoAP responses MUST be sent in 3014 the payload of error responses, i.e., they MUST specify a CoAP error 3015 response code. In particular, it is RECOMMENDED that such error 3016 responses have response code either 4.00 (Bad Request) in case of 3017 client error (e.g., due to a malformed EDHOC message), or 5.00 3018 (Internal Server Error) in case of server error (e.g., due to failure 3019 in deriving EDHOC key material). The Content-Format of the error 3020 response MUST be set to application/edhoc. 3022 A method for combining EDHOC and OSCORE protocols in two round-trips 3023 is specified in [I-D.ietf-core-oscore-edhoc]. 3025 Appendix B. Compact Representation 3027 As described in Section 4.2 of [RFC6090] the x-coordinate of an 3028 elliptic curve public key is a suitable representative for the entire 3029 point whenever scalar multiplication is used as a one-way function. 3030 One example is ECDH with compact output, where only the x-coordinate 3031 of the computed value is used as the shared secret. 3033 This section defines a format for compact representation based on the 3034 Elliptic-Curve-Point-to-Octet-String Conversion defined in 3035 Section 2.3.3 of [SECG]. Using the notation from [SECG], the output 3036 is an octet string of length ceil( (log2 q) / 8 ). See [SECG] for a 3037 definition of q, M, X, xp, and ~yp. The steps in Section 2.3.3 of 3038 [SECG] are replaced by: 3040 1. Convert the field element xp to an octet string X of length ceil( 3041 (log2 q) / 8 ) octets using the conversion routine specified in 3042 Section 2.3.5 of [SECG]. 3044 2. Output M = X 3046 The encoding of the point at infinity is not supported. Compact 3047 representation does not change any requirements on validation. If a 3048 y-coordinate is required for validation or compatibily with APIs the 3049 value ~yp SHALL be set to zero. For such use, the compact 3050 representation can be transformed into the SECG point compressed 3051 format by prepending it with the single byte 0x02 (i.e., M = 0x02 || 3052 X). 3054 Using compact representation have some security benefits. An 3055 implementation does not need to check that the point is not the point 3056 at infinity (the identity element). Similarly, as not even the sign 3057 of the y-coordinate is encoded, compact representation trivially 3058 avoids so called "benign malleability" attacks where an attacker 3059 changes the sign, see [SECG]. 3061 Appendix C. Use of CBOR, CDDL and COSE in EDHOC 3063 This Appendix is intended to simplify for implementors not familiar 3064 with CBOR [RFC8949], CDDL [RFC8610], COSE 3065 [I-D.ietf-cose-rfc8152bis-struct], and HKDF [RFC5869]. 3067 C.1. CBOR and CDDL 3069 The Concise Binary Object Representation (CBOR) [RFC8949] is a data 3070 format designed for small code size and small message size. CBOR 3071 builds on the JSON data model but extends it by e.g., encoding binary 3072 data directly without base64 conversion. In addition to the binary 3073 CBOR encoding, CBOR also has a diagnostic notation that is readable 3074 and editable by humans. The Concise Data Definition Language (CDDL) 3075 [RFC8610] provides a way to express structures for protocol messages 3076 and APIs that use CBOR. [RFC8610] also extends the diagnostic 3077 notation. 3079 CBOR data items are encoded to or decoded from byte strings using a 3080 type-length-value encoding scheme, where the three highest order bits 3081 of the initial byte contain information about the major type. CBOR 3082 supports several different types of data items, in addition to 3083 integers (int, uint), simple values, byte strings (bstr), and text 3084 strings (tstr), CBOR also supports arrays [] of data items, maps {} 3085 of pairs of data items, and sequences [RFC8742] of data items. Some 3086 examples are given below. 3088 The EDHOC specification sometimes use CDDL names in CBOR dignostic 3089 notation as in e.g., << ID_CRED_R, ? EAD_2 >>. This means that EAD_2 3090 is optional and that ID_CRED_R and EAD_2 should be substituted with 3091 their values before evaluation. I.e., if ID_CRED_R = { 4 : h'' } and 3092 EAD_2 is omitted then << ID_CRED_R, ? EAD_2 >> = << { 4 : h'' } >>, 3093 which encodes to 0x43a10440. 3095 For a complete specification and more examples, see [RFC8949] and 3096 [RFC8610]. We recommend implementors to get used to CBOR by using 3097 the CBOR playground [CborMe]. 3099 Diagnostic Encoded Type 3100 ------------------------------------------------------------------ 3101 1 0x01 unsigned integer 3102 24 0x1818 unsigned integer 3103 -24 0x37 negative integer 3104 -25 0x3818 negative integer 3105 true 0xf5 simple value 3106 h'' 0x40 byte string 3107 h'12cd' 0x4212cd byte string 3108 '12cd' 0x4431326364 byte string 3109 "12cd" 0x6431326364 text string 3110 { 4 : h'cd' } 0xa10441cd map 3111 << 1, 2, true >> 0x430102f5 byte string 3112 [ 1, 2, true ] 0x830102f5 array 3113 ( 1, 2, true ) 0x0102f5 sequence 3114 1, 2, true 0x0102f5 sequence 3115 ------------------------------------------------------------------ 3117 C.2. CDDL Definitions 3119 This sections compiles the CDDL definitions for ease of reference. 3121 suites = [ 2* int ] / int 3123 ead = 1* ( 3124 ead_label : int, 3125 ead_value : any, 3126 ) 3128 message_1 = ( 3129 METHOD : int, 3130 SUITES_I : suites, 3131 G_X : bstr, 3132 C_I : bstr / int, 3133 ? EAD_1 : ead, 3134 ) 3136 message_2 = ( 3137 G_Y_CIPHERTEXT_2 : bstr, 3138 C_R : bstr / int, 3139 ) 3141 message_3 = ( 3142 CIPHERTEXT_3 : bstr, 3143 ) 3145 message_4 = ( 3146 CIPHERTEXT_4 : bstr, 3147 ) 3149 error = ( 3150 ERR_CODE : int, 3151 ERR_INFO : any, 3152 ) 3154 info = ( 3155 transcript_hash : bstr, 3156 label : tstr, 3157 context : bstr, 3158 length : uint, 3159 ) 3161 C.3. COSE 3163 CBOR Object Signing and Encryption (COSE) 3164 [I-D.ietf-cose-rfc8152bis-struct] describes how to create and process 3165 signatures, message authentication codes, and encryption using CBOR. 3166 COSE builds on JOSE, but is adapted to allow more efficient 3167 processing in constrained devices. EDHOC makes use of COSE_Key, 3168 COSE_Encrypt0, and COSE_Sign1 objects in the message processing: 3170 * ECDH ephemeral public keys of type EC2 or OKP in message_1 and 3171 message_2 consist of the COSE_Key parameter named 'x', see 3172 Section 7.1 and 7.2 of [I-D.ietf-cose-rfc8152bis-algs] 3174 * The ciphertexts in message_3 and message_4 consist of a subset of 3175 the single recipient encrypted data object COSE_Encrypt0, which is 3176 described in Sections 5.2-5.3 of 3177 [I-D.ietf-cose-rfc8152bis-struct]. The ciphertext is computed 3178 over the plaintext and associated data, using an encryption key 3179 and an initialization vector. The associated data is an 3180 Enc_structure consisting of protected headers and externally 3181 supplied data (external_aad). COSE constructs the input to the 3182 AEAD [RFC5116] for message_i (i = 3 or 4, see Section 5.4 and 3183 Section 5.5, respectively) as follows: 3185 - Secret key K = K_i 3187 - Nonce N = IV_i 3189 - Plaintext P for message_i 3191 - Associated Data A = [ "Encrypt0", h'', TH_i ] 3193 * Signatures in message_2 of method 0 and 2, and in message_3 of 3194 method 0 and 1, consist of a subset of the single signer data 3195 object COSE_Sign1, which is described in Sections 4.2-4.4 of 3196 [I-D.ietf-cose-rfc8152bis-struct]. The signature is computed over 3197 a Sig_structure containing payload, protected headers and 3198 externally supplied data (external_aad) using a private signature 3199 key and verified using the corresponding public signature key. 3200 For COSE_Sign1, the message to be signed is: 3202 [ "Signature1", protected, external_aad, payload ] 3204 where protected, external_aad and payload are specified in 3205 Section 5.3 and Section 5.4. 3207 Different header parameters to identify X.509 or C509 certificates by 3208 reference are defined in [I-D.ietf-cose-x509] and 3209 [I-D.ietf-cose-cbor-encoded-cert]: 3211 * by a hash value with the 'x5t' or 'c5t' parameters, respectively: 3213 - ID_CRED_x = { 34 : COSE_CertHash }, for x = I or R, 3215 - ID_CRED_x = { TBD3 : COSE_CertHash }, for x = I or R; 3217 * or by a URI with the 'x5u' or 'c5u' parameters, respectively: 3219 - ID_CRED_x = { 35 : uri }, for x = I or R, 3221 - ID_CRED_x = { TBD4 : uri }, for x = I or R. 3223 When ID_CRED_x does not contain the actual credential, it may be very 3224 short, e.g., if the endpoints have agreed to use a key identifier 3225 parameter 'kid': 3227 * ID_CRED_x = { 4 : key_id_x }, where key_id_x : kid, for x = I or 3228 R. 3230 Note that a COSE header map can contain several header parameters, 3231 for example { x5u, x5t } or { kid, kid_context }. 3233 ID_CRED_x MAY also identify the authentication credential by value. 3234 For example, a certificate chain can be transported in ID_CRED_x with 3235 COSE header parameter c5c or x5chain, defined in 3236 [I-D.ietf-cose-cbor-encoded-cert] and [I-D.ietf-cose-x509] and 3237 credentials of type CWT and CCS can be transported with the COSE 3238 header parameters registered in Section 9.6. 3240 Appendix D. Applicability Template 3242 This appendix contains a rudimentary example of an applicability 3243 statement, see Section 3.9. 3245 For use of EDHOC in the XX protocol, the following assumptions are 3246 made: 3248 1. Transfer in CoAP as specified in Appendix A.3 with requests 3249 expected by the CoAP server (= Responder) at /app1-edh, no 3250 Content-Format needed. 3252 2. METHOD = 1 (I uses signature key, R uses static DH key.) 3254 3. CRED_I is an IEEE 802.1AR IDevID encoded as a C509 certificate of 3255 type 0 [I-D.ietf-cose-cbor-encoded-cert]. 3257 * R acquires CRED_I out-of-band, indicated in EAD_1. 3259 * ID_CRED_I = {4: h''} is a 'kid' with value empty CBOR byte 3260 string. 3262 4. CRED_R is a CCS of type OKP as specified in Section 3.5.3. 3264 * The CBOR map has parameters 1 (kty), -1 (crv), and -2 3265 (x-coordinate). 3267 * ID_CRED_R is {TBD2 : CCS}. Editor's note: TBD2 is the COSE 3268 header parameter value of 'kccs', see Section 9.6 3270 5. External authorization data is defined and processed as specified 3271 in [I-D.selander-ace-ake-authz]. 3273 6. EUI-64 used as identity of endpoint. 3275 7. No use of message_4: the application sends protected messages 3276 from R to I. 3278 Appendix E. EDHOC Message Deduplication 3280 EDHOC by default assumes that message duplication is handled by the 3281 transport, in this section exemplified with CoAP. 3283 Deduplication of CoAP messages is described in Section 4.5 of 3284 [RFC7252]. This handles the case when the same Confirmable (CON) 3285 message is received multiple times due to missing acknowledgement on 3286 CoAP messaging layer. The recommended processing in [RFC7252] is 3287 that the duplicate message is acknowledged (ACK), but the received 3288 message is only processed once by the CoAP stack. 3290 Message deduplication is resource demanding and therefore not 3291 supported in all CoAP implementations. Since EDHOC is targeting 3292 constrained environments, it is desirable that EDHOC can optionally 3293 support transport layers which does not handle message duplication. 3294 Special care is needed to avoid issues with duplicate messages, see 3295 Section 5.1. 3297 The guiding principle here is similar to the deduplication processing 3298 on CoAP messaging layer: a received duplicate EDHOC message SHALL NOT 3299 result in a response consisting of another instance of the next EDHOC 3300 message. The result MAY be that a duplicate EDHOC response is sent, 3301 provided it is still relevant with respect the current protocol 3302 state. In any case, the received message MUST NOT be processed more 3303 than once in the same EDHOC session. This is called "EDHOC message 3304 deduplication". 3306 An EDHOC implementation MAY store the previously sent EDHOC message 3307 to be able to resend it. An EDHOC implementation MAY keep the 3308 protocol state to be able to recreate the previously sent EDHOC 3309 message and resend it. The previous message or protocol state MUST 3310 NOT be kept longer than what is required for retransmission, for 3311 example, in the case of CoAP transport, no longer than the 3312 EXCHANGE_LIFETIME (see Section 4.8.2 of [RFC7252]). 3314 Note that the requirements in Section 5.1 still apply because 3315 duplicate messages are not processed by the EDHOC state machine: 3317 * EDHOC messages SHALL be processed according to the current 3318 protocol state. 3320 * Different instances of the same message MUST NOT be processed in 3321 one session. 3323 Appendix F. Transports Not Natively Providing Correlation 3325 Protocols that do not natively provide full correlation between a 3326 series of messages can send the C_I and C_R identifiers along as 3327 needed. 3329 The transport over CoAP (Appendix A.3) can serve as a blueprint for 3330 other server-client protocols: The client prepends the C_x which the 3331 server selected (or, for message 1, the CBOR simple value 'true' 3332 which is not a valid C_x) to any request message it sends. The 3333 server does not send any such indicator, as responses are matched to 3334 request by the client-server protocol design. 3336 Protocols that do not provide any correlation at all can prescribe 3337 prepending of the peer's chosen C_x to all messages. 3339 Appendix G. Change Log 3341 RFC Editor: Please remove this appendix. 3343 * From -11 to -12: 3345 - Clarified applicability to KEMs 3347 - Clarified use of COSE header parameters 3349 - Updates on MTI 3351 - Updated security considerations 3353 - New section on PQC 3355 - Removed duplicate definition of cipher suites 3357 - Explanations of use of COSE moved to Appendix C.3 3359 - Updated internal references 3361 * From -10 to -11: 3363 - Restructured section on authentication parameters 3365 - Changed UCCS to CCS 3367 - Changed names and description of COSE header parameters for 3368 CWT/CCS 3370 - Changed several of the KDF and Exporter labels 3372 - Removed edhoc_aead_id from info (already in transcript_hash) 3374 - Added MTI section 3376 - EAD: changed CDDL names and added value type to registry 3378 - Updated Figures 1, 2, and 3 3380 - Some correction and clarifications 3382 - Added core.edhoc to CoRE Resource Type registry 3384 * From -09 to -10: 3386 - SUITES_I simplified to only contain the selected and more 3387 preferred suites 3389 - Info is a CBOR sequence and context is a bstr 3391 - Added kid to UCCS example 3393 - Separate header parameters for CWT and UCCS 3395 - CWT Confirmation Method kid extended to bstr / int 3397 * From -08 to -09: 3399 - G_Y and CIPHERTEXT_2 are now included in one CBOR bstr 3401 - MAC_2 and MAC_3 are now generated with EDHOC-KDF 3403 - Info field "context" is now general and explicit in EDHOC-KDF 3405 - Restructured Section 4, Key Derivation 3407 - Added EDHOC MAC length to cipher suite for use with static DH 3409 - More details on the use of CWT and UCCS 3410 - Restructured and clarified Section 3.5, Authentication 3411 Parameters 3413 - Replaced 'kid2' with extension of 'kid' 3415 - EAD encoding now supports multiple ead types in one message 3417 - Clarified EAD type 3419 - Updated message sizes 3421 - Replaced "perfect forward secrecy" with "forward secrecy" 3423 - Updated security considerations 3425 - Replaced prepended 'null' with 'true' in the CoAP transport of 3426 message_1 3428 - Updated CDDL definitions 3430 - Expanded on the use of COSE 3432 * From -07 to -08: 3434 - Prepended C_x moved from the EDHOC protocol itself to the 3435 transport mapping 3437 - METHOD_CORR renamed to METHOD, corr removed 3439 - Removed bstr_identifier and use bstr / int instead; C_x can now 3440 be int without any implied bstr semantics 3442 - Defined COSE header parameter 'kid2' with value type bstr / int 3443 for use with ID_CRED_x 3445 - Updated message sizes 3447 - New cipher suites with AES-GCM and ChaCha20 / Poly1305 3449 - Changed from one- to two-byte identifier of CNSA compliant 3450 suite 3452 - Separate sections on transport and connection id with further 3453 sub-structure 3455 - Moved back key derivation for OSCORE from draft-ietf-core- 3456 oscore-edhoc 3458 - OSCORE and CoAP specific processing moved to new appendix 3460 - Message 4 section moved to message processing section 3462 * From -06 to -07: 3464 - Changed transcript hash definition for TH_2 and TH_3 3466 - Removed "EDHOC signature algorithm curve" from cipher suite 3468 - New IANA registry "EDHOC Exporter Label" 3470 - New application defined parameter "context" in EDHOC-Exporter 3472 - Changed normative language for failure from MUST to SHOULD send 3473 error 3475 - Made error codes non-negative and 0 for success 3477 - Added detail on success error code 3479 - Aligned terminology "protocol instance" -> "session" 3481 - New appendix on compact EC point representation 3483 - Added detail on use of ephemeral public keys 3485 - Moved key derivation for OSCORE to draft-ietf-core-oscore-edhoc 3487 - Additional security considerations 3489 - Renamed "Auxililary Data" as "External Authorization Data" 3491 - Added encrypted EAD_4 to message_4 3493 * From -05 to -06: 3495 - New section 5.2 "Message Processing Outline" 3497 - Optional inital byte C_1 = null in message_1 3499 - New format of error messages, table of error codes, IANA 3500 registry 3502 - Change of recommendation transport of error in CoAP 3504 - Merge of content in 3.7 and appendix C into new section 3.7 3505 "Applicability Statement" 3507 - Requiring use of deterministic CBOR 3509 - New section on message deduplication 3511 - New appendix containin all CDDL definitions 3513 - New appendix with change log 3515 - Removed section "Other Documents Referencing EDHOC" 3517 - Clarifications based on review comments 3519 * From -04 to -05: 3521 - EDHOC-Rekey-FS -> EDHOC-KeyUpdate 3523 - Clarification of cipher suite negotiation 3525 - Updated security considerations 3527 - Updated test vectors 3529 - Updated applicability statement template 3531 * From -03 to -04: 3533 - Restructure of section 1 3535 - Added references to C509 Certificates 3537 - Change in CIPHERTEXT_2 -> plaintext XOR KEYSTREAM_2 (test 3538 vector not updated) 3540 - "K_2e", "IV_2e" -> KEYSTREAM_2 3542 - Specified optional message 4 3544 - EDHOC-Exporter-FS -> EDHOC-Rekey-FS 3546 - Less constrained devices SHOULD implement both suite 0 and 2 3548 - Clarification of error message 3550 - Added exporter interface test vector 3552 * From -02 to -03: 3554 - Rearrangements of section 3 and beginning of section 4 3555 - Key derivation new section 4 3557 - Cipher suites 4 and 5 added 3559 - EDHOC-EXPORTER-FS - generate a new PRK_4x3m from an old one 3561 - Change in CIPHERTEXT_2 -> COSE_Encrypt0 without tag (no change 3562 to test vector) 3564 - Clarification of error message 3566 - New appendix C applicability statement 3568 * From -01 to -02: 3570 - New section 1.2 Use of EDHOC 3572 - Clarification of identities 3574 - New section 4.3 clarifying bstr_identifier 3576 - Updated security considerations 3578 - Updated text on cipher suite negotiation and key confirmation 3580 - Test vector for static DH 3582 * From -00 to -01: 3584 - Removed PSK method 3586 - Removed references to certificate by value 3588 Acknowledgments 3590 The authors want to thank Christian Amsuess, Alessandro Bruni, 3591 Karthikeyan Bhargavan, Timothy Claeys, Martin Disch, Loic Ferreira, 3592 Theis Groenbech Petersen, Dan Harkins, Klaus Hartke, Russ Housley, 3593 Stefan Hristozov, Alexandros Krontiris, Ilari Liusvaara, Karl 3594 Norrman, Salvador Perez, Eric Rescorla, Michael Richardson, Thorvald 3595 Sahl Joergensen, Jim Schaad, Carsten Schuermann, Ludwig Seitz, 3596 Stanislav Smyshlyaev, Valery Smyslov, Peter van der Stok, Rene 3597 Struik, Vaishnavi Sundararajan, Erik Thormarker, Marco Tiloca, Michel 3598 Veillette, and Malisa Vucinic for reviewing and commenting on 3599 intermediate versions of the draft. We are especially indebted to 3600 Jim Schaad for his continuous reviewing and implementation of 3601 different versions of the draft. 3603 Work on this document has in part been supported by the H2020 project 3604 SIFIS-Home (grant agreement 952652). 3606 Authors' Addresses 3608 Göran Selander 3609 Ericsson AB 3610 SE-164 80 Stockholm 3611 Sweden 3612 Email: goran.selander@ericsson.com 3614 John Preuß Mattsson 3615 Ericsson AB 3616 SE-164 80 Stockholm 3617 Sweden 3618 Email: john.mattsson@ericsson.com 3620 Francesca Palombini 3621 Ericsson AB 3622 SE-164 80 Stockholm 3623 Sweden 3624 Email: francesca.palombini@ericsson.com