RFC 9529: Traces of Ephemeral Diffie-Hellman Over COSE (EDHOC)
- G. Selander,
- J. Preuß Mattsson,
- M. Serafin,
- M. Tiloca,
- M. Vučinić
Abstract
This document contains example traces of Ephemeral Diffie-Hellman Over COSE (EDHOC).¶
Status of This Memo
This document is not an Internet Standards Track specification; it is published for informational purposes.¶
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). Not all documents approved by the IESG are candidates for any level of Internet Standard; see 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
EDHOC [RFC9528] is a lightweight authenticated key exchange protocol designed for highly constrained settings. This document contains annotated traces of EDHOC sessions with input, output, and intermediate processing results to simplify testing of implementations
1.1. Setup
EDHOC is run between an Initiator (I) and a Responder (R). The private/public key pairs and credentials of the Initiator and the Responder required to produce the protocol messages are shown in the traces when needed for the calculations.¶
EDHOC messages and intermediate results are encoded in Concise Binary Object Representation (CBOR) [RFC8949] and can therefore be displayed in CBOR diagnostic notation using, e.g., the CBOR playground [CborMe], which makes them easy to parse for humans. Credentials can also be encoded in CBOR, e.g., CBOR Web Tokens (CWTs) [RFC8392].¶
The document contains two traces:¶
Examples of invalid EDHOC messages are found in Section 4.¶
- Note 1.
- The same name is used for hexadecimal byte strings and their CBOR encodings. The traces contain both the raw byte strings and the corresponding CBOR-encoded data items.¶
- Note 2.
- If not clear from the context, remember that CBOR sequences and CBOR arrays assume CBOR-encoded data items as elements.¶
- Note 3.
- When the protocol transporting EDHOC messages does not inherently provide correlation across all messages, then some messages are typically prepended with connection identifiers and potentially a message_1 indicator (see Section 3.4.1 and Appendix A.2 of [RFC9528]). Those bytes are not included in the traces in this document.¶
1.2. 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.¶
2. Authentication with Signatures, X.509 Identified by 'x5t'
In this example, the Initiator (I) and Responder (R) are authenticated with digital signatures (METHOD = 0). Both the Initiator and the Responder support cipher suite 0, which determines the algorithms:¶
The public keys are represented with X.509 certificates identified by the CBOR Object Signing and Encryption (COSE) header parameter 'x5t'.¶
2.1. message_1
Both endpoints are authenticated with signatures, i.e., METHOD = 0:¶
The Initiator selects cipher suite 0. A single cipher suite is encoded as an int:¶
The Initiator creates an ephemeral key pair for use with the EDHOC key exchange algorithm:¶
The Initiator selects its connection identifier C_I to be the byte string 0x2d, which is encoded as 0x2d since it is represented by the 1-byte CBOR int -14:¶
No external authorization data:¶
The Initiator constructs message_1:¶
2.2. message_2
The Responder supports the most preferred and selected cipher suite 0, so SUITES_I is acceptable.¶
The Responder creates an ephemeral key pair for use with the EDHOC key exchange algorithm:¶
The Responder selects its connection identifier C_R to be the byte string 0x18, which is encoded as h'18' = 0x4118 since it is not represented by a 1-byte CBOR int:¶
The transcript hash TH_2 is calculated using the EDHOC hash algorithm:¶
TH_2 = H( G_Y, H(message_1) )¶
The input to calculate TH_2 is the CBOR sequence:¶
G_Y, H(message_1)¶
PRK_2e is specified in Section 4.1.1.1 of [RFC9528].¶
First, the Elliptic Curve Diffie-Hellman (ECDH) shared secret G_XY is computed from G_X and Y or G_Y and X:¶
Then, PRK_2e is calculated using EDHOC
where salt is TH_2:¶
Since METHOD = 0, the Responder authenticates using signatures. Since the selected cipher suite is 0, the EDHOC signature algorithm is EdDSA.¶
The Responder's signature key pair uses EdDSA:¶
PRK_3e2m is specified in Section 4.1.1.2 of [RFC9528].¶
Since the Responder authenticates with signatures, PRK_3e2m = PRK_2e.¶
The Responder constructs the remaining input needed to calculate MAC_2:¶
MAC_2 = EDHOC_KDF( PRK_3e2m, 2, context_2, mac_length_2 )¶
context_2 = << C_R, ID_CRED_R, TH_2, CRED_R, ? EAD_2 >>¶
CRED_R is identified by a 64-bit hash:¶
where the COSE header value 34 ('x5t') indicates a hash of an X.509 certificate, and the COSE algorithm -15 indicates the hash algorithm SHA-256 truncated to 64 bits.¶
CRED_R is a CBOR byte string of the DER encoding of the X.509 certificate in Section 2.8.1:¶
No external authorization data:¶
context_2 = << C_R, ID_CRED_R, TH_2, CRED_R, ? EAD_2 >>¶
MAC_2 is computed through EDHOC_Expand() using the EDHOC hash algorithm (see Section 4.1.2 of [RFC9528]):¶
where¶
Since METHOD = 0, mac_length_2 is given by the EDHOC hash algorithm.¶
info for MAC_2 is:¶
where the last value is the output size of the EDHOC hash algorithm in bytes.¶
Since METHOD = 0, Signature
The Responder constructs the message to be signed:¶
The Responder signs using the private authentication key SK_R.¶
The Responder constructs PLAINTEXT_2:¶
The input needed to calculate KEYSTREAM_2 is defined in Section 4.1.2 of [RFC9528], using EDHOC_Expand() with the EDHOC hash algorithm:¶
where plaintext
where the last value is the length in bytes of PLAINTEXT_2.¶
The Responder calculates CIPHERTEXT_2 as XOR between PLAINTEXT_2 and KEYSTREAM_2:¶
The Responder constructs message_2:¶
where G
2.3. message_3
Since METHOD = 0, the Initiator authenticates using signatures. Since the selected cipher suite is 0, the EDHOC signature algorithm is EdDSA.¶
The Initiator's signature key pair uses EdDSA:¶
PRK_4e3m is specified in Section 4.1.1.3 of [RFC9528].¶
Since the Initiator authenticates with signatures, PRK_4e3m = PRK_3e2m.¶
The transcript hash TH_3 is calculated using the EDHOC hash algorithm:¶
TH_3 = H( TH_2, PLAINTEXT_2, CRED_R )¶
The Initiator constructs the remaining input needed to calculate MAC_3:¶
where¶
CRED_I is identified by a 64-bit hash:¶
where the COSE header value 34 ('x5t') indicates a hash of an X.509 certificate, and the COSE algorithm -15 indicates the hash algorithm SHA-256 truncated to 64 bits.¶
CRED_I is a CBOR byte string of the DER encoding of the X.509 certificate in Section 2.8.2:¶
No external authorization data:¶
context_3 = << ID_CRED_I, TH_3, CRED_I, ? EAD_3 >>¶
MAC_3 is computed through EDHOC_Expand() using the EDHOC hash algorithm (see Section 4.1.2 of [RFC9528]):¶
where¶
where¶
Since METHOD = 0, mac_length_3 is given by the EDHOC hash algorithm.¶
info for MAC_3 is:¶
where the last value is the output size of the EDHOC hash algorithm in bytes.¶
Since METHOD = 0, Signature
The Initiator constructs the message to be signed:¶
The Initiator signs using the private authentication key SK_I:¶
The Initiator constructs PLAINTEXT_3:¶
The Initiator constructs the associated data for message_3:¶
The Initiator constructs the input needed to derive the key K_3 (see Section 4.1.2 of [RFC9528]) using the EDHOC hash algorithm:¶
where key_length is the key length in bytes for the EDHOC Authenticated Encryption with Associated Data (AEAD) algorithm, and info for K_3 is:¶
where the last value is the key length in bytes for the EDHOC AEAD algorithm.¶
The Initiator constructs the input needed to derive the nonce IV_3 (see Section 4.1.2 of [RFC9528]) using the EDHOC hash algorithm:¶
where iv_length is the nonce length in bytes for the EDHOC AEAD algorithm, and info for IV_3 is:¶
where the last value is the nonce length in bytes for the EDHOC AEAD algorithm.¶
The Initiator calculates CIPHERTEXT_3 as 'ciphertext' of COSE_Encrypt0 applied using the EDHOC AEAD algorithm with plaintext PLAINTEXT_3, additional data A_3, key K_3, and nonce IV_3.¶
message_3 is the CBOR bstr encoding of CIPHERTEXT_3:¶
The transcript hash TH_4 is calculated using the EDHOC hash algorithm:¶
TH_4 = H( TH_3, PLAINTEXT_3, CRED_I )¶
2.4. message_4
No external authorization data:¶
The Responder constructs PLAINTEXT_4:¶
The Responder constructs the associated data for message_4:¶
The Responder constructs the input needed to derive the EDHOC message_4 key (see Section 4.1.2 of [RFC9528]) using the EDHOC hash algorithm:¶
where key_length is the key length in bytes for the EDHOC AEAD algorithm, and info for K_4 is:¶
where the last value is the key length in bytes for the EDHOC AEAD algorithm.¶
The Responder constructs the input needed to derive the EDHOC message_4 nonce (see Section 4.1.2 of [RFC9528]) using the EDHOC hash algorithm:¶
where length is the nonce length in bytes for the EDHOC AEAD algorithm, and info for IV_4 is:¶
where the last value is the nonce length in bytes for the EDHOC AEAD algorithm.¶
The Responder calculates CIPHERTEXT_4 as 'ciphertext' of COSE_Encrypt0 applied using the EDHOC AEAD algorithm with plaintext PLAINTEXT_4, additional data A_4, key K_4, and nonce IV_4.¶
message_4 is the CBOR bstr encoding of CIPHERTEXT_4:¶
2.5. PRK_out and PRK_exporter
PRK_out is specified in Section 4.1.3 of [RFC9528].¶
where hash_length is the length in bytes of the output of the EDHOC hash algorithm, and info for PRK_out is:¶
where the last value is the length in bytes of the output of the EDHOC hash algorithm.¶
The Object Security for Constrained RESTful Environments (OSCORE) Master Secret and OSCORE Master Salt are derived with the EDHOC_Exporter as specified in Section 4.2.1 of [RFC9528].¶
where PRK_exporter is derived from PRK_out:¶
where hash_length is the length in bytes of the output of the EDHOC hash algorithm, and info for the PRK_exporter is:¶
where the last value is the length in bytes of the output of the EDHOC hash algorithm.¶
2.6. OSCORE Parameters
The derivation of OSCORE parameters is specified in Appendix A.1 of [RFC9528].¶
The AEAD and hash algorithms to use in OSCORE are given by the selected cipher suite:¶
The mapping from EDHOC connection identifiers to OSCORE Sender
C_R is mapped to the Recipient ID of the server, i.e., the Sender ID of the client. The byte string 0x18, which as C_R is encoded as the CBOR byte string 0x4118, is converted to the server Recipient ID 0x18.¶
C_I is mapped to the Recipient ID of the client, i.e., the Sender ID of the server. The byte string 0x2d, which as C_I is encoded as the CBOR integer 0x2d, is converted to the client Recipient ID 0x2d.¶
The OSCORE Master Secret is computed through EDHOC_Expand() using the application hash algorithm (see Appendix A.1 of [RFC9528]):¶
where oscore
where the last value is the key length in bytes for the application AEAD algorithm.¶
The OSCORE Master Salt is computed through EDHOC_Expand() using the application hash algorithm (see Section 4.2 of [RFC9528]):¶
where oscore
where the last value is the length in bytes of the OSCORE Master Salt.¶
2.7. Key Update
Key update is defined in Appendix H of [RFC9528].¶
where hash_length is the length in bytes of the output of the EDHOC hash function, and the context for KeyUpdate is:¶
where info for KeyUpdate is:¶
After the key update, the PRK_exporter needs to be derived anew:¶
where info and hash_length are unchanged as in Section 2.5.¶
The OSCORE Master Secret is derived with the updated PRK_exporter:¶
where info and oscore
The OSCORE Master Salt is derived with the updated PRK_exporter:¶
where info and oscore
3. Authentication with Static DH, CCS Identified by 'kid'
In this example, the Initiator and the Responder are authenticated with ephemeral
The public keys are represented as raw public keys (RPKs), encoded in a CWT Claims Set (CCS) and identified by the COSE header parameter 'kid'.¶
3.1. message_1 (First Time)
Both endpoints are authenticated with static DH, i.e., METHOD = 3:¶
The Initiator selects its preferred cipher suite 6. A single cipher suite is encoded as an int:¶
The Initiator creates an ephemeral key pair for use with the EDHOC key exchange algorithm:¶
The Initiator selects its connection identifier C_I to be the byte string 0x0e, which is encoded as 0x0e since it is represented by the 1-byte CBOR int 14:¶
No external authorization data:¶
The Initiator constructs message_1:¶
3.2. error
The Responder does not support cipher suite 6 and sends an error with ERR_CODE 2 containing SUITES_R as ERR_INFO. The Responder proposes cipher suite 2, a single cipher suite thus encoded as an int.¶
3.3. message_1 (Second Time)
Same steps are performed as for message_1 the first time (Section 3.1) but with SUITES_I updated.¶
Both endpoints are authenticated with static DH, i.e., METHOD = 3:¶
The Initiator selects cipher suite 2 and indicates the more preferred cipher suite(s), in this case 6, all encoded as the array [6, 2]:¶
The Initiator creates an ephemeral key pair for use with the EDHOC key exchange algorithm:¶
The Initiator selects its connection identifier C_I to be the byte string 0x37, which is encoded as 0x37 since it is represented by the 1-byte CBOR int -24:¶
No external authorization data:¶
The Initiator constructs message_1:¶
3.4. message_2
The Responder supports the selected cipher suite 2 and not the Initiator's more preferred cipher suite(s) 6, so SUITES_I is acceptable.¶
The Responder creates an ephemeral key pair for use with the EDHOC key exchange algorithm:¶
The Responder selects its connection identifier C_R to be the byte string 0x27, which is encoded as 0x27 since it is represented by the 1-byte CBOR int -8:¶
The transcript hash TH_2 is calculated using the EDHOC hash algorithm:¶
TH_2 = H( G_Y, H(message_1) )¶
The input to calculate TH_2 is the CBOR sequence:¶
G_Y, H(message_1)¶
PRK_2e is specified in Section 4.1.1.1 of [RFC9528].¶
First, the ECDH shared secret G_XY is computed from G_X and Y or G_Y and X:¶
Then, PRK_2e is calculated using EDHOC
where salt is TH_2:¶
Since METHOD = 3, the Responder authenticates using static DH. The EDHOC key exchange algorithm is based on the same curve as for the ephemeral keys, which is P-256, since the selected cipher suite is 2.¶
The Responder's static Diffie-Hellman P-256 key pair consists of a private key and a public key.¶
Since the Responder authenticates with static DH (METHOD = 3), PRK_3e2m is derived from SALT_3e2m and G_RX.¶
The input needed to calculate SALT_3e2m is defined in Section 4.1.2 of [RFC9528], using EDHOC_Expand() with the EDHOC hash algorithm:¶
where hash_length is the length in bytes of the output of the EDHOC hash algorithm, and info for SALT_3e2m is:¶
PRK_3e2m is specified in Section 4.1.1.2 of [RFC9528].¶
PRK_3e2m is derived from G_RX using EDHOC_Extract() with the EDHOC hash algorithm:¶
where G_RX is the ECDH shared secret calculated from G_X and R, or G_R and X.¶
The Responder constructs the remaining input needed to calculate MAC_2:¶
MAC_2 = EDHOC_KDF( PRK_3e2m, 2, context_2, mac_length_2 )¶
context_2 = << C_R, ID_CRED_R, TH_2, CRED_R, ? EAD_2 >>¶
CRED_R is identified by a 'kid' with byte string value 0x32:¶
CRED_R is an RPK encoded as a CCS:¶
No external authorization data:¶
context_2 = << C_R, ID_CRED_R, TH_2, CRED_R, ? EAD_2 >>¶
MAC_2 is computed through EDHOC_Expand() using the EDHOC hash algorithm (see Section 4.1.2 of [RFC9528]):¶
where¶
Since METHOD = 3, mac_length_2 is given by the EDHOC MAC length.¶
info for MAC_2 is:¶
where the last value is the EDHOC MAC length in bytes.¶
Since METHOD = 3, Signature
The Responder constructs PLAINTEXT_2:¶
Since ID_CRED_R contains a single 'kid' parameter, only the byte string value is included in the plaintext, represented as described in Section 3.3.2 of [RFC9528]. The CBOR map { 4 : h'32' } is thus replaced, not by the CBOR byte string 0x4132, but by the CBOR int 0x32, since that is a one-byte encoding of a CBOR integer (-19).¶
The input needed to calculate KEYSTREAM_2 is defined in Section 4.1.2 of [RFC9528], using EDHOC_Expand() with the EDHOC hash algorithm:¶
where plaintext
where the last value is the length in bytes of PLAINTEXT_2.¶
The Responder calculates CIPHERTEXT_2 as XOR between PLAINTEXT_2 and KEYSTREAM_2:¶
The Responder constructs message_2:¶
where G
3.5. message_3
The transcript hash TH_3 is calculated using the EDHOC hash algorithm:¶
TH_3 = H( TH_2, PLAINTEXT_2, CRED_R )¶
Since METHOD = 3, the Initiator authenticates using static DH. The EDHOC key exchange algorithm is based on the same curve as for the ephemeral keys, which is P-256, since the selected cipher suite is 2.¶
The Initiator's static Diffie-Hellman P-256 key pair consists of a private key and a public key:¶
Since I authenticates with static DH (METHOD = 3), PRK_4e3m is derived from SALT_4e3m and G_IY.¶
The input needed to calculate SALT_4e3m is defined in Section 4.1.2 of [RFC9528], using EDHOC_Expand() with the EDHOC hash algorithm:¶
where hash_length is the length in bytes of the output of the EDHOC hash algorithm, and info for SALT_4e3m is:¶
PRK_4e3m is specified in Section 4.1.1.3 of [RFC9528].¶
Since I authenticates with static DH (METHOD = 3), PRK_4e3m is derived from G_IY using EDHOC_Extract() with the EDHOC hash algorithm:¶
where G_IY is the ECDH shared secret calculated from G_I and Y, or G_Y and I.¶
The Initiator constructs the remaining input needed to calculate MAC_3:¶
MAC_3 = EDHOC_KDF( PRK_4e3m, 6, context_3, mac_length_3 )¶
context_3 = << ID_CRED_I, TH_3, CRED_I, ? EAD_3 >>¶
CRED_I is identified by a 'kid' with byte string value 0x2b:¶
CRED_I is an RPK encoded as a CCS:¶
No external authorization data:¶
context_3 = << ID_CRED_I, TH_3, CRED_I, ? EAD_3 >>¶
MAC_3 is computed through EDHOC_Expand() using the EDHOC hash algorithm (see Section 4.1.2 of [RFC9528]):¶
where¶
Since METHOD = 3, mac_length_3 is given by the EDHOC MAC length.¶
info for MAC_3 is:¶
where the last value is the EDHOC MAC length in bytes.¶
Since METHOD = 3, Signature
The Initiator constructs PLAINTEXT_3:¶
Since ID_CRED_I contains a single 'kid' parameter, only the byte string value is included in the plaintext, represented as described in Section 3.3.2 of [RFC9528]. The CBOR map { 4 : h'2b' } is thus replaced, not by the CBOR byte string 0x412b, but by the CBOR int 0x2b, since that is a one-byte encoding of a CBOR integer (-12).¶
The Initiator constructs the associated data for message_3:¶
The Initiator constructs the input needed to derive the key K_3 (see Section 4.1.2 of [RFC9528]) using the EDHOC hash algorithm:¶
where key_length is the key length in bytes for the EDHOC AEAD algorithm, and info for K_3 is:¶
where the last value is the key length in bytes for the EDHOC AEAD algorithm.¶
The Initiator constructs the input needed to derive the nonce IV_3 (see Section 4.1.2 of [RFC9528]) using the EDHOC hash algorithm:¶
where iv_length is the nonce length in bytes for the EDHOC AEAD algorithm, and info for IV_3 is:¶
where the last value is the nonce length in bytes for the EDHOC AEAD algorithm.¶
The Initiator calculates CIPHERTEXT_3 as 'ciphertext' of COSE_Encrypt0 applied using the EDHOC AEAD algorithm with plaintext PLAINTEXT_3, additional data A_3, key K_3, and nonce IV_3.¶
message_3 is the CBOR bstr encoding of CIPHERTEXT_3:¶
The transcript hash TH_4 is calculated using the EDHOC hash algorithm:¶
TH_4 = H( TH_3, PLAINTEXT_3, CRED_I )¶
3.6. message_4
No external authorization data:¶
The Responder constructs PLAINTEXT_4:¶
The Responder constructs the associated data for message_4:¶
The Responder constructs the input needed to derive the EDHOC message_4 key (see Section 4.1.2 of [RFC9528]) using the EDHOC hash algorithm:¶
where key_length is the key length in bytes for the EDHOC AEAD algorithm, and info for K_4 is:¶
where the last value is the key length in bytes for the EDHOC AEAD algorithm.¶
The Responder constructs the input needed to derive the EDHOC message_4 nonce (see Section 4.1.2 of [RFC9528]) using the EDHOC hash algorithm:¶
where iv_length is the nonce length in bytes for the EDHOC AEAD algorithm, and info for IV_4 is:¶
where the last value is the nonce length in bytes for the EDHOC AEAD algorithm.¶
The Responder calculates CIPHERTEXT_4 as 'ciphertext' of COSE_Encrypt0 applied using the EDHOC AEAD algorithm with plaintext PLAINTEXT_4, additional data A_4, key K_4, and nonce IV_4.¶
message_4 is the CBOR bstr encoding of CIPHERTEXT_4:¶
3.7. PRK_out and PRK_exporter
PRK_out is specified in Section 4.1.3 of [RFC9528].¶
where hash_length is the length in bytes of the output of the EDHOC hash algorithm, and info for PRK_out is:¶
where the last value is the length in bytes of the output of the EDHOC hash algorithm.¶
The OSCORE Master Secret and OSCORE Master Salt are derived with the EDHOC_Exporter as specified in Section 4.2.1 of [RFC9528].¶
where PRK_exporter is derived from PRK_out:¶
where hash_length is the length in bytes of the output of the EDHOC hash algorithm, and info for the PRK_exporter is:¶
where the last value is the length in bytes of the output of the EDHOC hash algorithm.¶
3.8. OSCORE Parameters
The derivation of OSCORE parameters is specified in Appendix A.1 of [RFC9528].¶
The AEAD and hash algorithms to use in OSCORE are given by the selected cipher suite:¶
The mapping from EDHOC connection identifiers to OSCORE Sender
C_R is mapped to the Recipient ID of the server, i.e., the Sender ID of the client. The byte string 0x27, which as C_R is encoded as the CBOR integer 0x27, is converted to the server Recipient ID 0x27.¶
C_I is mapped to the Recipient ID of the client, i.e., the Sender ID of the server. The byte string 0x37, which as C_I is encoded as the CBOR integer 0x0e, is converted to the client Recipient ID 0x37.¶
The OSCORE Master Secret is computed through EDHOC_Expand() using the application hash algorithm (see Appendix A.1 of [RFC9528]):¶
where oscore
where the last value is the key length in bytes for the application AEAD algorithm.¶
The OSCORE Master Salt is computed through EDHOC_Expand() using the application hash algorithm (see Section 4.2 of [RFC9528]):¶
where oscore
where the last value is the length in bytes of the OSCORE Master Salt.¶
3.9. Key Update
The key update is defined in Appendix H of [RFC9528].¶
where hash_length is the length in bytes of the output of the EDHOC hash function, and the context for KeyUpdate is:¶
and where info for the key update is:¶
After the key update, the PRK_exporter needs to be derived anew:¶
where info and hash_length are unchanged as in Section 3.7.¶
The OSCORE Master Secret is derived with the updated PRK_exporter:¶
where info and oscore
The OSCORE Master Salt is derived with the updated PRK_exporter:¶
where info and oscore
4. Invalid Traces
This section contains examples of invalid messages, which a compliant implementation will not compose and must or may reject according to [RFC9528], [RFC8949], [RFC9053], and [SP-800-56A]. This is just a small set of examples of different reasons for which a message might be invalid. The same types of invalidities apply to other fields and messages as well. Implementations should make sure to check for similar types of invalidities in all EDHOC fields and messages.¶
4.1. Encoding Errors
4.1.1. Surplus Array Encoding of a Message
message_1 is incorrectly encoded as a CBOR array. The correct encoding is a CBOR sequence according to Section 5.2.1 of [RFC9528].¶
4.1.2. Surplus bstr Encoding of the Connection Identifier
The connection identifier C_I = 0x0e is incorrectly encoded as the CBOR byte string 41 0e. The correct encoding is the integer 0e according to Section 3.3.2 of [RFC9528].¶
4.1.3. Surplus Array Encoding of the Ciphersuite
The element SUITES_I = 2 is incorrectly encoded as the CBOR array 81 02. The correct encoding is the integer 02 according to Section 5.2.2 of [RFC9528].¶
4.1.4. Text String Encoding of the Ephemeral Key
The third element of message_1 (G_X) is incorrectly encoded as a text string. The correct encoding is a byte string according to Section 5.2.1 of [RFC9528].¶
4.1.5. Wrong Number of CBOR Sequence Elements
The CBOR sequence in message_2 has an incorrect number of elements. The correct number of elements in the CBOR sequence is 1 according to Section 5.3.1 of [RFC9528].¶
4.1.6. Surplus Map Encoding of the ID_CRED Field
The element ID_CRED_R in PLAINTEXT_2 is incorrectly encoded as the map a1 04 42 32 10. The correct encoding is 42 32 10 according to Section 3.5.3.2 of [RFC9528].¶
4.1.7. Surplus bstr Encoding of the ID_CRED Field
The element ID_CRED_R in PLAINTEXT_2 is incorrectly encoded as the byte string 41 32. The correct encoding is 32 according to Section 3.5.3.2 of [RFC9528].¶
4.3. Non-deterministic CBOR
4.3.1. Unnecessary Long Encoding
The element METHOD = 3 is incorrectly encoded as a 16-bit integer. The deterministic encoding 03 is correct according to Section 3.1 of [RFC9528] and Section 4.2.1 of [RFC8949], which states that the arguments for integers, lengths in major types 2 through 5, and tags are required to be as short as possible.¶
4.3.2. Indefinite-Length Array Encoding
The element SUITES_I = [6, 2] is incorrectly encoded as an indefinite
5. Security Considerations
This document contains examples of EDHOC [RFC9528]. The security considerations described in [RFC9528] apply. The keys printed in these examples cannot be considered secret and MUST NOT be used.¶
6. IANA Considerations
This document has no IANA actions.¶
7. References
7.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 - [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 - [RFC9528]
-
Selander, G., Preuß Mattsson, J., and F. Palombini, "Ephemeral Diffie-Hellman Over COSE (EDHOC)", RFC 9528, DOI 10
.17487 , , <https:///RFC9528 www >..rfc -editor .org /rfc /rfc9528
7.2. Informative References
- [CborMe]
- Bormann, C., "CBOR playground", <https://cbor.me/>.
- [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 - [RFC8032]
-
Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital Signature Algorithm (EdDSA)", RFC 8032, DOI 10
.17487 , , <https:///RFC8032 www >..rfc -editor .org /info /rfc8032 - [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 - [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 - [RFC9053]
-
Schaad, J., "CBOR Object Signing and Encryption (COSE): Initial Algorithms", RFC 9053, DOI 10
.17487 , , <https:///RFC9053 www >..rfc -editor .org /info /rfc9053 - [SP-800-186]
-
Chen, L., Moody, D., Randall, K., Regenscheid, A., and A. Robinson, "Recommendations for Discrete Logarithm-based Cryptography: Elliptic Curve Domain Parameters", NIST Special Publication 800-186, DOI 10
.6028 , , <https:///NIST .SP .800 -186 doi >..org /10 .6028 /NIST .SP .800 -186 - [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
Acknowledgments
The authors want to thank all people verifying EDHOC test vectors and/or contributing to the interoperabilit