- Home
- RFC 9528
RFC 9528: Ephemeral Diffie-Hellman Over COSE (EDHOC)
- G. Selander,
- J. Preuß Mattsson,
- F. Palombini
Abstract
This document specifies Ephemeral Diffie-Hellman Over COSE (EDHOC), a very compact and lightweight authenticated Diffie-Hellman key exchange with ephemeral keys. EDHOC provides mutual authentication, forward secrecy, and identity protection. EDHOC is intended for usage in constrained scenarios, and a main use case is to establish an Object Security for Constrained RESTful Environments (OSCORE) security context. By reusing CBOR Object Signing and Encryption (COSE) for cryptography, Concise Binary Object Representation (CBOR) for encoding, and Constrained Application Protocol (CoAP) for transport, the additional code size can be kept very low.¶
Status of This Memo
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
1.1. Motivation
Many Internet of Things (IoT) deployments require technologies that are highly performant in constrained environments [RFC7228]. IoT devices may be constrained in various ways, including memory, storage, processing capacity, and power. The connectivity for these settings may also exhibit constraints, such as unreliable and lossy channels, highly restricted bandwidth, and dynamic topology. The IETF has acknowledged this problem by standardizing a range of lightweight protocols and enablers designed for the IoT, including CoAP [RFC7252], CBOR [RFC8949], and Static Context Header Compression (SCHC) [RFC8724].¶
The need for special protocols targeting constrained IoT deployments extends also to the security domain [LAKE-REQS]. Important characteristics in constrained environments are the number of round trips and protocol message sizes, which (if kept low) can contribute to good performance by enabling transport over a small number of radio frames, reducing latency due to fragmentation, duty cycles, etc. Another important criterion is code size, which may be prohibitively large for certain deployments due to device capabilities or network load during firmware updates. Some IoT deployments also need to support a variety of underlying transport technologies, potentially even with a single connection.¶
Some security solutions for such settings exist already. COSE [RFC9052] specifies basic application
This document specifies Ephemeral Diffie-Hellman Over COSE (EDHOC), a lightweight authenticated key exchange protocol providing good security properties including forward secrecy, identity protection, and cipher suite negotiation. Authentication can be based on raw public keys (RPKs) or public key certificates and requires the application to provide input on how to verify that endpoints are trusted. This specification supports the referencing of credentials in order to reduce message overhead, but credentials may alternatively be embedded in the messages. EDHOC does not currently support Pre-Shared Key (PSK) authentication as authentication with static Diffie-Hellman (DH) public keys by reference produces equally small message sizes but with much simpler key distribution and identity protection.¶
EDHOC makes use of known protocol constructions, such as SIGn-and-MAc [SIGMA], the Noise XX pattern [Noise], and Extract
EDHOC is designed for highly constrained settings, making it especially suitable for low-power networks [RFC8376] such as Cellular IoT, IPv6 over the TSCH mode of IEEE 802.15.4e (6TiSCH), and LoRaWAN. A main objective for EDHOC is to be a lightweight authenticated key exchange for OSCORE, i.e., to provide authentication and session key establishment for IoT use cases such as those built on CoAP [RFC7252] involving 'things' with embedded microcontroller
A typical setting is when one of the endpoints is constrained or in a constrained network and the other endpoint is a node on the Internet (such as a mobile phone). Thing-to-thing interactions over constrained networks are also relevant since both endpoints would then benefit from the lightweight properties of the protocol. EDHOC could, e.g., be run when a device connects for the first time or to establish fresh keys that are not revealed by a later compromise of the long-term keys.¶
1.2. Message Size Examples
Examples of EDHOC message sizes are shown in Table 1, which use different kinds of authentication keys and COSE header parameters for identification, including static Diffie-Hellman keys or signature keys, either in CWT/CCS [RFC8392] identified by a key identifier using 'kid' [RFC9052] or in X.509 certificates identified by a hash value using 'x5t' [RFC9360]. EDHOC always uses ephemeral
| Static DH Keys | Signature Keys | |||
|---|---|---|---|---|
| kid | x5t | kid | x5t | |
| message_ |
37 | 37 | 37 | 37 |
| message_ |
45 | 58 | 102 | 115 |
| message_ |
19 | 33 | 77 | 90 |
| Total | 101 | 128 | 216 | 242 |
1.3. Document Structure
The remainder of the document is organized as follows: Section 2 outlines EDHOC authenticated with signature keys; Section 3 describes the protocol elements of EDHOC, including formatting of the ephemeral public keys; Section 4 specifies the key derivation; Section 5 specifies message processing for EDHOC authenticated with signature keys or static Diffie-Hellman keys; Section 6 describes the error messages; Section 7 describes EDHOC support for transport that does not handle message duplication; and Section 8 lists compliance requirements. Note that normative text is also used in appendices, in particular Appendix A.¶
1.4. Terminology and Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Readers are expected to be familiar with the terms and
concepts described in CBOR [RFC8949], CBOR
Sequences [RFC8742], COSE Structures and
Processing [RFC9052], COSE Algorithms [RFC9053], CWT and CCS [RFC8392], and the Concise Data Definition Language
(CDDL) [RFC8610], which is used to express
CBOR data structures. Examples of CBOR and CDDL are provided
in Appendix C.1. When referring to CBOR, this
specification always refers to Deterministical
2. EDHOC Outline
EDHOC supports different authentication methods of the ephemeral
SIGn-and-MAc (SIGMA) is a family of theoretical protocols with a number of variants [SIGMA]. Like in Internet Key Exchange Protocol Version 2 (IKEv2) [RFC7296] and (D)TLS 1.3 [RFC8446] [RFC9147], EDHOC authenticated with signature keys is built on a variant of the SIGMA protocol, SIGMA-I, which provides identity protection against active attacks on the party initiating the protocol. Also like IKEv2, EDHOC implements the MAC-then-Sign variant of the SIGMA-I protocol. The message flow (excluding an optional fourth message) is shown in Figure 1.¶
The parties exchanging messages in an EDHOC session are called the Initiator (I) and the Responder (R), where the Initiator sends message_
- G_
X and G_ Y are the Elliptic Curve Diffie-Hellman (ECDH) ephemeral public keys of I and R, respectively.¶ - CRED_
I and CRED_ R are the authentication credentials containing the public authentication keys of I and R, respectively.¶ - ID_
CRED_ I and ID_ CRED_ R are used to identify and optionally transport the credentials of I and R, respectively.¶ - Sig(I; . ) and Sig(R; . ) denote signatures made with the private authentication key of I and R, respectively.¶
- Enc(), AEAD(), and MAC() denote encryption, Authenticated Encryption with Associated Data, and Message Authentication Code -- crypto algorithms applied with keys derived from one or more shared secrets calculated during the protocol.¶
In order to create a "full-fledged" protocol, some additional protocol elements are needed. This specification adds:¶
- transcript hashes (hashes of message data), TH_
2, TH_ 3, and TH_ 4, used for key derivation and as additional authenticated data,¶ - computationally independent keys derived from the ECDH shared secret and used for authenticated encryption of different messages,¶
- an optional fourth message giving key confirmation to I in deployments where no protected application data is sent from R to I,¶
- a keying material exporter and a key update function with forward secrecy,¶
- secure negotiation of the cipher suite,¶
- method types, error handling, and padding,¶
- the selection of connection identifiers, C_
I and C_ R, which may be used in EDHOC to identify the protocol state, and¶ - transport of external authorization data.¶
EDHOC is designed to encrypt and integrity protect as much information as possible. Symmetric keys and random material used in EDHOC are derived using EDHOC_
To simplify for implementors, the use of CBOR, CDDL, and COSE in EDHOC is summarized in Appendix C. Test vectors, including CBOR diagnostic notation, are provided in [RFC9529].¶
3. Protocol Elements
3.1. General
The EDHOC protocol consists of three mandatory messages
Application data may be protected using the agreed application algorithms (AEAD, hash) in the selected cipher suite (see Section 3.6), and the application can make use of the established connection identifiers C_
The Initiator can derive symmetric application keys after creating EDHOC message_
3.2. Method
The data item METHOD in message_
The Initiator and Responder need to have agreed on a single method to be used for EDHOC; see Section 3.9.¶
| Method Type Value | Initiator Authentication Key | Responder Authentication Key |
|---|---|---|
| 0 | Signature Key | Signature Key |
| 1 | Signature Key | Static DH Key |
| 2 | Static DH Key | Signature Key |
| 3 | Static DH Key | Static DH Key |
| 23 | Reserved | Reserved |
EDHOC does not have a dedicated message field to indicate the protocol version. Breaking changes to EDHOC can be introduced by specifying and registering new methods.¶
3.3. Connection Identifiers
EDHOC includes the selection of connection identifiers
Connection identifiers may be used to correlate EDHOC messages and facilitate the retrieval of protocol state during an EDHOC session (see Section 3.4) or may be used in applications of EDHOC, e.g., in OSCORE (see Section 3.3.3). The connection identifiers do not have any cryptographic purpose in EDHOC and only facilitate the retrieval of security data associated with the protocol state.¶
Connection identifiers in EDHOC are intrinsically byte strings. Most constrained devices only have a few connections for which short identifiers may be sufficient. In some cases, minimum length identifiers are necessary to comply with overhead requirements. However, CBOR byte strings -- with the exception of the empty byte string h'', which encodes as one byte (0x40) -- are encoded as two or more bytes. To enable one-byte encoding of certain byte strings while maintaining CBOR encoding, EDHOC represents certain identifiers as CBOR integers on the wire; see Section 3.3.2.¶
3.3.1. Selection of Connection Identifiers
C_
If connection identifiers are used by an application protocol for which EDHOC establishes keys, then the selected connection identifiers SHALL adhere to the requirements for that protocol; see Section 3.3.3 for an example.¶
3.3.2. Representation of Byte String Identifiers
To allow identifiers with minimal overhead on the wire, certain byte strings used in connection identifiers and credential identifiers (see Section 3.5.3) are defined to have integer representations
The integers with one-byte CBOR encoding are -24, ..., 23; see Figure 3.¶
Integer: -24 -23 ... -11 ... -2 -1 0 1 ... 15 ... 23 Encoding: 37 36 ... 2A ... 21 20 00 01 ... 0F ... 17
The byte strings that coincide with a one-byte CBOR encoding of an integer MUST be represented by the CBOR encoding of that integer. Other byte strings are simply encoded as CBOR byte strings.¶
For example:¶
- 0x21 is represented by 0x21 (CBOR encoding of the integer -2), not by 0x4121 (CBOR encoding of the byte string 0x21).¶
- 0x0D is represented by 0x0D (CBOR encoding of the integer 13), not by 0x410D (CBOR encoding of the byte string 0x0D).¶
- 0x18 is represented by 0x4118 (CBOR encoding of the byte string 0x18).¶
- 0x38 is represented by 0x4138 (CBOR encoding of the byte string 0x38).¶
- 0xABCD is represented by 0x42ABCD (CBOR encoding of the byte string 0xABCD).¶
One may view this representation of byte strings as a transport encoding, i.e., a byte string that parses as the one-byte CBOR encoding of an integer (i.e., integer in the interval -24, ..., 23) is just copied directly into the message, and a byte string that does not is encoded as a CBOR byte string during transport.¶
3.3.3. Use of Connection Identifiers with OSCORE
For OSCORE, the choice of connection identifier results in the endpoint selecting its Recipient ID (see Section 3.1 of [RFC8613]) for which certain uniqueness requirements apply (see Section 3.3 of [RFC8613]). Therefore, the Initiator and Responder MUST NOT select connection identifiers such that it results in the same OSCORE Recipient ID. Since the connection identifier is a byte string, it is converted to an OSCORE Recipient ID equal to the byte string.¶
Examples:¶
- A connection identifier 0xFF (represented in the EDHOC message as 0x41FF; see Section 3.3.2) is converted to the OSCORE Recipient ID 0xFF.¶
- A connection identifier 0x21 (represented in the EDHOC message as 0x21; see Section 3.3.2) is converted to the OSCORE Recipient ID 0x21.¶
3.4. Transport
Cryptographicall
EDHOC is not bound to a particular transport layer and can even be used in environments without IP. Ultimately, the application is free to choose how to transport EDHOC messages including errors. In order to avoid unnecessary message processing or protocol termination, it is RECOMMENDED to use reliable transport, such as CoAP in reliable mode, which is the default transport; see Appendix A.2. In general, the transport SHOULD handle:¶
- message loss,¶
- message duplication (see Section 7 for an alternative),¶
- flow control,¶
- congestion control,¶
- fragmentation and reassembly,¶
- demultiplexing EDHOC messages from other types of messages,¶
- denial
-of -service mitigation, and¶ - message correlation (see Section 3.4.1).¶
EDHOC does not require error-free transport since a change in message content is detected through the transcript hashes in a subsequent integrity verification; see Section 5. The transport does not require additional means to handle message reordering because of the lockstep processing of EDHOC.¶
EDHOC is designed to enable an authenticated key exchange with small messages, where the minimum message sizes are of the order illustrated in the first column of Table 1. There is no maximum message size specified by the protocol; for example, this is dependent on the size of the authentication credentials (if they are transported, see Section 3.5). The encryption of very large content in message_
The use of transport is specified in the application profile, which in particular, may specify limitations in message sizes; see Section 3.9.¶
3.4.1. EDHOC Message Correlation
Correlation between EDHOC messages is needed to facilitate the retrieval of the protocol state and security context during an EDHOC session. It is also helpful for the Responder to get an indication that a received EDHOC message is the beginning of a new EDHOC session, such that no existing protocol state or security context needs to be retrieved.¶
Correlation may be based on existing mechanisms in the transport protocol; for example, the CoAP Token may be used to correlate EDHOC messages in a CoAP response and in an associated CoAP request. The connection identifiers may also be used to correlate EDHOC messages.¶
If correlation between consecutive messages is not provided by other means, then the transport binding SHOULD mandate prepending of an appropriate connection identifier (when available from the EDHOC protocol) to the EDHOC message. If message_true (0xf5).¶
Transport of EDHOC in CoAP payloads is described in Appendix A.2, including how to use connection identifiers and message_
Note that correlation between EDHOC messages may be obtained without transport support or connection identifiers, for example, if the endpoints only accept a single instance of the protocol at a time and execute conditionally on a correct sequence of messages.¶
3.5. Authentication Parameters
EDHOC supports various settings for how the other endpoint's public key for authentication may be transported, identified, and trusted. We shall use the term "authentication key" to mean key used for authentication in general, or specifically, the public key, when there is no risk for confusion.¶
EDHOC performs the following authentication
- EDHOC transports information about credentials in ID_
CRED_ I and ID_ CRED_ R (described in Section 3.5.3). Based on this information, the authentication credentials CRED_ I and CRED_ R (described in Section 3.5.2) can be obtained. EDHOC may also transport certain authentication -related information as external authorization data (see Section 3.8).¶ -
EDHOC uses the authentication credentials in two ways (see Sections 5.3.2 and 5.4.2):¶
Other authentication
Note that the type of authentication key, the type of authentication credential, and the identification of the credential have a large impact on the message size. For example, the Signature_
3.5.1. Authentication Keys
The authentication key MUST be a signature key or a static Diffie-Hellman key. The Initiator and Responder MAY use different types of authentication keys, e.g., one uses a signature key and the other uses a static Diffie-Hellman key.¶
The authentication key algorithm needs to be compatible with the method and the selected cipher suite (see Section 3.6). The authentication key algorithm needs to be compatible with the EDHOC key exchange algorithm when static Diffie-Hellman authentication is used and compatible with the EDHOC signature algorithm when signature authentication is used.¶
Note that for most signature algorithms, the signature is determined jointly by the signature algorithm and the authentication key algorithm. When using static Diffie-Hellman keys, the Initiator's and the Responder's private authentication keys are denoted as I and R, respectively, and the public authentication keys are denoted G_
For X.509 certificates, the authentication key is represented by a Subject
3.5.2. Authentication Credentials
The authentication credentials, CRED_
EDHOC relies on COSE for identification of credentials (see Section 3.5.3), for example, X.509 certificates [RFC9360], C509 certificates [C509-CERTS], CWTs [RFC8392], and CCSs [RFC8392]. When the identified credential is a chain or a bag, the authentication credential CRED_
Since CRED_
- When the authentication credential is an X.509 certificate, CRED_
x SHALL be the DER-encoded certificate, encoded as a bstr [RFC9360].¶ - When the authentication credential is a C509 certificate, CRED_
x SHALL be the C509 certificate [C509-CERTS].¶ - When the authentication credential is a CWT including a COSE_
Key, CRED_ x SHALL be the untagged CWT.¶ -
When the authentication credential includes a COSE_
Key but is not in a CWT, CRED_ x SHALL be an untagged CCS. This is how RPKs are encoded, see Figure 4 for an example.¶ - Naked COSE_
Keys are thus dressed as CCS when used in EDHOC, in its simplest form by prefixing the COSE_ Key with 0xA108A101 (a map with a 'cnf' claim). In that case, the resulting authentication credential contains no other identity than the public key itself; see Appendix D.2.¶
- Naked COSE_
An example of CRED_
{ /CCS/
2 : "42-50-31-FF-EF-37-32-39", /sub/
8 : { /cnf/
1 : { /COSE_Key/
1 : 1, /kty/
2 : h'00', /kid/
-1 : 4, /crv/
-2 : h'b1a3e89460e88d3a8d54211dc95f0b90 /x/
3ff205eb71912d6db8f4af980d2db83a'
}
}
}
3.5.3. Identification of Credentials
The ID_
- ID_
CRED_ R is intended to facilitate for the Initiator retrieving the authentication credential CRED_ R and the authentication key of R.¶ - ID_
CRED_ I is intended to facilitate for the Responder retrieving the authentication credential CRED_ I and the authentication key of I.¶
ID_
EDHOC relies on COSE for identification of credentials and supports all credential types for which COSE header parameters are defined, including X.509 certificates [RFC9360], C509 certificates [C509-CERTS], CWTs (Section 3.5.3.1) and CCSs (Section 3.5.3.1).¶
ID_
Example: X.509 certificates can be identified by a hash value using the 'x5t' parameter; see Section 2 of [RFC9360]:¶
- ID_
CRED_ x = { 34 : COSE_ Cert Hash }, for x = I or R¶
Example: CWT or CCS can be identified by a key identifier using the 'kid' parameter; see Section 3.1 of [RFC9052]:¶
- ID_
CRED_ x = { 4 : kid_ x }, where kid_ x : kid, for x = I or R¶
Note that COSE header parameters in ID_
As stated in Section 3.1 of [RFC9052], applications MUST NOT assume that 'kid' values are unique and several keys associated with a 'kid' may need to be checked before the correct one is found. Applications might use additional information such as 'kid context' or lower layers to determine which key to try first. Applications should strive to make ID_
See Appendix C.3 for more examples.¶
3.5.3.1. COSE Header Parameters for CWT and CWT Claims Set
This document registers two new COSE header parameters, 'kcwt' and 'kccs', for use with CBOR Web Token (CWT) [RFC8392] and CWT Claims Set (CCS) [RFC8392], respectively. The CWT/CCS MUST contain a COSE_
CWTs sent in 'kcwt' are protected using a MAC or a signature and are similar to a certificate (when used with public key cryptography) or a Kerberos ticket (when used with symmetric key cryptography). CCSs sent in 'kccs' are not protected and are therefore similar to raw public keys or self-signed certificates.¶
Security considerations for 'kcwt' and 'kccs' are made in Section 9.8.¶
3.5.3.2. Compact Encoding of ID_CRED Fields for 'kid'
To comply with the Lightweight Authenticated Key Exchange (LAKE) message size requirements (see [LAKE-REQS]), two optimizations are made for the case when ID_
- The CBOR map { 4 : kid_
x } is replaced by the byte string kid_ x .¶ - The representation of identifiers specified in Section 3.3.2 is applied to kid_
x .¶
These optimizations MUST be applied if and only if ID_
- For ID_
CRED_ x = { 4 : h'FF' }, the encoding in PLAINTEXT_ y is not the CBOR map 0xA10441FF but the CBOR byte string h'FF', i.e., 0x41FF.¶ - For ID_
CRED_ x = { 4 : h'21' }, the encoding in PLAINTEXT_ y is neither the CBOR map 0xA1044121 nor the CBOR byte string h'21', i.e., 0x4121, but the CBOR integer 0x21.¶
3.6. Cipher Suites
An EDHOC cipher suite consists of an ordered set of algorithms from the "COSE Algorithms" and "COSE Elliptic Curves" registries as well as the EDHOC MAC length. All algorithm names and definitions follow COSE Algorithms [RFC9053]. Note that COSE sometimes uses peculiar names such as ES256 for Elliptic Curve Digital Signature Algorithm (ECDSA) with SHA-256, A128 for AES-128, and Ed25519 for the curve edwards25519. Algorithms need to be specified with enough parameters to make them completely determined. The EDHOC MAC length MUST be at least 8 bytes. Any cryptographic algorithm used in the COSE header parameters in ID_
EDHOC supports all signature algorithms defined by COSE. Just like in (D)TLS 1.3 [RFC8446] [RFC9147] and IKEv2 [RFC7296], a signature in COSE is determined jointly by the signature algorithm and the authentication key algorithm; see Section 3.5.1. The exact details of the authentication key algorithm depend on the type of authentication credential. COSE supports different formats for storing the public authentication keys including COSE_
An EDHOC cipher suite consists of the following parameters:¶
- EDHOC AEAD algorithm,¶
- EDHOC hash algorithm,¶
- EDHOC MAC length in bytes (Static DH),¶
- EDHOC key exchange algorithm (ECDH curve),¶
- EDHOC signature algorithm,¶
- application AEAD algorithm, and¶
- application hash algorithm.¶
Each cipher suite is identified with a predefined integer label.¶
EDHOC can be used with all algorithms and curves defined for COSE. Implementations can either use any combination of COSE algorithms and parameters to define their own private cipher suite or use one of the predefined cipher suites. Private cipher suites can be identified with any of the four values: -24, -23, -22, and -21. The predefined cipher suites are listed in the IANA registry (Section 10.2) with the initial content outlined here:¶
-
Cipher suites 0-3, based on AES-CCM, are intended for constrained IoT where message overhead is a very important factor. Note that AES
-CCM -16 -64 -128 and AES -CCM -16 -128 -128 are compatible with the IEEE AES-CCM* mode of operation defined in Annex B of [IEEE .802 ].¶.15 .4 -2015 - Cipher suites 1 and 3 use a larger tag length (128 bits) in EDHOC than in the application AEAD algorithm (64 bits).¶
- Cipher suites 4 and 5, based on ChaCha20, are intended for less constrained applications and only use 128-bit tag lengths.¶
- Cipher suite 6, based on AES-GCM, is for general non-constrained applications. It consists of high
-performance algorithms that are widely used in non-constrained applications.¶ - Cipher suites 24 and 25 are intended for high security applications such as government use and financial applications. These cipher suites do not share any algorithms. Cipher suite 24 consists of algorithms from the Commercial National Security Algorithm (CNSA) 1.0 suite [CNSA].¶
The different methods (Section 3.2) use the same cipher suites, but some algorithms are not used in some methods. The EDHOC signature algorithm is not used in methods without signature authentication.¶
The Initiator needs to have a list of cipher suites it supports in order of preference. The Responder needs to have a list of cipher suites it supports. SUITES_
3.7. Ephemeral Public Keys
The ephemeral public keys in EDHOC
3.8. External Authorization Data (EAD)
In order to reduce round trips and the number of messages or to simplify processing, external security applications may be integrated into EDHOC by transporting authorization
EDHOC allows processing of external authorization data (EAD) to be defined in a separate specification and sent in dedicated fields of the four EDHOC messages: EAD_
Each EAD field, EAD_
A security application may register one or more EAD labels (see Section 10.5) and specify the associated processing and security considerations. The IANA registry contains the absolute value of the ead_
An EAD item can be either critical or non-critical, determined by the sign of the ead_
If an endpoint receives a critical EAD item it does not recognize or a critical EAD item that contains information that it cannot process, then the endpoint MUST send an EDHOC error message back as defined in Section 6, and the EDHOC session MUST be aborted. The EAD item specification defines the error processing. A non-critical EAD item can be ignored.¶
The security application registering a new EAD item needs to describe under what conditions the EAD item is critical or non-critical, and thus whether the ead_
The security application may define multiple uses of certain EAD items, e.g., the same EAD item may be used in different EDHOC messages. Multiple occurrences of an EAD item in one EAD field may also be specified, but the criticality of the repeated EAD item is expected to be the same.¶
The EAD fields of EDHOC MUST only be used with registered EAD items; see Section 10.5. Examples of the use of EAD are provided in Appendix E.¶
3.8.1. Padding
EDHOC message_
Padding is obtained by using an EAD item with ead_
-
One-byte padding (optional ead_
value omitted):¶ EAD_
x = 0x00¶ -
Two-byte padding, using the empty byte string (0x40) as ead_
value :¶ EAD_
x = 0x0040¶ -
Three-byte padding, constructed from the pseudorandomly generated ead_
value 0xe9 encoded as byte string:¶ EAD_
x = 0x0041e9¶
Multiple occurrences of EAD items with ead_
Note that padding is non-critical because the intended behavior when receiving is to ignore it.¶
3.9. Application Profile
EDHOC requires certain parameters to be agreed upon between the Initiator and Responder. Some parameters can be negotiated through the protocol execution (specifically, cipher suite; see Section 3.6), but other parameters are only communicated and may not be negotiated (e.g., which authentication method is used; see Section 3.2). Yet, other parameters need to be known out-of-band to ensure successful completion, e.g., whether message_
The purpose of an application profile is to describe the intended use of EDHOC to allow for the relevant processing and verifications to be made, including things like the following:¶
-
How the endpoint detects that an EDHOC message is received. This includes how EDHOC messages are transported, for example, in the payload of a CoAP message with a certain Uri-Path or Content-Format; see Appendix A.2.¶
The method of transporting EDHOC messages may also describe data carried along with the messages that are needed for the transport to satisfy the requirements of Section 3.4, e.g., connection identifiers used with certain messages; see Appendix A.2.¶
- Authentication method (METHOD; see Section 3.2).¶
- Profile for authentication credentials
(CRED_ I and CRED_ R; see Section 3.5.2), e.g., profile for certificate or CCS, including supported authentication key algorithms (subject public key algorithm in X.509 or C509 certificate).¶ - Type used to identify credentials
(ID_ CRED_ I and ID_ CRED_ R; see Section 3.5.3).¶ - Use and type of external authorization data
(EAD_ 1, EAD_ 2, EAD_ 3, and EAD_ 4; see Section 3.8).¶ - Identifier used as the identity of the endpoint; see Appendix D.2.¶
- If message_
4 shall be sent/expected, and if not, how to ensure a protected application message is sent from the Responder to the Initiator; see Section 5.5.¶
The application profile may also contain information about supported cipher suites. The procedure for selecting and verifying a cipher suite is still performed as described in Sections 5.2.1 and 6.3, but it may become simplified by this knowledge. EDHOC messages can be processed without the application profile, i.e., the EDHOC messages include information about the type and length of all fields.¶
An example of an application profile is shown in Appendix F.¶
For some parameters, like METHOD, the type of the ID_
For other encodings, like the profiling of CRED_
Note that it is not necessary for the endpoints to specify a single transport for the EDHOC messages. For example, a mix of CoAP and HTTP may be used along the path, and this may still allow correlation between messages.¶
The application profile may be dependent on the identity of the other endpoint or other information carried in an EDHOC message, but it then applies only to the later phases of the protocol when such information is known. (The Initiator does not know the identity of the Responder before having verified message_
Other conditions may be part of the application profile, such as what is the target application or use (if there is more than one application
4. Key Derivation
4.1. Keys for EDHOC Message Processing
EDHOC uses Extract
EDHOC_
In EDHOC, a specific message is protected with a certain PRK, but how the key is derived depends on the authentication method (Section 3.2), as detailed in Section 5.¶
4.1.1. EDHOC_Extract
The pseudorandom keys (PRKs) used for EDHOC message processing are derived using EDHOC_
PRK = EDHOC_Extract( salt, IKM )
where the input keying material (IKM) and salt are defined for each PRK below.¶
The definition of EDHOC_
- If the EDHOC hash algorithm is SHA-2, then EDHOC_
Extract ( salt, IKM ) = HKDF-Extract( salt, IKM ) [RFC5869].¶ - If the EDHOC hash algorithm is SHAKE128, then EDHOC_
Extract ( salt, IKM ) = KMAC128( salt, IKM, 256, "" ).¶ - If the EDHOC hash algorithm is SHAKE256, then EDHOC_
Extract ( salt, IKM ) = KMAC256( salt, IKM, 512, "" ).¶
where the Keccak Message Authentication Code (KMAC) is specified in [SP800-185].¶
The rest of the section defines the pseudorandom keys PRK_
4.1.1.1. PRK_2e
The pseudorandom key PRK_
- The salt SHALL be TH_
2 .¶ - The IKM SHALL be the ephemeral
-ephemeral ECDH shared secret G_ XY (calculated from G_ X and Y or G_ Y and X) as defined in Section 6.3.1 of [RFC9053]. The use of G_ XY gives forward secrecy in the sense that compromise of the private authentication keys does not compromise past session keys.¶
Example: Assuming the use of curve25519, the ECDH shared secret G_
G_XY = X25519( Y, G_X ) = X25519( X, G_Y )
Example: Assuming the use of SHA-256, the extract phase of the key derivation function is HKDF-Extract, which produces PRK_
PRK_2e = HMAC-SHA-256( TH_2, G_XY )
4.1.1.2. PRK_3e2m
The pseudorandom key PRK_
If the Responder authenticates with a static Diffie-Hellman key, then PRK_
- SALT_
3e2m is derived from PRK_ 2e (see Section 4.1.2) and¶ - G_
RX is the ECDH shared secret calculated from G_ R and X, or G_ X and R (the Responder's private authentication key; see Section 3.5.1),¶
else PRK_
4.1.1.3. PRK_4e3m
The pseudorandom key PRK_
If the Initiator authenticates with a static Diffie-Hellman key, then PRK_
- SALT_
4e3m is derived from PRK_ 3e2m (see Section 4.1.2) and¶ - G_
IY is the ECDH shared secret calculated from G_ I and Y, or G_ Y and I (the Initiator's private authentication key; see Section 3.5.1),¶
else PRK_
4.1.2. EDHOC_Expand and EDHOC_KDF
The output keying material (OKM) -- including keys, initialization vectors (IVs), and salts -- are derived from the PRKs using the EDHOC_
OKM = EDHOC_KDF( PRK, info_label, context, length )
= EDHOC_Expand( PRK, info, length )
where info is encoded as the CBOR sequence:¶
info = ( info_label : int, context : bstr, length : uint, )
where:¶
When EDHOC_
The definition of EDHOC_
- If the EDHOC hash algorithm is SHA-2, then EDHOC_
Expand ( PRK, info, length ) = HKDF-Expand( PRK, info, length ) [RFC5869].¶ - If the EDHOC hash algorithm is SHAKE128, then EDHOC_
Expand ( PRK, info, length ) = KMAC128( PRK, info, L, "" ).¶ - If the EDHOC hash algorithm is SHAKE256, then EDHOC_
Expand ( PRK, info, length ) = KMAC256( PRK, info, L, "" ).¶
where L = 8 ⋅ length, the output length in bits.¶
Figure 6 lists derivations made with EDHOC_
- hash_
length is the length of output size of the EDHOC hash algorithm of the selected cipher suite,¶ - key_
length is the length of the encryption key of the EDHOC AEAD algorithm of the selected cipher suite, and¶ - iv_
length is the length of the initialization vector of the EDHOC AEAD algorithm of the selected cipher suite¶
Further details of the key derivation and how the output keying material is used are specified in Section 5.¶
KEYSTREAM_2 = EDHOC_KDF( PRK_2e, 0, TH_2, plaintext_length ) SALT_3e2m = EDHOC_KDF( PRK_2e, 1, TH_2, hash_length ) MAC_2 = EDHOC_KDF( PRK_3e2m, 2, context_2, mac_length_2 ) K_3 = EDHOC_KDF( PRK_3e2m, 3, TH_3, key_length ) IV_3 = EDHOC_KDF( PRK_3e2m, 4, TH_3, iv_length ) SALT_4e3m = EDHOC_KDF( PRK_3e2m, 5, TH_3, hash_length ) MAC_3 = EDHOC_KDF( PRK_4e3m, 6, context_3, mac_length_3 ) PRK_out = EDHOC_KDF( PRK_4e3m, 7, TH_4, hash_length ) K_4 = EDHOC_KDF( PRK_4e3m, 8, TH_4, key_length ) IV_4 = EDHOC_KDF( PRK_4e3m, 9, TH_4, iv_length ) PRK_exporter = EDHOC_KDF( PRK_out, 10, h'', hash_length )
h'' is CBOR diagnostic notation for the empty byte string, 0x40.¶
4.1.3. PRK_out
The pseudorandom key PRK_
Keys for applications are derived using EDHOC_
4.2. Keys for EDHOC Applications
This section defines EDHOC_
4.2.1. EDHOC_Exporter
Keying material for the application can be derived using the EDHOC_
EDHOC_Exporter(exporter_label, context, length)
= EDHOC_KDF(PRK_exporter, exporter_label, context, length)
where:¶
- exporter_
label is a registered uint from the "EDHOC Exporter Labels" registry (Section 10.1),¶ - context is a bstr defined by the application, and¶
- length is a uint defined by the application.¶
The
Examples of use of the EDHOC_
5. Message Formatting and Processing
This section specifies formatting of the messages and processing steps. Error messages are specified in Section 6. Annotated traces of EDHOC sessions are provided in [RFC9529].¶
An EDHOC message is encoded as a sequence of CBOR data items (CBOR Sequence [RFC8742]). Additional optimizations are made to reduce message overhead.¶
While EDHOC uses the COSE_
5.1. EDHOC Message Processing Outline
For each new/ongoing EDHOC session, the endpoints are assumed to keep an associated protocol state containing identifiers, keying material, etc. used for subsequent processing of protocol
EDHOC messages SHALL be processed according to the current protocol state. The following steps are expected to be performed at reception of an EDHOC message:¶
- Detect that an EDHOC message has been received, for example, by means of a port number, URI, or media type (Section 3.9).¶
- Retrieve the protocol state according to the message correlation; see Section 3.4.1. If there is no protocol state, in the case of message_
1, a new protocol state is created. The Responder endpoint needs to make use of available denial -of -service mitigation (Section 9.7).¶ - If the message received is an error message, then process it according to Section 6, else process it as the expected next message according to the protocol state.¶
The message processing steps SHALL be processed in order, unless otherwise stated. If the processing fails for some reason, then typically an error message is sent, the EDHOC session is aborted, and the protocol state is erased. When the composition and sending of one message is completed and before the next message is received, error messages SHALL NOT be sent.¶
After having successfully processed the last message
Different instances of the same message MUST NOT be processed in one EDHOC session. Note that processing will fail if the same message appears a second time for EDHOC processing in the same EDHOC session because the state of the protocol has moved on and now expects something else. Message deduplication MUST be done by the transport protocol (see Section 3.4) or, if not supported by the transport, as described in Section 7.¶
5.2. EDHOC Message 1
5.2.1. Formatting of Message 1
message_
message_1 = ( METHOD : int, SUITES_I : suites, G_X : bstr, C_I : bstr / -24..23, ? EAD_1, ) suites = [ 2* int ] / int EAD_1 = 1* ead
where:¶
- METHOD is an authentication method; see Section 3.2,¶
- SUITES_
I is an array of cipher suites that the Initiator supports constructed as specified in Section 5.2.2,¶ - G_
X is the ephemeral public key of the Initiator, and¶ - C_
I is a variable-length connection identifier (note that connection identifiers are byte strings but certain values are represented as integers in the message; see Section 3.3.2), and¶ - EAD_
1 is external authorization data; see Section 3.8.¶
5.2.2. Initiator Composition of Message 1
The processing steps are detailed below and in Section 6.3.¶
The Initiator SHALL compose message_
-
Construct SUITES_
I as an array of cipher suites supported by I in order of preference by I with the first cipher suite in the array being the most preferred by I and the last being the one selected by I for this EDHOC session. If the cipher suite most preferred by I is selected, then SUITES_ I contains only that cipher suite and is encoded as an int. All cipher suites, if any, preferred by I over the selected one MUST be included. (See also Section 6.3.)¶ - The selected suite is based on what the Initiator can assume to be supported by the Responder; if the Initiator previously received from the Responder an error message with error code 2 containing SUITES_
R (see Section 6.3) indicating cipher suites supported by the Responder, then the Initiator SHOULD select its most preferred supported cipher suite among those (bearing in mind that error messages may be forged).¶ - The Initiator MUST NOT change its order of preference for cipher suites and MUST NOT omit a cipher suite preferred to the selected one because of previous error messages received from the Responder.¶
- The selected suite is based on what the Initiator can assume to be supported by the Responder; if the Initiator previously received from the Responder an error message with error code 2 containing SUITES_
- Generate an ephemeral ECDH key pair using the curve in the selected cipher suite and format it as a COSE_
Key . Let G_ X be the 'x' parameter of the COSE_ Key .¶ - Choose a connection identifier C_
I and store it during the EDHOC session.¶ - Encode message_
1 as a sequence of CBOR-encoded data items as specified in Section 5.2.1¶
5.2.3. Responder Processing of Message 1
The Responder SHALL process message_
- Decode message_
1 (see Appendix C.1).¶ - Process message_
1 . In particular, verify that the selected cipher suite is supported and that no prior cipher suite as ordered in SUITES_ I is supported.¶ - If all processing completed successfully, and if EAD_
1 is present, then make it available to the application for EAD processing.¶
If any processing step fails, then the Responder MUST send an EDHOC error message back as defined in Section 6, and the EDHOC session MUST be aborted.¶
5.3. EDHOC Message 2
5.3.1. Formatting of Message 2
message_
message_2 = ( G_Y_CIPHERTEXT_2 : bstr, )
where:¶
- G_
Y_ CIPHERTEXT_ 2 is the concatenation of G_ Y (i.e., the ephemeral public key of the Responder) and CIPHERTEXT_ 2 .¶
5.3.2. Responder Composition of Message 2
The Responder SHALL compose message_
- Generate an ephemeral ECDH key pair using the curve in the selected cipher suite and format it as a COSE_
Key . Let G_ Y be the 'x' parameter of the COSE_ Key .¶ - Choose a connection identifier C_
R and store it for the length of the EDHOC session.¶ - Compute the transcript hash TH_
2 = H( G_ Y, H (message_ 1 ) ), where H() is the EDHOC hash algorithm of the selected cipher suite. The input to the hash function is a CBOR Sequence. Note that H (message_ 1 ) can be computed and cached already in the processing of message_ 1 .¶ -
Compute MAC_
2 as in Section 4.1.2 with context_ 2 = << C_ R, ID_ CRED_ R, TH_ 2, CRED_ R, ? EAD_ 2 >> (see Appendix C.1 for notation).¶ - If the Responder authenticates with a static Diffie-Hellman key (method equals 1 or 3), then mac_
length_ 2 is the EDHOC MAC length of the selected cipher suite. If the Responder authenticates with a signature key (method equals 0 or 2), then mac_ length_ 2 is equal to hash_ length .¶ - C_
R is a variable-length connection identifier. Note that connection identifiers are byte strings but certain values are represented as integers in the message; see Section 3.3.2.¶ - ID_
CRED_ R is an identifier to facilitate the retrieval of CRED_ R; see Section 3.5.3.¶ - CRED_
R is a CBOR item containing the authentication credential of the Responder; see Section 3.5.2.¶ - EAD_
2 is external authorization data; see Section 3.8.¶
- If the Responder authenticates with a static Diffie-Hellman key (method equals 1 or 3), then mac_
-
If the Responder authenticates with a static Diffie-Hellman key (method equals 1 or 3), then Signature_
or_ MAC_ 2 is MAC_ 2 . If the Responder authenticates with a signature key (method equals 0 or 2), then Signature_ or_ MAC_ 2 is the 'signature' field of a COSE_ Sign1 object, computed as specified in Section 4.4 of [RFC9052] using the signature algorithm of the selected cipher suite, the private authentication key of the Responder, and the following parameters as input (see Appendix C.3 for an overview of COSE and Appendix C.1 for notation):¶ -
CIPHERTEXT_
2 is calculated with a binary additive stream cipher, using a keystream generated with EDHOC_ Expand and the following plaintext:¶ -
PLAINTEXT_
2 = ( C_ R, ID_ CRED_ R / bstr / -24..23, Signature_ or_ MAC_ 2, ? EAD_ 2 )¶ - If ID_
CRED_ R contains a single 'kid' parameter, i.e., ID_ CRED_ R = { 4 : kid_ R }, then the compact encoding is applied; see Section 3.5.3.2.¶ - C_
R is the variable-length connection identifier. Note that connection identifiers are byte strings, but certain values are represented as integers in the message; see Section 3.3.2.¶
- If ID_
- Compute KEYSTREAM_
2 as in Section 4.1.2, where plaintext_ length is the length of PLAINTEXT_ 2 . For the case of plaintext_ length exceeding the EDHOC_ KDF output size, see Appendix G.¶ - CIPHERTEXT_
2 = PLAINTEXT_ 2 XOR KEYSTREAM_ 2¶
-
- Encode message_
2 as a sequence of CBOR-encoded data items as specified in Section 5.3.1.¶
5.3.3. Initiator Processing of Message 2
The Initiator SHALL process message_
- Decode message_
2 (see Appendix C.1).¶ - Retrieve the protocol state using available message correlation (e.g., the CoAP Token, the 5-tuple, or the prepended C_
I; see Section 3.4.1).¶ - Decrypt CIPHERTEXT_
2; see Section 5.3.2.¶ - If all processing is completed successfully, then make ID_
CRED_ R and (if present) EAD_ 2 available to the application for authentication and EAD processing. When and how to perform authentication is up to the application.¶ - Obtain the authentication credential
(CRED_ R ) and the authentication key of R from the application (or by other means).¶ - Verify Signature_
or_ MAC_ 2 using the algorithm in the selected cipher suite. The verification process depends on the method; see Section 5.3.2. Make the result of the verification available to the application.¶
If any processing step fails, then the Initiator MUST send an EDHOC error message back as defined in Section 6, and the EDHOC session MUST be aborted.¶
5.4. EDHOC Message 3
5.4.1. Formatting of Message 3
message_
message_3 = ( CIPHERTEXT_3 : bstr, )
5.4.2. Initiator Composition of Message 3
The Initiator SHALL compose message_
- Compute the transcript hash TH_
3 = H (TH_ 2, PLAINTEXT_ 2, CRED_ R ), where H() is the EDHOC hash algorithm of the selected cipher suite. The input to the hash function is a CBOR Sequence. Note that TH_ 3 can be computed and cached already in the processing of message_ 2 .¶ -
Compute MAC_
3 as in Section 4.1.2, with context_ 3 = << ID_ CRED_ I, TH_ 3, CRED_ I, ? EAD_ 3 >>¶ - If the Initiator authenticates with a static Diffie-Hellman key (method equals 2 or 3), then mac_
length_ 3 is the EDHOC MAC length of the selected cipher suite. If the Initiator authenticates with a signature key (method equals 0 or 1), then mac_ length_ 3 is equal to hash_ length .¶ - ID_
CRED_ I is an identifier to facilitate the retrieval of CRED_ I; see Section 3.5.3.¶ - CRED_
I is a CBOR item containing the authentication credential of the Initiator; see Section 3.5.2.¶ - EAD_
3 is external authorization data; see Section 3.8.¶
- If the Initiator authenticates with a static Diffie-Hellman key (method equals 2 or 3), then mac_
-
If the Initiator authenticates with a static Diffie-Hellman key (method equals 2 or 3), then Signature_
or_ MAC_ 3 is MAC_ 3 . If the Initiator authenticates with a signature key (method equals 0 or 1), then Signature_ or_ MAC_ 3 is the 'signature' field of a COSE_ Sign1 object, computed as specified in Section 4.4 of [RFC9052] using the signature algorithm of the selected cipher suite, the private authentication key of the Initiator, and the following parameters as input (see Appendix C.3):¶ -
Compute a COSE_
Encrypt0 object as defined in Sections 5.2 and 5.3 of [RFC9052], with the EDHOC AEAD algorithm of the selected cipher suite, using the encryption key K_ 3, the initialization vector IV_ 3 (if used by the AEAD algorithm), the plaintext PLAINTEXT_ 3, and the following parameters as input (see Appendix C.3):¶ - protected = h''¶
- external_
aad = TH_ 3¶ - K_
3 and IV_ 3 are defined in Section 4.1.2¶ -
PLAINTEXT_
3 = ( ID_ CRED_ I / bstr / -24..23, Signature_ or_ MAC_ 3, ? EAD_ 3 )¶ - If ID_
CRED_ I contains a single 'kid' parameter, i.e., ID_ CRED_ I = { 4 : kid_ I }, then the compact encoding is applied; see Section 3.5.3.2.¶
- If ID_
CIPHERTEXT_
3 is the 'ciphertext' of COSE_ Encrypt0 .¶ - Compute the transcript hash TH_
4 = H (TH_ 3, PLAINTEXT_ 3, CRED_ I ), where H() is the EDHOC hash algorithm of the selected cipher suite. The input to the hash function is a CBOR Sequence.¶ - Calculate PRK_
out as defined in Figure 6. The Initiator can now derive application keys using the EDHOC_ Exporter interface; see Section 4.2.1.¶ - Encode message_
3 as a CBOR data item as specified in Section 5.4.1.¶ - Make the connection identifiers
(C_ I and C_ R ) and the application algorithms in the selected cipher suite available to the application.¶
After creating message_
5.4.3. Responder Processing of Message 3
The Responder SHALL process message_
- Decode message_
3 (see Appendix C.1).¶ - Retrieve the protocol state using available message correlation (e.g., the CoAP Token, the 5-tuple, or the prepended C_
R; see Section 3.4.1).¶ - Decrypt and verify the COSE_
Encrypt0 as defined in Sections 5.2 and 5.3 of [RFC9052], with the EDHOC AEAD algorithm in the selected cipher suite and the parameters defined in Section 5.4.2.¶ - If all processing completed successfully, then make ID_
CRED_ I and (if present) EAD_ 3 available to the application for authentication and EAD processing. When and how to perform authentication is up to the application.¶ - Obtain the authentication credential
(CRED_ I ) and the authentication key of I from the application (or by other means).¶ - Verify Signature_
or_ MAC_ 3 using the algorithm in the selected cipher suite. The verification process depends on the method; see Section 5.4.2. Make the result of the verification available to the application.¶ - Make the connection identifiers
(C_ I and C_ R ) and the application algorithms in the selected cipher suite available to the application.¶
After processing message_
If any processing step fails, then the Responder MUST send an EDHOC error message back as defined in Section 6, and the EDHOC session MUST be aborted.¶
5.5. EDHOC Message 4
This section specifies message_
- when EDHOC is only used for authentication and no application data is sent and¶
- when application data is only sent from the Initiator to the Responder.¶
Further considerations about when to use message_
5.5.1. Formatting of Message 4
message_
message_4 = ( CIPHERTEXT_4 : bstr, )
5.5.2. Responder Composition of Message 4
The Responder SHALL compose message_
-
Compute a COSE_
Encrypt0 as defined in Sections 5.2 and 5.3 of [RFC9052], with the EDHOC AEAD algorithm of the selected cipher suite, using the encryption key K_ 4, the initialization vector IV_ 4 (if used by the AEAD algorithm), the plaintext PLAINTEXT_ 4, and the following parameters as input (see Appendix C.3):¶ - protected = h''¶
- external_
aad = TH_ 4¶ - K_
4 and IV_ 4 are defined in Section 4.1.2¶ -
PLAINTEXT_
4 = ( ? EAD_ 4 )¶ - EAD_
4 is external authorization data; see Section 3.8.¶
- EAD_
CIPHERTEXT_
4 is the 'ciphertext' of COSE_ Encrypt0 .¶ - Encode message_
4 as a CBOR data item as specified in Section 5.5.1.¶
5.5.3. Initiator Processing of Message 4
The Initiator SHALL process message_
- Decode message_
4 (see Appendix C.1).¶ - Retrieve the protocol state using available message correlation (e.g., the CoAP Token, the 5-tuple, or the prepended C_
I; see Section 3.4.1).¶ - Decrypt and verify the COSE_
Encrypt0 as defined in Sections 5.2 and 5.3 of [RFC9052], with the EDHOC AEAD algorithm in the selected cipher suite and the parameters defined in Section 5.5.2.¶ - Make (if present) EAD_
4 available to the application for EAD processing.¶
If any processing step fails, then the Initiator MUST send an EDHOC error message back as defined in Section 6, and the EDHOC session MUST be aborted.¶
After verifying message_
6. Error Handling
This section defines the format for error messages and the processing associated with the currently defined error codes. Additional error codes may be registered; see Section 10.4.¶
Many kinds of errors can occur during EDHOC processing. As in CoAP, an error can be triggered by errors in the received message or internal errors in the receiving endpoint. Except for processing and formatting errors, it is up to the application when to send an error message. Sending error messages is essential for debugging but MAY be skipped if, for example, an EDHOC session cannot be found or due to denial
An EDHOC error message can be sent by either endpoint as a reply to any non-error EDHOC message. How errors at the EDHOC layer are transported depends on lower layers, which need to enable error messages to be sent and processed as intended.¶
error SHALL be a CBOR Sequence (see Appendix C.1), as defined below.¶
error = ( ERR_CODE : int, ERR_INFO : any, )
where:¶
- ERR_
CODE is an error code encoded as an integer. The value 0 is reserved for success and can only be used internally; all other values (negative or positive) indicate errors.¶ - ERR_
INFO is error information. Content and encoding depend on the error code.¶
The remainder of this section specifies the currently defined error codes; see Table 3. Additional error codes and corresponding error information may be specified.¶
| ERR_ |
ERR_ |
Description |
|---|---|---|
| 0 | Reserved for success | |
| 1 | tstr | Unspecified error |
| 2 | suites | Wrong selected cipher suite |
| 3 | true | Unknown credential referenced |
| 23 | Reserved |
6.1. Success
Error code 0 MAY be used internally in an application to indicate success, i.e., as a standard value in case of no error, e.g., in status reporting or log files. Error code 0 MUST NOT be used as part of the EDHOC message exchange. If an endpoint receives an error message with error code 0, then it MUST abort the EDHOC session and MUST NOT send an error message.¶
6.2. Unspecified Error
Error code 1 is used for errors that do not have a specific error code defined. ERR_
6.3. Wrong Selected Cipher Suite
Error code 2 MUST only be used when replying to message_
In contrast to SUITES_
6.3.1. Cipher Suite Negotiation
After receiving SUITES_
After a completed EDHOC session, the Initiator MAY remember the selected cipher suite to use in future EDHOC sessions with this Responder. Note that if the Initiator or Responder is updated with new cipher suite policies, any cached information may be outdated.¶
Note that the Initiator's list of supported cipher suites and order of preference is fixed (see Sections 5.2.1 and 5.2.2). Furthermore, the Responder SHALL only accept message_
If the selected cipher suite is not the first cipher suite that the Responder supports in SUITES_
6.3.2. Examples
Assume that the Initiator supports the five cipher suites, 5, 6, 7, 8, and 9, in decreasing order of preference. Figures 8 and 9 show two examples of how the Initiator can format SUITES_
In Example 1 (Figure 8), the Responder supports cipher suite 6 but not the initially selected cipher suite 5. The Responder rejects the first message_
In Example 2 (Figure 9), the Responder supports cipher suites 8 and 9 but not the more preferred (by the Initiator) cipher suites 5, 6 or 7. To illustrate the negotiation mechanics, we let the Initiator first make a guess that the Responder supports suite 6 but not suite 5. Since the Responder supports neither 5 nor 6, it rejects the first message_
- Note 1.
- If the Responder had supported suite 5, then the first message_
1 would not have been accepted either, since the Responder observes that suite 5 is more preferred by the Initiator than the selected suite 6. In that case, the Responder would have included suite 5 in SUITES_ R of the response, and it would then have become the selected and only suite in the second message_ 1 .¶ - Note 2.
- For each message_
1, the Initiator MUST generate a new ephemeral ECDH key pair matching the selected cipher suite.¶
6.4. Unknown Credential Referenced
Error code 3 is used for errors due to a received credential identifier
For example, an application profile could list x5t and x5chain as supported credential identifiers and state that x5t should be used if it can be assumed that the X.509 certificate is available at the receiving side. This error code thus enables the certificate chain to be sent only when needed, bearing in mind that error messages are not protected so an adversary can try to cause unnecessary, large credential identifiers.¶
For the error code 3, the error information SHALL be the CBOR simple value true (0xf5). Error code 3 MUST NOT be used when the received credential identifier type is not supported.¶
7. EDHOC Message Deduplication
By default, EDHOC assumes that message duplication is handled by the transport (which is exemplified by CoAP in this section); see Appendix A.2.¶
Deduplication of CoAP messages is described in Section 4.5 of [RFC7252]. This handles the case when the same Confirmable (CON) message is received multiple times due to missing acknowledgment on the CoAP messaging layer. The recommended processing in [RFC7252] is that the duplicate message is acknowledged, but the received message is only processed once by the CoAP stack.¶
Message deduplication is resource demanding and therefore not supported in all CoAP implementations
The guiding principle here is similar to the deduplication processing on the CoAP messaging layer, i.e., a received duplicate EDHOC message SHALL NOT result in another instance of the next EDHOC message. The result MAY be that a duplicate next EDHOC message is sent, provided it is still relevant with respect to the current protocol state. In any case, the received message MUST NOT be processed more than once in the same EDHOC session. This is called "EDHOC message deduplication".¶
An EDHOC implementation MAY store the previously sent EDHOC message to be able to resend it.¶
In principle, if the EDHOC implementation would deterministical
The EDHOC implementation MUST NOT store the previous protocol state and regenerate an EDHOC message if there is a risk that the same key and IV are used for two (or more) distinct messages.¶
The previous message or protocol state MUST NOT be kept longer than what is required for retransmission, for example, in the case of CoAP transport, no longer than the EXCHANGE_
8. Compliance Requirements
In the absence of an application profile specifying otherwise:¶
- An implementation MAY support only an Initiator or only a Responder.¶
- An implementation MAY support only a single method. None of the methods are mandatory to implement.¶
- Implementations MUST support 'kid' parameters. None of the other COSE header parameters are mandatory to implement.¶
- An implementation MAY support only a single credential type (CCS, CWT, X.509, or C509). None of the credential types are mandatory to implement.¶
- Implementations MUST support the EDHOC_
Exporter .¶ - Implementations MAY support message_
4 . Error codes (ERR_ CODE ) 1 and 2 MUST be supported.¶ - Implementations MUST support EAD.¶
- Implementations MUST support cipher suites 2 and 3. Cipher suites 2
(AES -CCM -16 -64 -128, SHA-256, 8, P-256, ES256, AES -CCM -16 -64 -128, SHA-256) and 3 (AES -CCM -16 -128 -128, SHA-256, 16, P-256, ES256, AES -CCM -16 -64 -128, SHA-256) only differ in the size of the MAC length, so supporting one or both of these is not significantly different. Implementations only need to implement the algorithms needed for their supported methods.¶
9. Security Considerations
9.1. Security Properties
EDHOC has similar security properties as can be expected from the theoretical SIGMA-I protocol [SIGMA] and the Noise XX pattern [Noise], which are similar to methods 0 and 3, respectively. Proven security properties are detailed in the security analysis publications referenced at the end of this section.¶
Using the terminology from [SIGMA], EDHOC provides forward secrecy, mutual authentication with aliveness, consistency, and peer awareness. As described in [SIGMA], message_
As described in [SIGMA], different levels of identity protection are provided to the Initiator and Responder. EDHOC provides identity protection of the Initiator against active attacks and identity protection of the Responder against passive attacks. An active attacker can get the credential identifier of the Responder by eavesdropping on the destination address used for transporting message_
EDHOC messages might change in transit due to a noisy channel or through modification by an attacker. Changes in message_
Compared to [SIGMA], EDHOC adds an explicit method type and expands the message authentication coverage to additional elements such as algorithms, external authorization data, and previous plaintext messages. This protects against an attacker replaying messages or injecting messages from another EDHOC session.¶
EDHOC also adds the selection of connection identifiers and downgrade
As required by [RFC7258], IETF protocols need to mitigate pervasive monitoring when possible. Therefore, EDHOC only supports methods with ephemeral Diffie-Hellman and provides a key update function (see Appendix H) for lightweight application protocol rekeying. Either of these provides forward secrecy, in the sense that compromise of the private authentication keys does not compromise past session keys
To limit the effect of breaches, it is important to limit the use of symmetric group keys for bootstrapping. Therefore, EDHOC strives to make the additional cost of using raw public keys and self-signed certificates as small as possible. Raw public keys and self-signed certificates are not a replacement for a public key infrastructure but SHOULD be used instead of symmetric group keys for bootstrapping.¶
Compromise of the long-term keys (private signature or static DH keys) does not compromise the security of completed EDHOC sessions. Compromising the private authentication keys of one party lets an active attacker impersonate that compromised party in EDHOC sessions with other parties but does not let the attacker impersonate other parties in EDHOC sessions with the compromised party. Compromise of the long-term keys does not enable a passive attacker to compromise future session keys
Based on the cryptographic algorithm requirements (Section 9.3), EDHOC provides a minimum of 64-bit security against online brute force attacks and a minimum of 128-bit security against offline brute force attacks. To break 64-bit security against online brute force, an attacker would on average have to send 4.3 billion messages per second for 68 years, which is infeasible in constrained IoT radio technologies. A forgery against a 64-bit MAC in EDHOC breaks the security of all future application data, while a forgery against a 64-bit MAC in the subsequent application protocol (e.g., OSCORE [RFC8613]) typically only breaks the security of the data in the forged packet.¶
As the EDHOC session is aborted when verification fails, the security against online attacks is given by the sum of the strength of the verified signatures and MACs (including MAC in AEAD). As an example, if EDHOC is used with method 3, cipher suite 2, and message_
After sending message_
External authorization data sent in message_
External authorization data sent in message_
- Key Compromise Impersonation (KCI):
- In EDHOC authenticated with signature keys, EDHOC provides KCI protection against an attacker having access to the long-term key or the ephemeral secret key. With static Diffie-Hellman key authentication, KCI protection would be provided against an attacker having access to the long-term Diffie-Hellman key but not to an attacker having access to the ephemeral secret key. Note that the term KCI has typically been used for compromise of long-term keys and that an attacker with access to the ephemeral secret key can only attack that specific EDHOC session.¶
- Repudiation:
- If an endpoint authenticates with a signature, the other endpoint can prove that the endpoint performed a run of the protocol by presenting the data being signed as well as the signature itself. With static Diffie-Hellman key authentication, the authenticating endpoint can deny having participated in the protocol.¶
Earlier versions of EDHOC have been formally analyzed [Bruni18] [Norrman20] [Cottier
9.2. Cryptographic Considerations
The SIGMA protocol requires that the encryption of message_
To reduce message overhead, EDHOC does not use explicit nonces and instead relies on the ephemeral public keys to provide randomness to each EDHOC session. A good amount of randomness is important for the key generation to provide liveness and to protect against interleaving attacks. For this reason, the ephemeral keys MUST NOT be used in more than one EDHOC message, and both parties SHALL generate fresh, random ephemeral key pairs. Note that an ephemeral key may be used to calculate several ECDH shared secrets. When static Diffie-Hellman authentication is used, the same ephemeral key is used in both ephemeral
As discussed in [SIGMA], the encryption of message_
Requirements for how to securely generate, validate, and process the public keys depend on the elliptic curve. For X25519 and X448, the requirements are defined in [RFC7748]. For X25519 and X448, the check for all-zero output as specified in Section 6 of [RFC7748] MUST be done. For secp256r1, secp384r1, and secp521r1, the requirements are defined in Section 5 of [SP-800-56A]. For secp256r1, secp384r1, and secp521r1, at least partial public key validation MUST be done.¶
The same authentication credential MAY be used for both the Initiator and Responder roles. As noted in Section 12 of [RFC9052], the use of a single key for multiple algorithms is strongly discouraged unless proven secure by a dedicated cryptographic analysis. In particular, this recommendation applies to using the same private key for static Diffie-Hellman authentication and digital signature authentication. A preliminary conjecture is that a minor change to EDHOC may be sufficient to fit the analysis of a secure shared signature and ECDH key usage in [Degabriele11] and [Thormarker21]. Note that Section 5.6.3.2 of [SP-800-56A] allows a key agreement key pair to be used with a signature algorithm in certificate requests.¶
The property that a completed EDHOC session implies that another identity has been active is upheld as long as the Initiator does not have its own identity in the set of Responder identities it is allowed to communicate with. In trust
NIST SP 800-56A [SP-800-56A] forbids deriving secret and non-secret randomness from the same Key Derivation Function (KDF) instance, but this decision has been criticized by Krawczyk in [HKDFpaper] and doing so is common practice. In addition to IVs, other examples are the challenge in Extensible Authentication Protocol Tunneled Transport Layer Security (EAP-TTLS), the RAND in 3GPP Authentication and Key Agreement (AKA), and the Session-Id in EAP-TLS 1.3. Note that part of KEYSTREAM_
9.3. Cipher Suites and Cryptographic Algorithms
When using a private cipher suite or registering new cipher suites, the choice of the key length used in the different algorithms needs to be harmonized so that a sufficient security level is maintained for authentication credentials, the EDHOC session, and the protection of application data. The Initiator and Responder should enforce a minimum security level.¶
The output size of the EDHOC hash algorithm MUST be at least 256 bits. In particular, the hash algorithms SHA-1 and SHA-256/64 (SHA-256 truncated to 64 bits) SHALL NOT be supported for use in EDHOC except for certificate identification with x5t and c5t. For security considerations of SHA-1, see [RFC6194]. As EDHOC integrity protects all the authentication credentials, the choice of hash algorithm in x5t and c5t does not affect security and using the same hash algorithm as in the cipher suite, but with as much truncation as possible, is RECOMMENDED. That is, when the EDHOC hash algorithm is SHA-256, using SHA-256/64 in x5t and c5t is RECOMMENDED. The EDHOC MAC length MUST be at least 8 bytes and the tag length of the EDHOC AEAD algorithm MUST be at least 64 bits. Note that secp256k1 is only defined for use with ECDSA and not for ECDH. Note that some COSE algorithms are marked as not recommended in the COSE IANA registry.¶
9.4. Post-Quantum Considerations
As of the publication of this specification, it is unclear when or even if a quantum computer of sufficient size and power to exploit public key cryptography will exist. Deployments that need to consider risks decades into the future should transition to Post-Quantum Cryptography (PQC) in the not-too-distant future. Many other systems should take a slower wait-and-see approach where PQC is phased in when the quantum threat is more imminent. Current PQC algorithms have limitations compared to Elliptic Curve Cryptography (ECC), and the data sizes would be problematic in many constrained IoT systems.¶
Symmetric algorithms used in EDHOC, such as SHA-256 and AES
EDHOC supports all signature algorithms defined by COSE, including PQC signature algorithms such as HSS-LMS. EDHOC is currently only specified for use with key exchange algorithms of type ECDH curves, but any Key Encapsulation Method (KEM), including PQC KEMs, can be used in method 0. While the key exchange in method 0 is specified with the terms of the Diffie-Hellman protocol, the key exchange adheres to a KEM interface: G_
9.5. Unprotected Data and Privacy
The Initiator and Responder must make sure that unprotected data and metadata do not reveal any sensitive information. This also applies for encrypted data sent to an unauthenticated party. In particular, it applies to EAD_
An attacker observing network traffic may use connection identifiers sent in clear in EDHOC or the subsequent application protocol to correlate packets sent on different paths or at different times. The attacker may use this information for traffic flow analysis or to track an endpoint. Application protocols using connection identifiers from EDHOC SHOULD provide mechanisms to update the connection identifiers and MAY provide mechanisms to issue several simultaneously active connection identifiers. See [RFC9000] for a non-constrained example of such mechanisms. Connection identifiers can, e.g., be chosen randomly among the set of unused 1-byte connection identifiers. Connection identity privacy mechanisms are only useful when there are not fixed identifiers, such as IP address or MAC address in the lower layers.¶
9.6. Updated Internet Threat Model Considerations
Since the publication of [RFC3552], there has been an increased awareness of the need to protect against endpoints that are compromised or malicious or whose interests simply do not align with the interests of users [THREAT
The fields ID_
9.7. Denial of Service
EDHOC itself does not provide countermeasures against denial
An attacker can also send a faked message_
9.8. Implementation Considerations
The availability of a secure random number generator is essential for the security of EDHOC. If no true random number generator is available, a random seed MUST be provided from an external source and used with a cryptographical
For many constrained IoT devices, it is problematic to support several crypto primitives. Existing devices can be expected to support either ECDSA or Edwards-curve Digital Signature Algorithm (EdDSA). If ECDSA is supported, "deterministic ECDSA", as specified in [RFC6979], MAY be used. Pure deterministic elliptic-curve signatures, such as deterministic ECDSA and EdDSA, have gained popularity over randomized ECDSA as their security does not depend on a source of high-quality randomness. Recent research has however found that implementations of these signature algorithms may be vulnerable to certain side-channel and fault injection attacks due to their determinism. For example, see Section 1 of [HEDGED-ECC-SIGS] for a list of attack papers. As suggested in Section 2.1.1 of [RFC9053], this can be addressed by combining randomness and determinism.¶
Appendix D of [CURVE-REPR] describes how Montgomery curves, such as X25519 and X448, and (twisted) Edwards curves, such as Ed25519 and Ed448, can be mapped to and from short
All private keys, symmetric keys, and IVs MUST be secret. Only the Responder SHALL have access to the Responder's private authentication key, and only the Initiator SHALL have access to the Initiator's private authentication key. Implementations should provide countermeasures to side-channel attacks, such as timing attacks. Intermediate computed values, such as ephemeral ECDH keys and ECDH shared secrets, MUST be deleted after key derivation is completed.¶
The Initiator and Responder are responsible for verifying the integrity and validity of certificates. Verification of validity may require the use of a Real-Time Clock (RTC). The selection of trusted certification authorities (CAs) should be done very carefully and certificate revocation should be supported. The choice of revocation mechanism is left to the application. For example, in case of X.509 certificates, Certificate Revocation Lists [RFC5280] or the Online Certificate Status Protocol (OCSP) [RFC6960] may be used.¶
Similar considerations as for certificates are needed for CWT/CCS. The endpoints are responsible for verifying the integrity and validity of CWT/CCS and to handle revocation. The application needs to determine what trust anchors are relevant and have a well-defined trust
Just like for certificates, the contents of the COSE header parameters 'kcwt' and 'kccs' defined in Section 10.6 must be processed as untrusted inputs. Endpoints that intend to rely on the assertions made by a CWT/CCS obtained from any of these methods need to validate the contents. For 'kccs', which enables transport of raw public keys, the data structure used does not include any protection or verification data. 'kccs' may be used for unauthenticated operations, e.g., trust on first use, with the limitations and caveats entailed; see Appendix D.5.¶
The Initiator and Responder are allowed to select connection identifiers C_
If two nodes unintentionally initiate two simultaneous EDHOC sessions with each other, even if they only want to complete a single EDHOC session, they MAY abort the EDHOC session with the lexicographical
If supported by the device, it is RECOMMENDED that at least the long-term private keys are stored in a Trusted Execution Environment (TEE) (for example, see [RFC9397]) and that sensitive operations using these keys are performed inside the TEE. To achieve even higher security, it is RECOMMENDED that additional operations such as ephemeral key generation, all computations of shared secrets, and storage of the PRK keys can be done inside the TEE. The use of a TEE aims at preventing code within that environment to be tampered with and preventing data used by such code to be read or tampered with by code outside that environment.¶
Note that HKDF-Expand has a relatively small maximum output length of 255 ⋅ hash_
The sequence of transcript hashes in EDHOC
When parsing a received EDHOC message, implementations MUST abort the EDHOC session if the message does not comply with the CDDL for that message. Implementations are not required to support non
10. IANA Considerations
This section gives IANA considerations and, unless otherwise noted, conforms with [RFC8126].¶
10.1. EDHOC Exporter Label Registry
IANA has created a new registry under the new registry group "Ephemeral Diffie-Hellman Over COSE (EDHOC)" as follows:¶
| Label | Description | Reference |
|---|---|---|
| 0 | Derived OSCORE Master Secret | RFC 9528 |
| 1 | Derived OSCORE Master Salt | RFC 9528 |
| 2-22 | Unassigned | |
| 23 | Reserved | RFC 9528 |
| 24-32767 | Unassigned | |
| 32768-65535 | Reserved for Private Use |
This registry also has a "Change Controller" field. For registrations made by IETF documents, the IETF is listed.¶
| Range | Registration Procedures |
|---|---|
| 0-23 | Standards Action |
| 24-32767 | Expert Review |
| 32768-65535 | Private Use |
10.2. EDHOC Cipher Suites Registry
IANA has created a new registry under the new registry group "Ephemeral Diffie-Hellman Over COSE (EDHOC)" as follows:¶
The columns of the registry are Value, Array, Description, and Reference, where Value is an integer and the other columns are text strings. The initial contents of the registry are:¶
| Value | Array | Description | Reference |
|---|---|---|---|
| -24 | N/A | Private Use | RFC 9528 |
| -23 | N/A | Private Use | RFC 9528 |
| -22 | N/A | Private Use | RFC 9528 |
| -21 | N/A | Private Use | RFC 9528 |
| 0 | 10, -16, 8, 4, -8, 10, -16 | AES |
RFC 9528 |
| 1 | 30, -16, 16, 4, -8, 10, -16 | AES |
RFC 9528 |
| 2 | 10, -16, 8, 1, -7, 10, -16 | AES |
RFC 9528 |
| 3 | 30, -16, 16, 1, -7, 10, -16 | AES |
RFC 9528 |
| 4 | 24, -16, 16, 4, -8, 24, -16 | Cha |
RFC 9528 |
| 5 | 24, -16, 16, 1, -7, 24, -16 | Cha |
RFC 9528 |
| 6 | 1, -16, 16, 4, -7, 1, -16 | A128GCM, SHA-256, 16, X25519, ES256, A128GCM, SHA-256 | RFC 9528 |
| 23 | Reserved | RFC 9528 | |
| 24 | 3, -43, 16, 2, -35, 3, -43 | A256GCM, SHA-384, 16, P-384, ES384, A256GCM, SHA-384 | RFC 9528 |
| 25 | 24, -45, 16, 5, -8, 24, -45 | Cha |
RFC 9528 |
| Range | Registration Procedures |
|---|---|
| -65536 to -25 | Specification Required |
| -24 to -21 | Private Use |
| -20 to 23 | Standards Action with Expert Review |
| 24 to 65535 | Specification Required |
10.3. EDHOC Method Type Registry
IANA has created a new registry under the new registry group "Ephemeral Diffie-Hellman Over COSE (EDHOC)" as follows:¶
The columns of the registry are Value, Initiator Authentication Key, Responder Authentication Key, and Reference, where Value is an integer and the key columns are text strings describing the authentication keys.¶
The initial contents of the registry are shown in Table 2. Method 23 is Reserved.¶
| Range | Registration Procedures |
|---|---|
| -65536 to -25 | Specification Required |
| -24 to 23 | Standards Action with Expert Review |
| 24 to 65535 | Specification Required |
10.4. EDHOC Error Codes Registry
IANA has created a new registry under the new registry group "Ephemeral Diffie-Hellman Over COSE (EDHOC)" as follows:¶
The columns of the registry are ERR_
| Range | Registration Procedures |
|---|---|
| -65536 to -25 | Expert Review |
| -24 to 23 | Standards Action |
| 24 to 65535 | Expert Review |
10.5. EDHOC External Authorization Data Registry
IANA has created a new registry under the new registry group "Ephemeral Diffie-Hellman Over COSE (EDHOC)" as follows:¶
The columns of the registry are Name, Label, Description, and Reference, where Label is a nonnegative integer and the other columns are text strings. The initial contents of the registry are shown in Table 10. EAD label 23 is Reserved.¶
| Name | Label | Description | Reference |
|---|---|---|---|
| Padding | 0 | Randomly generated CBOR byte string | RFC 9528, Section 3.8.1 |
| 23 | Reserved | RFC 9528 |
| Range | Registration Procedures |
|---|---|
| 0 to 23 | Standards Action with Expert Review |
| 24 to 65535 | Specification Required |
10.6. COSE Header Parameters Registry
IANA has registered the following entries in the "COSE Header Parameters" registry under the registry group "CBOR Object Signing and Encryption (COSE)" (see Table 12). The value of the 'kcwt' header parameter is a COSE Web Token (CWT) [RFC8392], and the value of the 'kccs' header parameter is a CWT Claims Set (CCS); see Section 1.4. The CWT/CCS must contain a COSE_
| Name | Label | Value Type | Description |
|---|---|---|---|
| kcwt | 13 | COSE_ |
A CBOR Web Token (CWT) containing
a COSE_ |
| kccs | 14 | map | A CWT Claims Set (CCS) containing
a COSE_ |
10.7. Well-Known URI Registry
IANA has added the well-known URI "edhoc" to the "Well-Known URIs" registry.¶
10.8. Media Types Registry
IANA has added the media types "application
10.8.1. application/edhoc+cbor-seq Media Type Registration
- Type name:
- application¶
- Subtype name:
- edhoc+cbor-seq¶
- Required parameters:
- N/A¶
- Optional parameters:
- N/A¶
- Encoding considerations:
- binary¶
- Security considerations:
- See Section 7 of RFC 9528.¶
- Interoperability considerations:
- N/A¶
- Published specification:
- RFC 9528¶
- Applications that use this media type:
- To be identified¶
- Fragment identifier considerations:
- N/A¶
- Additional information:
-
- Person & email address to contact for further information:
- See "Authors' Addresses" section in RFC 9528.¶
- Intended usage:
- COMMON¶
- Restrictions on usage:
- N/A¶
- Author:
- See "Authors' Addresses" section.¶
- Change Controller:
- IETF¶
10.8.2. application/cid-edhoc+cbor-seq Media Type Registration
- Type name:
- application¶
- Subtype name:
- cid
-edhoc+cbor -seq¶ - Required parameters:
- N/A¶
- Optional parameters:
- N/A¶
- Encoding considerations:
- binary¶
- Security considerations:
- See Section 7 of RFC 9528.¶
- Interoperability considerations:
- N/A¶
- Published specification:
- RFC 9528¶
- Applications that use this media type:
- To be identified¶
- Fragment identifier considerations:
- N/A¶
- Additional information:
-
- Person & email address to contact for further information:
- See "Authors' Addresses" section in RFC 9528.¶
- Intended usage:
- COMMON¶
- Restrictions on usage:
- N/A¶
- Author:
- See "Authors' Addresses" section.¶
- Change Controller:
- IETF¶
10.9. CoAP Content-Formats Registry
IANA has added the media types "application
| Content Type | Content Coding | ID | Reference |
|---|---|---|---|
| application |
- | 64 | RFC 9528 |
| application |
- | 65 | RFC 9528 |
10.10. Resource Type (rt=) Link Target Attribute Values Registry
IANA has added the resource type "core.edhoc" to the "Resource Type (rt=) Link Target Attribute Values" registry under the registry group "Constrained RESTful Environments (CoRE) Parameters".¶
10.11. Expert Review Instructions
The IANA registries established in this document are defined as "Expert Review", "Specification Required", or "Standards Action with Expert Review". This section gives some general guidelines for what the experts should be looking for, but they are being designated as experts for a reason so they should be given substantial latitude.¶
Expert reviewers should take into consideration the following points:¶
- The clarity and correctness of registrations. Experts are expected to check the clarity of purpose and use of the requested entries. Expert needs to make sure the values of algorithms are taken from the right registry when that is required. Experts should consider requesting an opinion on the correctness of registered parameters from relevant IETF working groups. Encodings that do not meet these objectives of clarity and completeness should not be registered.¶
- The expected usage of fields when approving code point assignment. The length of the encoded value should be weighed against how many code points of that length are left, the size of device it will be used on, and the number of code points left that encode to that size.¶
- It is recommended to have a specification even if the registration procedure is "Expert Review". When specifications are not provided for a request where Expert Review is the assignment policy, the description provided needs to have sufficient information to verify the code points as above.¶
11. References
11.1. Normative References
- [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC3279]
-
Bassham, L., Polk, W., and R. Housley, "Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 3279, DOI 10
.17487 , , <https:///RFC3279 www >..rfc -editor .org /info /rfc3279 - [RFC3552]
-
Rescorla, E. and B. Korver, "Guidelines for Writing RFC Text on Security Considerations", BCP 72, RFC 3552, DOI 10
.17487 , , <https:///RFC3552 www >..rfc -editor .org /info /rfc3552 - [RFC5116]
-
McGrew, D., "An Interface and Algorithms for Authenticated Encryption", RFC 5116, DOI 10
.17487 , , <https:///RFC5116 www >..rfc -editor .org /info /rfc5116 - [RFC5869]
-
Krawczyk, H. and P. Eronen, "HMAC-based Extract
-and , RFC 5869, DOI 10-Expand Key Derivation Function (HKDF)" .17487 , , <https:///RFC5869 www >..rfc -editor .org /info /rfc5869 - [RFC6090]
-
McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic Curve Cryptography Algorithms", RFC 6090, DOI 10
.17487 , , <https:///RFC6090 www >..rfc -editor .org /info /rfc6090 - [RFC6960]
-
Santesson, S., Myers, M., Ankney, R., Malpani, A., Galperin, S., and C. Adams, "X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP", RFC 6960, DOI 10
.17487 , , <https:///RFC6960 www >..rfc -editor .org /info /rfc6960 - [RFC6979]
-
Pornin, T., "Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)", RFC 6979, DOI 10
.17487 , , <https:///RFC6979 www >..rfc -editor .org /info /rfc6979 - [RFC7252]
-
Shelby, Z., Hartke, K., and C. Bormann, "The Constrained Application Protocol (CoAP)", RFC 7252, DOI 10
.17487 , , <https:///RFC7252 www >..rfc -editor .org /info /rfc7252 - [RFC7748]
-
Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves for Security", RFC 7748, DOI 10
.17487 , , <https:///RFC7748 www >..rfc -editor .org /info /rfc7748 - [RFC7959]
-
Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in the Constrained Application Protocol (CoAP)", RFC 7959, DOI 10
.17487 , , <https:///RFC7959 www >..rfc -editor .org /info /rfc7959 - [RFC8126]
-
Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10
.17487 , , <https:///RFC8126 www >..rfc -editor .org /info /rfc8126 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC8392]
-
Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, "CBOR Web Token (CWT)", RFC 8392, DOI 10
.17487 , , <https:///RFC8392 www >..rfc -editor .org /info /rfc8392 - [RFC8410]
-
Josefsson, S. and J. Schaad, "Algorithm Identifiers for Ed25519, Ed448, X25519, and X448 for Use in the Internet X.509 Public Key Infrastructure", RFC 8410, DOI 10
.17487 , , <https:///RFC8410 www >..rfc -editor .org /info /rfc8410 - [RFC8610]
-
Birkholz, H., Vigano, C., and C. Bormann, "Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures", RFC 8610, DOI 10
.17487 , , <https:///RFC8610 www >..rfc -editor .org /info /rfc8610 - [RFC8613]
-
Selander, G., Mattsson, J., Palombini, F., and L. Seitz, "Object Security for Constrained RESTful Environments (OSCORE)", RFC 8613, DOI 10
.17487 , , <https:///RFC8613 www >..rfc -editor .org /info /rfc8613 - [RFC8724]
-
Minaburo, A., Toutain, L., Gomez, C., Barthel, D., and JC. Zuniga, "SCHC: Generic Framework for Static Context Header Compression and Fragmentation", RFC 8724, DOI 10
.17487 , , <https:///RFC8724 www >..rfc -editor .org /info /rfc8724 - [RFC8742]
-
Bormann, C., "Concise Binary Object Representation (CBOR) Sequences", RFC 8742, DOI 10
.17487 , , <https:///RFC8742 www >..rfc -editor .org /info /rfc8742 - [RFC8747]
-
Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. Tschofenig, "Proof
-of , RFC 8747, DOI 10-Possession Key Semantics for CBOR Web Tokens (CWTs)" .17487 , , <https:///RFC8747 www >..rfc -editor .org /info /rfc8747 - [RFC8949]
-
Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", STD 94, RFC 8949, DOI 10
.17487 , , <https:///RFC8949 www >..rfc -editor .org /info /rfc8949 - [RFC9052]
-
Schaad, J., "CBOR Object Signing and Encryption (COSE): Structures and Process", STD 96, RFC 9052, DOI 10
.17487 , , <https:///RFC9052 www >..rfc -editor .org /info /rfc9052 - [RFC9053]
-
Schaad, J., "CBOR Object Signing and Encryption (COSE): Initial Algorithms", RFC 9053, DOI 10
.17487 , , <https:///RFC9053 www >..rfc -editor .org /info /rfc9053 - [RFC9175]
-
Amsüss, C., Preuß Mattsson, J., and G. Selander, "Constrained Application Protocol (CoAP): Echo, Request-Tag, and Token Processing", RFC 9175, DOI 10
.17487 , , <https:///RFC9175 www >..rfc -editor .org /info /rfc9175 - [RFC9360]
-
Schaad, J., "CBOR Object Signing and Encryption (COSE): Header Parameters for Carrying and Referencing X.509 Certificates", RFC 9360, DOI 10
.17487 , , <https:///RFC9360 www >..rfc -editor .org /info /rfc9360
11.2. Informative References
- [Bruni18]
-
Bruni, A., Sahl Jørgensen, T., Grønbech Petersen, T., and C. Schürmann, "Formal Verification of Ephemeral Diffie-Hellman Over COSE (EDHOC)", , <https://
www >..springerprofess ional .de /en /formal -verification -of -ephemeral -diffie -hellman -over -cose -edhoc /16284348 - [C509-CERTS]
-
Preuß Mattsson, J., Selander, G., Raza, S., Höglund, J., and M. Furuhed, "CBOR Encoded X.509 Certificates (C509 Certificates)", Work in Progress, Internet-Draft, draft
-ietf , , <https://-cose -cbor -encoded -cert -09 datatracker >..ietf .org /doc /html /draft -ietf -cose -cbor -encoded -cert -09 - [CborMe]
- Bormann, C., "CBOR Playground", <https://cbor.me/>.
- [CNSA]
-
Wikipedia, "Commercial National Security Algorithm Suite", , <https://
en >..wikipedia .org /w /index .php ?title =Commercial_ National_ Security_ Algorithm_ Suite &oldid =1181333611 - [CoAP-SEC-PROT]
-
Mattsson, J. P., Palombini, F., and M. Vučinić, "Comparison of CoAP Security Protocols", Work in Progress, Internet-Draft, draft
-ietf , , <https://-iotops -security -protocol -comparison -04 datatracker >..ietf .org /doc /html /draft -ietf -iotops -security -protocol -comparison -04 - [Cottier
Pointcheval22] -
Cottier, B. and D. Pointcheval, "Security Analysis of the EDHOC protocol", , <https://
arxiv >..org /abs /2209 .03599 - [CURVE-REPR]
-
Struik, R., "Alternative Elliptic Curve Representations
" , Work in Progress, Internet-Draft, draft-ietf , , <https://-lwig -curve -representations -23 datatracker >..ietf .org /doc /html /draft -ietf -lwig -curve -representations -23 - [Degabriele11]
-
Degabriele, J., Lehmann, A., Paterson, K., Smart, N., and M. Strefler, "On the Joint Security of Encryption and Signature in EMV", , <https://
eprint >..iacr .org /2011 /615 - [EAT]
-
Lundblade, L., Mandyam, G., O'Donoghue, J., and C. Wallace, "The Entity Attestation Token (EAT)", Work in Progress, Internet-Draft, draft
-ietf , , <https://-rats -eat -25 datatracker >..ietf .org /doc /html /draft -ietf -rats -eat -25 - [EDHOC
-Co AP -OSCORE] -
Palombini, F., Tiloca, M., Höglund, R., Hristozov, S., and G. Selander, "Using Ephemeral Diffie-Hellman Over COSE (EDHOC) with the Constrained Application Protocol (CoAP) and Object Security for Constrained RESTful Environments (OSCORE)", Work in Progress, Internet-Draft, draft
-ietf , , <https://-core -oscore -edhoc -10 datatracker >..ietf .org /doc /html /draft -ietf -core -oscore -edhoc -10 - [Guenther
Ilunga22] -
Günther, F. and M. Mukendi, "Careful with MAc-then-SIGn: A Computational Analysis of the EDHOC Lightweight Authenticated Key Exchange Protocol", , <https://
eprint >..iacr .org /2022 /1705 - [HEDGED
-ECC -SIGS] -
Preuß Mattsson, J., Thormarker, E., and S. Ruohomaa, "Hedged ECDSA and EdDSA Signatures", Work in Progress, Internet-Draft, draft
-irtf , , <https://-cfrg -det -sigs -with -noise -02 datatracker >..ietf .org /doc /html /draft -irtf -cfrg -det -sigs -with -noise -02 - [HKDFpaper]
-
Krawczyk, H., "Cryptographic Extraction and Key Derivation: The HKDF Scheme", , <https://
eprint >..iacr .org /2010 /264 .pdf - [IEEE
.802 .15 .4 -2015] -
IEEE, "IEEE Standard for Low-Rate Wireless Networks", DOI 10
.1109 , , <https:///IEEESTD .2016 .7460875 ieeexplore >..ieee .org /document /7460875 - [Jacomme23]
-
Jacomme, C., Klein, E., Kremer, S., and M. Racouchot, "A comprehensive, formal and automated analysis of the EDHOC protocol", , <https://
hal >..inria .fr /hal -03810102 / - [KUDOS]
-
Höglund, R. and M. Tiloca, "Key Update for OSCORE (KUDOS)", Work in Progress, Internet-Draft, draft
-ietf , , <https://-core -oscore -key -update -07 datatracker >..ietf .org /doc /html /draft -ietf -core -oscore -key -update -07 - [LAKE-AUTHZ]
-
Selander, G., Mattsson, J. P., Vučinić, M., Fedrecheski, G., and M. Richardson, "Lightweight Authorization using Ephemeral Diffie-Hellman Over COSE", Work in Progress, Internet-Draft, draft
-ietf , , <https://-lake -authz -01 datatracker >..ietf .org /doc /html /draft -ietf -lake -authz -01 - [LAKE-REQS]
-
Vučinić, M., Selander, G., Preuß Mattsson, J., and D. Garcia-Carillo, "Requirements for a Lightweight AKE for OSCORE", Work in Progress, Internet-Draft, draft
-ietf , , <https://-lake -reqs -04 datatracker >..ietf .org /doc /html /draft -ietf -lake -reqs -04 - [NISTPQC]
-
National Institute Standards and Technology (NIST), "Post-Quantum Cryptography FAQs", <https://
csrc >..nist .gov /Projects /post -quantum -cryptography /faqs - [Noise]
-
Perrin, T., "The Noise Protocol Framework", Revision 34, , <https://
noiseprotocol >..org /noise .html - [Norrman20]
-
Norrman, K., Sundararajan, V., and A. Bruni, "Formal Analysis of EDHOC Key Establishment for Constrained IoT Devices", , <https://
arxiv >..org /abs /2007 .11427 - [RFC2986]
-
Nystrom, M. and B. Kaliski, "PKCS #10: Certification Request Syntax Specification Version 1.7", RFC 2986, DOI 10
.17487 , , <https:///RFC2986 www >..rfc -editor .org /info /rfc2986 - [RFC5280]
-
Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, DOI 10
.17487 , , <https:///RFC5280 www >..rfc -editor .org /info /rfc5280 - [RFC6194]
-
Polk, T., Chen, L., Turner, S., and P. Hoffman, "Security Considerations for the SHA-0 and SHA-1 Message-Digest Algorithms", RFC 6194, DOI 10
.17487 , , <https:///RFC6194 www >..rfc -editor .org /info /rfc6194 - [RFC7228]
-
Bormann, C., Ersue, M., and A. Keranen, "Terminology for Constrained
-Node Networks" , RFC 7228, DOI 10.17487 , , <https:///RFC7228 www >..rfc -editor .org /info /rfc7228 - [RFC7258]
-
Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an Attack", BCP 188, RFC 7258, DOI 10
.17487 , , <https:///RFC7258 www >..rfc -editor .org /info /rfc7258 - [RFC7296]
-
Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. Kivinen, "Internet Key Exchange Protocol Version 2 (IKEv2)", STD 79, RFC 7296, DOI 10
.17487 , , <https:///RFC7296 www >..rfc -editor .org /info /rfc7296 - [RFC7624]
-
Barnes, R., Schneier, B., Jennings, C., Hardie, T., Trammell, B., Huitema, C., and D. Borkmann, "Confidentiality in the Face of Pervasive Surveillance: A Threat Model and Problem Statement", RFC 7624, DOI 10
.17487 , , <https:///RFC7624 www >..rfc -editor .org /info /rfc7624 - [RFC8366]
-
Watsen, K., Richardson, M., Pritikin, M., and T. Eckert, "A Voucher Artifact for Bootstrapping Protocols", RFC 8366, DOI 10
.17487 , , <https:///RFC8366 www >..rfc -editor .org /info /rfc8366 - [RFC8376]
-
Farrell, S., Ed., "Low-Power Wide Area Network (LPWAN) Overview", RFC 8376, DOI 10
.17487 , , <https:///RFC8376 www >..rfc -editor .org /info /rfc8376 - [RFC8446]
-
Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10
.17487 , , <https:///RFC8446 www >..rfc -editor .org /info /rfc8446 - [RFC8937]
-
Cremers, C., Garratt, L., Smyshlyaev, S., Sullivan, N., and C. Wood, "Randomness Improvements for Security Protocols", RFC 8937, DOI 10
.17487 , , <https:///RFC8937 www >..rfc -editor .org /info /rfc8937 - [RFC9000]
-
Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based Multiplexed and Secure Transport", RFC 9000, DOI 10
.17487 , , <https:///RFC9000 www >..rfc -editor .org /info /rfc9000 - [RFC9147]
-
Rescorla, E., Tschofenig, H., and N. Modadugu, "The Datagram Transport Layer Security (DTLS) Protocol Version 1.3", RFC 9147, DOI 10
.17487 , , <https:///RFC9147 www >..rfc -editor .org /info /rfc9147 - [RFC9176]
-
Amsüss, C., Ed., Shelby, Z., Koster, M., Bormann, C., and P. van der Stok, "Constrained RESTful Environments (CoRE) Resource Directory", RFC 9176, DOI 10
.17487 , , <https:///RFC9176 www >..rfc -editor .org /info /rfc9176 - [RFC9397]
-
Pei, M., Tschofenig, H., Thaler, D., and D. Wheeler, "Trusted Execution Environment Provisioning (TEEP) Architecture", RFC 9397, DOI 10
.17487 , , <https:///RFC9397 www >..rfc -editor .org /info /rfc9397 - [RFC9529]
-
Selander, G., Preuß Mattsson, J., Serafin, M., Tiloca, M., and M. Vučinić, "Traces of Ephemeral Diffie-Hellman Over COSE (EDHOC)", RFC 9529, DOI 10
.17487 , , <https:///RFC9529 www >..rfc -editor .org /info /rfc9529 - [SECG]
-
Certicom Research, "SEC 1: Elliptic Curve Cryptography", Standards for Efficient Cryptography, , <https://
www >..secg .org /sec1 -v2 .pdf - [SIGMA]
-
Krawczyk, H., "SIGMA: the 'SIGn-and-MAc' Approach to Authenticated Diffie-Hellman and Its Use in the IKE-Protocols", , <https://
www >..iacr .org /cryptodb /archive /2003 /CRYPTO /1495 /1495 .pdf - [SP-800-108]
-
Chen, L., "Recommendation for Key Derivation Using Pseudorandom Functions", NIST Special Publication 800-108 Revision 1, DOI 10
.6028 , , <https:///NIST .SP .800 -108r1 -upd1 doi >..org /10 .6028 /NIST .SP .800 -108r1 -upd1 - [SP-800-56A]
-
Barker, E., Chen, L., Roginsky, A., Vassilev, A., and R. Davis, "Recommendation for Pair-Wise Key
-Establishment Schemes Using Discrete Logarithm Cryptography" , NIST Special Publication 800-56A Revision 3, DOI 10.6028 , , <https:///NIST .SP .800 -56Ar3 doi >..org /10 .6028 /NIST .SP .800 -56Ar3 - [SP800-185]
-
Kelsey, J., Chang, S., and R. Perlner, "SHA-3 Derived Functions cSHAKE, KMAC, TupleHash and ParallelHash", NIST Special Publication 800-185, DOI 10
.6028 , , <https:///NIST .SP .800 -185 doi >..org /10 .6028 /NIST .SP .800 -185 - [Thormarker21]
-
Thormarker, E., "On using the same key pair for Ed25519 and an X25519 based KEM", , <https://
eprint >..iacr .org /2021 /509 .pdf - [THREAT
-MODEL -GUIDANCE] -
Arkko, J. and S. Farrell, "Internet Threat Model Guidance", Work in Progress, Internet-Draft, draft
-arkko , , <https://-arch -internet -threat -model -guidance -00 datatracker >..ietf .org /doc /html /draft -arkko -arch -internet -threat -model -guidance -00
Appendix A. Use with OSCORE and Transfer over CoAP
This appendix describes how to derive an OSCORE security context when EDHOC is used to key OSCORE and how to transfer EDHOC messages over CoAP. The use of CoAP or OSCORE with EDHOC is optional, but if you are using CoAP or OSCORE, then certain normative requirements apply as detailed in the subsections.¶
A.1. Deriving the OSCORE Security Context
This section specifies how to use EDHOC output to derive the OSCORE security context.¶
After successful processing of EDHOC message_
-
The Master Secret and Master Salt SHALL be derived by using the EDHOC_
Exporter interface (see Section 4.2.1):¶ - The EDHOC Exporter Labels for deriving the OSCORE Master Secret and OSCORE Master Salt are the uints 0 and 1, respectively.¶
- The context parameter is h'' (0x40), the empty CBOR byte string.¶
- By default, oscore_
key_ length is the key length (in bytes) of the application AEAD Algorithm of the selected cipher suite for the EDHOC session. Also by default, oscore_ salt_ length has value 8. The Initiator and Responder MAY agree out-of-band on a longer oscore_ key_ length than the default and on shorter or longer than the default oscore_ salt_ length .¶
Master Secret = EDHOC_Exporter( 0, h'', oscore_key_length ) Master Salt = EDHOC_Exporter( 1, h'', oscore_salt_length )
- The AEAD Algorithm SHALL be the application AEAD algorithm of the selected cipher suite for the EDHOC session.¶
- The HKDF Algorithm SHALL be the one based on the application hash algorithm of the selected cipher suite for the EDHOC session. For example, if SHA-256 is the application hash algorithm of the selected cipher suite, HKDF SHA-256 is used as the HKDF Algorithm in the OSCORE Security Context.¶
- The relationship between identifiers in OSCORE and EDHOC is specified in Section 3.3.3. The OSCORE Sender ID and Recipient ID SHALL be determined by EDHOC connection identifiers C_
R and C_ I for the EDHOC session as shown in Table 14.¶
| OSCORE Sender ID | OSCORE Recipient ID | |
|---|---|---|
| EDHOC Initiator | C_ |
C_ |
| EDHOC Responder | C_ |
C_ |
The Client and Server SHALL use the parameters above to establish an OSCORE Security Context, as per Section 3.2.1 of [RFC8613].¶
From then on, the Client and Server retrieve the OSCORE protocol state using the Recipient ID and optionally other transport information such as the 5-tuple.¶
A.2. Transferring EDHOC over CoAP
This section specifies how EDHOC can be transferred as an exchange of CoAP [RFC7252] messages. CoAP provides a reliable transport that can preserve packet ordering, provides flow and congestion control, and handles message duplication. CoAP can also perform fragmentation and mitigate certain denial
EDHOC may run with the Initiator either being a CoAP client or CoAP server. We denote the former by the "forward message flow" (see Appendix A.2.1) and the latter by the "reverse message flow" (see Appendix A.2.2). By default, we assume the forward message flow, but the roles SHOULD be chosen to protect the most sensitive identity; see Section 9.¶
According to this specification, EDHOC is transferred in POST requests to the Uri-Path: "
In order for the server to correlate a message received from a client to a message previously sent in the same EDHOC session over CoAP, messages sent by the client SHALL be prepended with the CBOR serialization of the connection identifier that the server has selected; see Section 3.4.1. This applies both to the forward and the reverse message flows. To indicate a new EDHOC session in the forward message flow, message_true (0xf5). Even if CoAP is carried over a reliable transport protocol, such as TCP, the prepending of identifiers specified here SHALL be practiced to enable interoperabilit
The prepended identifiers are encoded in CBOR and thus self
An EDHOC message has media type "application
To mitigate certain denial
EDHOC error messages need to be transported in response to a message that failed (see Section 6). EDHOC error messages transported with CoAP are carried in the payload.¶
Note that the transport over CoAP can serve as a blueprint for other client-server protocols:¶
- The client prepends the connection identifier selected by the server (or, for message_
1, the CBOR simple value true) to any request message it sends.¶ - The server does not send any such indicator, as responses are matched to request by the client-server protocol design.¶
A.2.1. The Forward Message Flow
In the forward message flow, the CoAP client is the Initiator and the CoAP server is the Responder. This flow protects the client identity against active attackers and the server identity against passive attackers.¶
In the forward message flow, the CoAP Token enables correlation on the Initiator (client) side, and the prepended C_
- EDHOC message_
1 is sent in the payload of a POST request from the client to the server's resource for EDHOC, prepended with the identifier true(0xf5), indicating a new EDHOC session.¶ - EDHOC message_
2 or the EDHOC error message is sent from the server to the client in the payload of the response, in the former case with response code 2.04 (Changed) and in the latter with response code as specified in Appendix A.2.3.¶ - EDHOC message_
3 or the EDHOC error message is sent from the client to the server's resource in the payload of a POST request, prepended with connection identifier C_ R .¶ - If EDHOC message_
4 is used, or in case of an error message, it is sent from the server to the client in the payload of the response, with response codes analogously to message_ 2 . In case of an error message sent in response to message_ 4, it is sent analogously to the error message sent in response to message_ 2 .¶
An example of a completed EDHOC session over CoAP in the forward message flow is shown in Figure 10.¶
The forward message flow of EDHOC can be combined with an OSCORE exchange in a total of two round trips; see [EDHOC
A.2.2. The Reverse Message Flow
In the reverse message flow, the CoAP client is the Responder and the CoAP server is the Initiator. This flow protects the server identity against active attackers and the client identity against passive attackers.¶
In the reverse message flow, the CoAP Token enables correlation on the Responder (client) side, and the prepended C_
- To trigger a new EDHOC session, the client makes an empty POST request to the server's resource for EDHOC.¶
- EDHOC message_
1 is sent from the server to the client in the payload of the response with response code 2.04 (Changed).¶ - EDHOC message_
2 or the EDHOC error message is sent from the client to the server's resource in the payload of a POST request, prepended with connection identifier C_ I .¶ - EDHOC message_
3 or the EDHOC error message is sent from the server to the client in the payload of the response, in the former case with response code 2.04 (Changed) and in the latter with response code as specified in Appendix A.2.3.¶ - If EDHOC message_
4 is used, or in case of an error message, it is sent from the client to the server's resource in the payload of a POST request, prepended with connection identifier C_ I . In case of an error message sent in response to message_ 4, it is sent analogously to an error message sent in response to message_ 2 .¶
An example of a completed EDHOC session over CoAP in the reverse message flow is shown in Figure 11.¶
A.2.3. Errors in EDHOC over CoAP
When using EDHOC over CoAP, EDHOC error messages sent as CoAP responses MUST be sent in the payload of error responses, i.e., they MUST specify a CoAP error response code. In particular, it is RECOMMENDED that such error responses have response code either 4.00 (Bad Request) in case of client error (e.g., due to a malformed EDHOC message) or 5.00 (Internal Server Error) in case of server error (e.g., due to failure in deriving EDHOC keying material). The Content-Format of the error response MUST be set to "application
Appendix B. Compact Representation
This section defines a format for compact representation based on the Elliptic
As described in Section 4.2 of [RFC6090], the x-coordinate of an elliptic curve public key is a suitable representative for the entire point whenever scalar multiplication is used as a one-way function. One example is ECDH with compact output, where only the x-coordinate of the computed value is used as the shared secret.¶
In EDHOC, compact representation is used for the ephemeral public keys
- Convert the field element xp to an octet string X of length ceil( (log2 q) / 8 ) octets using the conversion routine specified in Section 2.3.5 of [SECG].¶
- Output M = X.¶
The encoding of the point at infinity is not supported.¶
Compact representation does not change any requirements on validation; see Section 9.2. Using compact representation has some security benefits. An implementation does not need to check that the point is not the point at infinity (the identity element). Similarly, as not even the sign of the y-coordinate is encoded, compact representation trivially avoids so-called "benign malleability" attacks where an attacker changes the sign; see [SECG].¶
The following may be needed for validation or compatibility with APIs that do not support compact representation or do not support the full [SECG] format:¶
- If a compressed y-coordinate is required, then the value ~yp set to zero can be used. In such a case, the compact representation described above can be transformed into the Standards for Efficient Cryptography Group (SECG) point
-compressed format by prepending it with the single byte 0x02 (i.e., M = 0x02 || X).¶ - If an uncompressed y-coordinate is required, then a y-coordinate has to be calculated following Section 2.3.4 of [SECG] or Appendix C of [RFC6090]. Any of the square roots (see [SECG] or [RFC6090]) can be used. The uncompressed SECG format is M = 0x04 || X || Y.¶
For example: The curve P-256 has the parameters (using the notation in [RFC6090]):¶
- p = 2256 - 2224 + 2192 + 296 - 1¶
- a = -3¶
- b = 410583637251521
4212932612978004 7268409114441015 9937255 548352563140394 67401291¶
Given an example x:¶
- x = 115792089183396
3020955468071547 4055844340679510 8653336 398970697772788 799766525¶
We can calculate y as the square root w = (x3 + a ⋅ x + b)((p + 1)/4) (mod p).¶
- y = 834387180070192
8068200758649186 2600528145125996 4015754 166325229405958 60276856¶
Note that this does not guarantee that (x, y) is on the correct elliptic curve. A full validation according to Section 5.6.2.3.3 of [SP-800-56A] is done by also checking that 0 ≤ x < p and that y2 ≡ x3 + a ⋅ x + b (mod p).¶
Appendix C. Use of CBOR, CDDL, and COSE in EDHOC
This appendix is intended to help implementors not familiar with CBOR [RFC8949], CDDL [RFC8610], COSE [RFC9052], and HKDF [RFC5869].¶
C.1. CBOR and CDDL
The Concise Binary Object Representation (CBOR) [RFC8949] is a data format designed for small code size and small message size. CBOR builds on the JSON data model but extends it by, e.g., encoding binary data directly without base64 conversion. In addition to the binary CBOR encoding, CBOR also has a diagnostic notation that is readable and editable by humans. The Concise Data Definition Language (CDDL) [RFC8610] provides a way to express structures for protocol messages and APIs that use CBOR. [RFC8610] also extends the diagnostic notation.¶
CBOR data items are encoded to or decoded from byte strings using a type
The EDHOC specification sometimes use CDDL names in CBOR diagnostic notation as in, e.g., << ID_
For a complete specification and more examples, see [RFC8949] and [RFC8610]. We recommend implementors get used to CBOR by using the CBOR playground [CborMe].¶
| Diagnostic | Encoded | Type |
|---|---|---|
| 1 | 0x01 | unsigned integer |
| 24 | 0x1818 | unsigned integer |
| -24 | 0x37 | negative integer |
| -25 | 0x3818 | negative integer |
| true | 0xf5 | simple value |
| h'' | 0x40 | byte string |
| h'12cd' | 0x4212cd | byte string |
| '12cd' | 0x4431326364 | byte string |
| "12cd" | 0x6431326364 | text string |
| { 4 : h'cd' } | 0xa10441cd | map |
| << 1, 2, true >> | 0x430102f5 | byte string |
| [ 1, 2, true ] | 0x830102f5 | array |
| ( 1, 2, true ) | 0x0102f5 | sequence |
| 1, 2, true | 0x0102f5 | sequence |
C.2. CDDL Definitions
This section compiles the CDDL definitions for ease of reference.¶
suites = [ 2* int ] / int ead = ( ead_label : int, ? ead_value : bstr, ) EAD_1 = 1* ead EAD_2 = 1* ead EAD_3 = 1* ead EAD_4 = 1* ead message_1 = ( METHOD : int, SUITES_I : suites, G_X : bstr, C_I : bstr / -24..23, ? EAD_1, ) message_2 = ( G_Y_CIPHERTEXT_2 : bstr, ) PLAINTEXT_2 = ( C_R, ID_CRED_R : map / bstr / -24..23, Signature_or_MAC_2 : bstr, ? EAD_2, ) message_3 = ( CIPHERTEXT_3 : bstr, ) PLAINTEXT_3 = ( ID_CRED_I : map / bstr / -24..23, Signature_or_MAC_3 : bstr, ? EAD_3, ) message_4 = ( CIPHERTEXT_4 : bstr, ) PLAINTEXT_4 = ( ? EAD_4, ) error = ( ERR_CODE : int, ERR_INFO : any, ) info = ( info_label : int, context : bstr, length : uint, )
C.3. COSE
CBOR Object Signing and Encryption (COSE) [RFC9052] describes how to create and process signatures, MACs, and encryptions using CBOR. COSE builds on JSON Object Signing and Encryption (JOSE) but is adapted to allow more efficient processing in constrained devices. EDHOC makes use of COSE_
- ECDH ephemeral public keys of type EC2 or OKP in message_
1 and message_ 2 consist of the COSE_ Key parameter named 'x'; see Sections 7.1 and 7.2 of [RFC9053].¶ -
The ciphertexts in message_
3 and message_ 4 consist of a subset of the single recipient encrypted data object COSE_ Encrypt0, which is described in Sections 5.2 and 5.3 of [RFC9052]. The ciphertext is computed over the plaintext and associated data, using an encryption key and an initialization vector. The associated data is an Enc_ structure consisting of protected headers and externally supplied data (external_ aad ). COSE constructs the input to the AEAD [RFC5116] for message_ i (i = 3 or 4; see Sections 5.4 and 5.5, respectively) as follows:¶ -
Signatures in message_
2 of method 0 and 2, and in message_ 3 of method 0 and 1, consist of a subset of the single signer data object COSE_ Sign1, which is described in Sections 4.2 and 4.4 of [RFC9052]. The signature is computed over a Sig_ structure containing payload, protected headers and externally supplied data (external_ aad ) using a private signature key, and verified using the corresponding public signature key. For COSE_ Sign1, the message to be signed is:¶ ¶[ "Signature1", protected, external_aad, payload ]
where protected, external_
aad, and payload are specified in Sections 5.3 and 5.4.¶
Different header parameters to identify X.509 or C509 certificates by reference are defined in [RFC9360] and [C509-CERTS]:¶
-
by a hash value with the 'x5t' or 'c5t' parameters, respectively:¶
-
or by a URI with the 'x5u' or 'c5u' parameters, respectively:¶
When ID_
- ID_
CRED_ x = { 4 : kid_ x }, where kid_ x : kid, for x = I or R. For further optimization, see Section 3.5.3.¶
Note that ID_
ID_
Appendix D. Authentication-Related Verifications
EDHOC performs certain authentication
EDHOC assumes the existence of mechanisms (certification authority or other trusted third party, pre
In this section, we provide some examples of such verifications. These verifications are the responsibility of the application but may be implemented as part of an EDHOC library.¶
D.1. Validating the Authentication Credential
In addition to the authentication key, the authentication credential may contain other parameters that need to be verified. For example:¶
- In X.509 and C509 certificates, signature keys typically have key usage "digital
Signature", and Diffie-Hellman public keys typically have key usage "keyAgreement" [RFC3279] [RFC8410].¶ - In X.509 and C509 certificates, validity is expressed using Not After and Not Before. In CWT and CCS, the "exp" and "nbf" claims have similar meanings.¶
D.2. Identities
The application must decide on allowing a connection or not, depending on the intended endpoint, and in particular whether it is a specific identity or in a set of identities. To prevent misbinding attacks, the identity of the endpoint is included in a MAC verified through the protocol. More details and examples are provided in this section.¶
Policies for what connections to allow are typically set based on the identity of the other endpoint, and endpoints typically only allow connections from a specific identity or a small restricted set of identities. For example, in the case of a device connecting to a network, the network may only allow connections from devices that authenticate with certificates having a particular range of serial numbers and signed by a particular CA. Conversely, a device may only be allowed to connect to a network that authenticates with a particular public key.¶
- When a Public Key Infrastructure (PKI) is used with certificates, the identity is the subject whose unique name, e.g., a domain name, a Network Access Identifier (NAI), or an Extended Unique Identifier (EUI), is included in the endpoint's certificate.¶
- Similarly, when a PKI is used with CWTs, the identity is the subject identified by the relevant claim(s), such as 'sub' (subject).¶
- When PKI is not used (e.g., CCS, self-signed certificate / CWT), the identity is typically directly associated with the authentication key of the other party. For example, if identities can be expressed in the form of unique subject names assigned to public keys, then a binding to identity is achieved by including both the public key and associated subject name in the authentication credential. CRED_
I or CRED_ R may be a self-signed certificate / CWT or CCS containing the authentication key and the subject name; see Section 3.5.2. Thus, each endpoint needs to know the specific authentication key / unique associated subject name or set of public authentication keys / unique associated subject names, which it is allowed to communicate with.¶
To prevent misbinding attacks in systems where an attacker can register public keys without proving knowledge of the private key, SIGMA [SIGMA] enforces a MAC to be calculated over the "identity". EDHOC follows SIGMA by calculating a MAC over the whole authentication credential, which in case of an X.509 or C509 certificate, includes the "subject" and "subject
(While the SIGMA paper only focuses on the identity, the same principle is true for other information such as policies associated with the public key.)¶
D.3. Certification Path and Trust Anchors
When a Public Key Infrastructure (PKI) is used with certificates, the trust anchor is a certification authority (CA) certificate. Each party needs at least one CA public key certificate or just the CA public key. The certification path contains proof that the subject of the certificate owns the public key in the certificate. Only validated public key certificates are to be accepted.¶
Similarly, when a PKI is used with CWTs, each party needs to have at least one trusted third-party public key as a trust anchor to verify the end entity CWTs. The trusted third-party public key can, e.g., be stored in a self-signed CWT or in a CCS.¶
The signature of the authentication credential needs to be verified with the public key of the issuer. X.509 and C509 certificates includes the "Issuer" field. In CWT and CCS, the "iss" claim has a similar meaning. The public key is either a trust anchor or the public key in another valid and trusted credential in a certification path from the trust anchor to the authentication credential.¶
Similar verifications as made with the authentication credential (see Appendix D.1) are also needed for the other credentials in the certification path.¶
When PKI is not used (CCS and self-signed certificate / CWT), the trust anchor is the authentication key of the other party; in which case, there is no certification path.¶
D.4. Revocation Status
The application may need to verify that the credentials are not revoked; see Section 9.8. Some use cases may be served by short-lived credentials, for example, where the validity of the credential is on par with the interval between revocation checks. But, in general, credential lifetime and revocation checking are complementary measures to control credential status. Revocation information may be transported as External Authorization Data (EAD); see Appendix E.¶
D.5. Unauthenticated Operation
EDHOC might be used without authentication by allowing the Initiator or Responder to communicate with any identity except its own. Note that EDHOC without mutual authentication is vulnerable to active on-path attacks and therefore unsafe for general use. However, it is possible to later establish a trust relationship with an unknown or not-yet-trusted endpoint. Some examples are listed below:¶
- The EDHOC authentication credential can be verified out-of-band at a later stage.¶
- The EDHOC session key can be bound to an identity out-of-band at a later stage.¶
- Trust on first use (TOFU) can be used to verify that several EDHOC connections are made to the same identity. TOFU combined with proximity is a common IoT deployment model that provides good security if done correctly. Note that secure proximity based on short range wireless technology requires very low signal strength or very low latency.¶
Appendix E. Use of External Authorization Data
In order to reduce the number of messages and round trips, or to simplify processing, external security applications may be integrated into EDHOC by transporting related external authorization data (EAD) in the messages.¶
The EAD format is specified in Section 3.8. This section contains examples and further details of how EAD may be used with an appropriate accompanying specification.¶
- One example is third
-party -assisted authorization, requested with EAD_ 1, and an authorization artifact ("voucher", cf. [RFC8366]) returned in EAD_ 2; see [LAKE-AUTHZ].¶ - Another example is remote attestation, requested in EAD_
2, and an Entity Attestation Token (EAT) [EAT] returned in EAD_ 3 .¶ - A third example is certificate enrollment, where a Certificate Signing Request (CSR) [RFC2986] is included in EAD_
3, and the issued public key certificate (X.509 [RFC5280] and C509 [C509-CERTS]) or a reference thereof is returned in EAD_ 4 .¶
External authorization data should be considered unprotected by EDHOC, and the protection of EAD is the responsibility of the security application (third-party authorization, remote attestation, certificate enrollment, etc.). The security properties of the EAD fields (after EDHOC processing) are discussed in Section 9.1.¶
The content of the EAD field may be used in the EDHOC processing of the message in which they are contained. For example, authentication
Conversely, the security application may need to wait for EDHOC message verification to complete. In the third example above, the validation of a CSR carried in EAD_
The security application may reuse EDHOC protocol fields that therefore need to be available to the application. For example, the security application may use the same crypto algorithms as in the EDHOC session and therefore needs access to the selected cipher suite (or the whole SUITES_
The processing of the EAD item
Since data carried in EAD may not be protected, or processed by the application before the EDHOC message is verified, special considerations need to be made such that it does not violate security and privacy requirements of the service that uses this data; see Section 9.5. The content in an EAD item may impact the security properties provided by EDHOC. Security applications making use of the EAD items must perform the necessary security analysis.¶
Appendix F. Application Profile Example
This appendix contains a rudimentary example of an application profile; see Section 3.9.¶
For use of EDHOC with application X, the following assumptions are made:¶
- Transfer in CoAP as specified in Appendix A.2 with requests expected by the CoAP server (= Responder) at /app1-edh, no Content-Format needed.¶
- METHOD = 1 (I uses signature key; R uses static DH key.)¶
-
CRED_
I is an IEEE 802.1AR Initial Device Identifier (IDevID) encoded as a C509 certificate of type 0 [C509-CERTS].¶ -
CRED_
R is a CCS of type OKP as specified in Section 3.5.2.¶ - External authorization data is defined and processed as specified in [LAKE-AUTHZ].¶
- EUI-64 is used as the identity of the endpoint (see an example in Section 3.5.2).¶
- No use of message_
4 . The application sends protected messages from R to I.¶
Appendix G. Long PLAINTEXT_2
By the definition of encryption of PLAINTEXT_
While PLAINTEXT_
A potential work-around is to use a cipher suite with a different hash function. In particular, the use of KMAC removes all practical limitations in this respect.¶
This section specifies a solution that works with any hash function by making use of multiple invocations of HKDF-Expand and negative values of info_
Consider the PLAINTEXT_
PLAINTEXT_2 = P(0) | P(1) | ... | P(last)
where "|" indicates concatenation.¶
The object is to define a matching KEYSTREAM_
CIPHERTEXT_2 = PLAINTEXT_2 XOR KEYSTREAM_2
Define the keystream as:¶
KEYSTREAM_2 = OKM(0) | OKM(1) | ... | OKM(last)
where:¶
OKM(i) = EDHOC_KDF( PRK_2e, -i, TH_2, length(P(i)) )
Note that if length
This describes the processing of the Responder when sending message_
An application profile may specify if it supports or does not support the method described in this appendix.¶
Appendix H. EDHOC_KeyUpdate
To provide forward secrecy in an even more efficient way than re-running EDHOC, this section specifies the optional function EDHOC_
When EDHOC_
EDHOC_KeyUpdate( context ): new PRK_out = EDHOC_KDF( old PRK_out, 11, context, hash_length ) new PRK_exporter = EDHOC_KDF( new PRK_out, 10, h'', hash_length )
where hash_
The EDHOC_
An application using EDHOC_
While this key update method provides forward secrecy, it does not give as strong security properties as re-running EDHOC. EDHOC_
A similar method to do a key update for OSCORE is KUDOS; see [KUDOS].¶
Appendix I. Example Protocol State Machine
This appendix describes an example protocol state machine for the Initiator and Responder. States are denoted in all capitals, and parentheses denote actions taken only in some circumstances.¶
Note that this state machine is just an example, and that details of processing are omitted. For example:¶
- when error messages are being sent (with one exception);¶
- how credentials and EAD are processed by EDHOC and the application in the RCVD state; and¶
- what verifications are made, which includes not only MACs and signatures.¶
I.1. Initiator State Machine
The Initiator sends message_
If the incoming message is an error message, then the Initiator transitions from WAIT_
Upon receiving a non-error message, the Initiator transitions from WAIT_
The Initiator prepares and processes message_
If the application profile includes message_
If the application profile does not include message_
I.2. Responder State Machine
Upon receiving message_
If a processing error occurs on message_
The Responder prepares and processes message_
If the incoming message is an error message, then the Responder transitions from WAIT_
Upon receiving message_
If the application profile includes message_
If message_
Acknowledgments
The authors want to thank Christian Amsüss, Karthikeyan Bhargavan, Carsten Bormann, Alessandro Bruni, Timothy Claeys, Baptiste Cottier, Roman Danyliw, Martin Disch, Martin Duke, Donald Eastlake 3rd, Lars Eggert, Stephen Farrell, Loïc Ferreira, Theis Grønbech Petersen, Felix Günther, Dan Harkins, Klaus Hartke, Russ Housley, Stefan Hristozov, Marc Ilunga, Charlie Jacomme, Elise Klein, Erik Kline, Steve Kremer, Alexandros Krontiris, Ilari Liusvaara, Rafa Marín-López, Kathleen Moriarty, David Navarro, Karl Norrman, Salvador Pérez, Radia Perlman, David Pointcheval, Maïwenn Racouchot, Eric Rescorla, Michael Richardson, Thorvald Sahl Jørgensen, Zaheduzzaman Sarker, Jim Schaad, Michael Scharf, Carsten Schürmann, John Scudder, Ludwig Seitz, Brian Sipos, Stanislav Smyshlyaev, Valery Smyslov, Peter van der Stok, Rene Struik, Vaishnavi Sundararajan, Erik Thormarker, Marco Tiloca, Sean Turner, Michel Veillette, Mališa Vučinić, Paul Wouters, and Lei Yan for reviewing and commenting on intermediate draft versions of this document.¶
We are especially indebted to the late Jim Schaad for his continuous review and implementation of draft versions of this document, as well as his work on other technologies such as COSE and OSCORE without which EDHOC would not have been.¶
Work on this document has in part been supported by the H2020 project SIFIS-Home (grant agreement 952652).¶