draft-ietf-lake-edhoc-13.txt | draft-ietf-lake-edhoc-14.txt | |||
---|---|---|---|---|
Network Working Group G. Selander | Network Working Group G. Selander | |||
Internet-Draft J. Preuß Mattsson | Internet-Draft J. Preuß Mattsson | |||
Intended status: Standards Track F. Palombini | Intended status: Standards Track F. Palombini | |||
Expires: 20 October 2022 Ericsson | Expires: 19 November 2022 Ericsson | |||
18 April 2022 | 18 May 2022 | |||
Ephemeral Diffie-Hellman Over COSE (EDHOC) | Ephemeral Diffie-Hellman Over COSE (EDHOC) | |||
draft-ietf-lake-edhoc-13 | draft-ietf-lake-edhoc-14 | |||
Abstract | Abstract | |||
This document specifies Ephemeral Diffie-Hellman Over COSE (EDHOC), a | This document specifies Ephemeral Diffie-Hellman Over COSE (EDHOC), a | |||
very compact and lightweight authenticated Diffie-Hellman key | very compact and lightweight authenticated Diffie-Hellman key | |||
exchange with ephemeral keys. EDHOC provides mutual authentication, | exchange with ephemeral keys. EDHOC provides mutual authentication, | |||
forward secrecy, and identity protection. EDHOC is intended for | forward secrecy, and identity protection. EDHOC is intended for | |||
usage in constrained scenarios and a main use case is to establish an | usage in constrained scenarios and a main use case is to establish an | |||
OSCORE security context. By reusing COSE for cryptography, CBOR for | OSCORE security context. By reusing COSE for cryptography, CBOR for | |||
encoding, and CoAP for transport, the additional code size can be | encoding, and CoAP for transport, the additional code size can be | |||
skipping to change at page 1, line 38 ¶ | skipping to change at page 1, line 38 ¶ | |||
Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
This Internet-Draft will expire on 20 October 2022. | This Internet-Draft will expire on 19 November 2022. | |||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2022 IETF Trust and the persons identified as the | Copyright (c) 2022 IETF Trust and the persons identified as the | |||
document authors. All rights reserved. | document authors. All rights reserved. | |||
This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
Provisions Relating to IETF Documents (https://trustee.ietf.org/ | Provisions Relating to IETF Documents (https://trustee.ietf.org/ | |||
license-info) in effect on the date of publication of this document. | license-info) in effect on the date of publication of this document. | |||
Please review these documents carefully, as they describe your rights | Please review these documents carefully, as they describe your rights | |||
and restrictions with respect to this document. Code Components | and restrictions with respect to this document. Code Components | |||
extracted from this document must include Revised BSD License text as | extracted from this document must include Revised BSD License text as | |||
described in Section 4.e of the Trust Legal Provisions and are | described in Section 4.e of the Trust Legal Provisions and are | |||
provided without warranty as described in the Revised BSD License. | provided without warranty as described in the Revised BSD License. | |||
Table of Contents | Table of Contents | |||
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 3 | 1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
1.2. Use of EDHOC . . . . . . . . . . . . . . . . . . . . . . 5 | 1.2. Message Size Examples . . . . . . . . . . . . . . . . . . 5 | |||
1.3. Message Size Examples . . . . . . . . . . . . . . . . . . 5 | 1.3. Document Structure . . . . . . . . . . . . . . . . . . . 6 | |||
1.4. Document Structure . . . . . . . . . . . . . . . . . . . 6 | 1.4. Terminology and Requirements Language . . . . . . . . . . 6 | |||
1.5. Terminology and Requirements Language . . . . . . . . . . 6 | ||||
2. EDHOC Outline . . . . . . . . . . . . . . . . . . . . . . . . 7 | 2. EDHOC Outline . . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
3. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 8 | 3. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 8 | |||
3.1. General . . . . . . . . . . . . . . . . . . . . . . . . . 9 | 3.1. General . . . . . . . . . . . . . . . . . . . . . . . . . 9 | |||
3.2. Method . . . . . . . . . . . . . . . . . . . . . . . . . 10 | 3.2. Method . . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
3.3. Connection Identifiers . . . . . . . . . . . . . . . . . 10 | 3.3. Connection Identifiers . . . . . . . . . . . . . . . . . 10 | |||
3.4. Transport . . . . . . . . . . . . . . . . . . . . . . . . 11 | 3.4. Transport . . . . . . . . . . . . . . . . . . . . . . . . 12 | |||
3.5. Authentication Parameters . . . . . . . . . . . . . . . . 12 | 3.5. Authentication Parameters . . . . . . . . . . . . . . . . 13 | |||
3.6. Cipher Suites . . . . . . . . . . . . . . . . . . . . . . 18 | 3.6. Cipher Suites . . . . . . . . . . . . . . . . . . . . . . 17 | |||
3.7. Ephemeral Public Keys . . . . . . . . . . . . . . . . . . 19 | 3.7. Ephemeral Public Keys . . . . . . . . . . . . . . . . . . 19 | |||
3.8. External Authorization Data (EAD) . . . . . . . . . . . . 20 | 3.8. External Authorization Data (EAD) . . . . . . . . . . . . 19 | |||
3.9. Applicability Statement . . . . . . . . . . . . . . . . . 21 | 3.9. Application Profile . . . . . . . . . . . . . . . . . . . 20 | |||
4. Key Derivation . . . . . . . . . . . . . . . . . . . . . . . 22 | 4. Key Derivation . . . . . . . . . . . . . . . . . . . . . . . 22 | |||
4.1. Extract . . . . . . . . . . . . . . . . . . . . . . . . . 23 | 4.1. Keys for EDHOC Message Processing . . . . . . . . . . . . 22 | |||
4.2. Expand . . . . . . . . . . . . . . . . . . . . . . . . . 24 | 4.2. Keys for EDHOC Applications . . . . . . . . . . . . . . . 25 | |||
4.3. EDHOC-Exporter . . . . . . . . . . . . . . . . . . . . . 25 | 5. Message Formatting and Processing . . . . . . . . . . . . . . 27 | |||
4.4. EDHOC-KeyUpdate . . . . . . . . . . . . . . . . . . . . . 26 | ||||
5. Message Formatting and Processing . . . . . . . . . . . . . . 26 | ||||
5.1. Message Processing Outline . . . . . . . . . . . . . . . 27 | 5.1. Message Processing Outline . . . . . . . . . . . . . . . 27 | |||
5.2. EDHOC Message 1 . . . . . . . . . . . . . . . . . . . . . 28 | 5.2. EDHOC Message 1 . . . . . . . . . . . . . . . . . . . . . 28 | |||
5.3. EDHOC Message 2 . . . . . . . . . . . . . . . . . . . . . 29 | 5.3. EDHOC Message 2 . . . . . . . . . . . . . . . . . . . . . 30 | |||
5.4. EDHOC Message 3 . . . . . . . . . . . . . . . . . . . . . 32 | 5.4. EDHOC Message 3 . . . . . . . . . . . . . . . . . . . . . 32 | |||
5.5. EDHOC Message 4 . . . . . . . . . . . . . . . . . . . . . 35 | 5.5. EDHOC Message 4 . . . . . . . . . . . . . . . . . . . . . 36 | |||
6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 37 | 6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 37 | |||
6.1. Success . . . . . . . . . . . . . . . . . . . . . . . . . 38 | 6.1. Success . . . . . . . . . . . . . . . . . . . . . . . . . 39 | |||
6.2. Unspecified . . . . . . . . . . . . . . . . . . . . . . . 38 | 6.2. Unspecified Error . . . . . . . . . . . . . . . . . . . . 39 | |||
6.3. Wrong Selected Cipher Suite . . . . . . . . . . . . . . . 38 | 6.3. Wrong Selected Cipher Suite . . . . . . . . . . . . . . . 39 | |||
7. Mandatory-to-Implement Compliance Requirements . . . . . . . 41 | 7. Compliance Requirements . . . . . . . . . . . . . . . . . . . 42 | |||
8. Security Considerations . . . . . . . . . . . . . . . . . . . 42 | 8. Security Considerations . . . . . . . . . . . . . . . . . . . 43 | |||
8.1. Security Properties . . . . . . . . . . . . . . . . . . . 42 | 8.1. Security Properties . . . . . . . . . . . . . . . . . . . 43 | |||
8.2. Cryptographic Considerations . . . . . . . . . . . . . . 44 | 8.2. Cryptographic Considerations . . . . . . . . . . . . . . 45 | |||
8.3. Cipher Suites and Cryptographic Algorithms . . . . . . . 45 | 8.3. Cipher Suites and Cryptographic Algorithms . . . . . . . 47 | |||
8.4. Post-Quantum Considerations . . . . . . . . . . . . . . . 46 | 8.4. Post-Quantum Considerations . . . . . . . . . . . . . . . 47 | |||
8.5. Unprotected Data . . . . . . . . . . . . . . . . . . . . 46 | 8.5. Unprotected Data and Privacy . . . . . . . . . . . . . . 48 | |||
8.6. Denial-of-Service . . . . . . . . . . . . . . . . . . . . 47 | 8.6. Updated Internet Threat Model Considerations . . . . . . 48 | |||
8.7. Implementation Considerations . . . . . . . . . . . . . . 47 | 8.7. Denial-of-Service . . . . . . . . . . . . . . . . . . . . 49 | |||
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 49 | 8.8. Implementation Considerations . . . . . . . . . . . . . . 49 | |||
9.1. EDHOC Exporter Label Registry . . . . . . . . . . . . . . 49 | 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 51 | |||
9.2. EDHOC Cipher Suites Registry . . . . . . . . . . . . . . 49 | 9.1. EDHOC Exporter Label Registry . . . . . . . . . . . . . . 52 | |||
9.3. EDHOC Method Type Registry . . . . . . . . . . . . . . . 51 | 9.2. EDHOC Cipher Suites Registry . . . . . . . . . . . . . . 52 | |||
9.4. EDHOC Error Codes Registry . . . . . . . . . . . . . . . 51 | 9.3. EDHOC Method Type Registry . . . . . . . . . . . . . . . 53 | |||
9.5. EDHOC External Authorization Data Registry . . . . . . . 52 | 9.4. EDHOC Error Codes Registry . . . . . . . . . . . . . . . 54 | |||
9.6. COSE Header Parameters Registry . . . . . . . . . . . . . 52 | 9.5. EDHOC External Authorization Data Registry . . . . . . . 54 | |||
9.7. COSE Header Parameters Registry . . . . . . . . . . . . . 52 | 9.6. COSE Header Parameters Registry . . . . . . . . . . . . . 54 | |||
9.8. COSE Key Common Parameters Registry . . . . . . . . . . . 53 | 9.7. The Well-Known URI Registry . . . . . . . . . . . . . . . 54 | |||
9.9. CWT Confirmation Methods Registry . . . . . . . . . . . . 53 | 9.8. Media Types Registry . . . . . . . . . . . . . . . . . . 55 | |||
9.10. The Well-Known URI Registry . . . . . . . . . . . . . . . 53 | 9.9. CoAP Content-Formats Registry . . . . . . . . . . . . . . 57 | |||
9.11. Media Types Registry . . . . . . . . . . . . . . . . . . 54 | 9.10. Resource Type (rt=) Link Target Attribute Values | |||
9.12. CoAP Content-Formats Registry . . . . . . . . . . . . . . 55 | Registry . . . . . . . . . . . . . . . . . . . . . . . . 57 | |||
9.13. Resource Type (rt=) Link Target Attribute Values | 9.11. Expert Review Instructions . . . . . . . . . . . . . . . 57 | |||
Registry . . . . . . . . . . . . . . . . . . . . . . . . 55 | 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 58 | |||
9.14. Expert Review Instructions . . . . . . . . . . . . . . . 55 | 10.1. Normative References . . . . . . . . . . . . . . . . . . 58 | |||
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 56 | 10.2. Informative References . . . . . . . . . . . . . . . . . 61 | |||
10.1. Normative References . . . . . . . . . . . . . . . . . . 56 | Appendix A. Use with OSCORE and Transfer over CoAP . . . . . . . 65 | |||
10.2. Informative References . . . . . . . . . . . . . . . . . 59 | A.1. Deriving the OSCORE Security Context . . . . . . . . . . 65 | |||
Appendix A. Use with OSCORE and Transfer over CoAP . . . . . . . 61 | A.2. Transferring EDHOC over CoAP . . . . . . . . . . . . . . 66 | |||
A.1. Selecting EDHOC Connection Identifier . . . . . . . . . . 62 | Appendix B. Compact Representation . . . . . . . . . . . . . . . 70 | |||
A.2. Deriving the OSCORE Security Context . . . . . . . . . . 62 | Appendix C. Use of CBOR, CDDL and COSE in EDHOC . . . . . . . . 70 | |||
A.3. Transferring EDHOC over CoAP . . . . . . . . . . . . . . 64 | C.1. CBOR and CDDL . . . . . . . . . . . . . . . . . . . . . . 71 | |||
Appendix B. Compact Representation . . . . . . . . . . . . . . . 67 | C.2. CDDL Definitions . . . . . . . . . . . . . . . . . . . . 72 | |||
Appendix C. Use of CBOR, CDDL and COSE in EDHOC . . . . . . . . 67 | C.3. COSE . . . . . . . . . . . . . . . . . . . . . . . . . . 73 | |||
C.1. CBOR and CDDL . . . . . . . . . . . . . . . . . . . . . . 68 | Appendix D. Authentication Related Verifications . . . . . . . . 75 | |||
C.2. CDDL Definitions . . . . . . . . . . . . . . . . . . . . 69 | D.1. Validating the Authentication Credential . . . . . . . . 76 | |||
C.3. COSE . . . . . . . . . . . . . . . . . . . . . . . . . . 70 | D.2. Identities . . . . . . . . . . . . . . . . . . . . . . . 76 | |||
Appendix D. Applicability Template . . . . . . . . . . . . . . . 72 | D.3. Certification Path and Trust Anchors . . . . . . . . . . 77 | |||
Appendix E. EDHOC Message Deduplication . . . . . . . . . . . . 73 | D.4. Revocation Status . . . . . . . . . . . . . . . . . . . . 78 | |||
Appendix F. Transports Not Natively Providing Correlation . . . 74 | D.5. Trust-on-first-use . . . . . . . . . . . . . . . . . . . 78 | |||
Appendix G. Change Log . . . . . . . . . . . . . . . . . . . . . 74 | Appendix E. Use of External Authorization Data . . . . . . . . . 78 | |||
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 79 | Appendix F. Application Profile Example . . . . . . . . . . . . 80 | |||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 80 | Appendix G. EDHOC Message Deduplication . . . . . . . . . . . . 80 | |||
Appendix H. Transports Not Natively Providing Correlation . . . 82 | ||||
Appendix I. Change Log . . . . . . . . . . . . . . . . . . . . . 82 | ||||
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 90 | ||||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 90 | ||||
1. Introduction | 1. Introduction | |||
1.1. Motivation | 1.1. Motivation | |||
Many Internet of Things (IoT) deployments require technologies which | Many Internet of Things (IoT) deployments require technologies which | |||
are highly performant in constrained environments [RFC7228]. IoT | are highly performant in constrained environments [RFC7228]. IoT | |||
devices may be constrained in various ways, including memory, | devices may be constrained in various ways, including memory, | |||
storage, processing capacity, and power. The connectivity for these | storage, processing capacity, and power. The connectivity for these | |||
settings may also exhibit constraints such as unreliable and lossy | settings may also exhibit constraints such as unreliable and lossy | |||
skipping to change at page 4, line 27 ¶ | skipping to change at page 4, line 28 ¶ | |||
Some security solutions for such settings exist already. CBOR Object | Some security solutions for such settings exist already. CBOR Object | |||
Signing and Encryption (COSE, [I-D.ietf-cose-rfc8152bis-struct]) | Signing and Encryption (COSE, [I-D.ietf-cose-rfc8152bis-struct]) | |||
specifies basic application-layer security services efficiently | specifies basic application-layer security services efficiently | |||
encoded in CBOR. Another example is Object Security for Constrained | encoded in CBOR. Another example is Object Security for Constrained | |||
RESTful Environments (OSCORE, [RFC8613]) which is a lightweight | RESTful Environments (OSCORE, [RFC8613]) which is a lightweight | |||
communication security extension to CoAP using CBOR and COSE. In | communication security extension to CoAP using CBOR and COSE. In | |||
order to establish good quality cryptographic keys for security | order to establish good quality cryptographic keys for security | |||
protocols such as COSE and OSCORE, the two endpoints may run an | protocols such as COSE and OSCORE, the two endpoints may run an | |||
authenticated Diffie-Hellman key exchange protocol, from which shared | authenticated Diffie-Hellman key exchange protocol, from which shared | |||
secret key material can be derived. Such a key exchange protocol | secret keying material can be derived. Such a key exchange protocol | |||
should also be lightweight; to prevent bad performance in case of | should also be lightweight; to prevent bad performance in case of | |||
repeated use, e.g., due to device rebooting or frequent rekeying for | repeated use, e.g., due to device rebooting or frequent rekeying for | |||
security reasons; or to avoid latencies in a network formation | security reasons; or to avoid latencies in a network formation | |||
setting with many devices authenticating at the same time. | setting with many devices authenticating at the same time. | |||
This document specifies Ephemeral Diffie-Hellman Over COSE (EDHOC), a | This document specifies Ephemeral Diffie-Hellman Over COSE (EDHOC), a | |||
lightweight authenticated key exchange protocol providing good | lightweight authenticated key exchange protocol providing good | |||
security properties including forward secrecy, identity protection, | security properties including forward secrecy, identity protection, | |||
and cipher suite negotiation. Authentication can be based on raw | and cipher suite negotiation. Authentication can be based on raw | |||
public keys (RPK) or public key certificates and requires the | public keys (RPK) or public key certificates and requires the | |||
application to provide input on how to verify that endpoints are | application to provide input on how to verify that endpoints are | |||
trusted. This specification focuses on referencing instead of | trusted. This specification emphasizes the possibility to reference | |||
transporting credentials to reduce message overhead. EDHOC does | rather than to transport credentials in order to reduce message | |||
currently not support pre-shared key (PSK) authentication as | overhead, but the latter is also supported. EDHOC does not currently | |||
authentication with static Diffie-Hellman public keys by reference | support pre-shared key (PSK) authentication as authentication with | |||
produces equally small message sizes but with much simpler key | static Diffie-Hellman public keys by reference produces equally small | |||
distribution and identity protection. | message sizes but with much simpler key distribution and identity | |||
protection. | ||||
EDHOC makes use of known protocol constructions, such as SIGMA | EDHOC makes use of known protocol constructions, such as SIGMA | |||
[SIGMA] and Extract-and-Expand [RFC5869]. EDHOC uses COSE for | [SIGMA] and Extract-and-Expand [RFC5869]. EDHOC uses COSE for | |||
cryptography and identification of credentials (including COSE_Key, | cryptography and identification of credentials (including COSE_Key, | |||
CWT, CCS, X.509, C509, see Section 3.5.3). COSE provides crypto | CBOR Web Token (CWT), CWT Claims Set (CCS), X.509, and CBOR encoded | |||
agility and enables the use of future algorithms and credentials | X.509 (C509) certificates, see Section 3.5.2). COSE provides crypto | |||
agility and enables the use of future algorithms and credential types | ||||
targeting IoT. | targeting IoT. | |||
1.2. Use of EDHOC | ||||
EDHOC is designed for highly constrained settings making it | EDHOC is designed for highly constrained settings making it | |||
especially suitable for low-power wide area networks [RFC8376] such | especially suitable for low-power wide area networks [RFC8376] such | |||
as Cellular IoT, 6TiSCH, and LoRaWAN. A main objective for EDHOC is | as Cellular IoT, 6TiSCH, and LoRaWAN. A main objective for EDHOC is | |||
to be a lightweight authenticated key exchange for OSCORE, i.e., to | to be a lightweight authenticated key exchange for OSCORE, i.e., to | |||
provide authentication and session key establishment for IoT use | provide authentication and session key establishment for IoT use | |||
cases such as those built on CoAP [RFC7252]. CoAP is a specialized | cases such as those built on CoAP [RFC7252] involving 'things' with | |||
web transfer protocol for use with constrained nodes and networks, | embedded microcontrollers, sensors, and actuators. By reusing the | |||
providing a request/response interaction model between application | same lightweight primitives as OSCORE (CBOR, COSE, CoAP) the | |||
endpoints. As such, EDHOC is targeting a large variety of use cases | additional code size can be kept very low. Note that while CBOR and | |||
involving 'things' with embedded microcontrollers, sensors, and | COSE primitives are built into the protocol messages, EDHOC is not | |||
actuators. | bound to a particular transport. | |||
A typical setting is when one of the endpoints is constrained or in a | 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 | constrained network, and the other endpoint is a node on the Internet | |||
(such as a mobile phone) or at the edge of the constrained network | (such as a mobile phone). Thing-to-thing interactions over | |||
(such as a gateway). Thing-to-thing interactions over constrained | constrained networks are also relevant since both endpoints would | |||
networks are also relevant since both endpoints would then benefit | then benefit from the lightweight properties of the protocol. EDHOC | |||
from the lightweight properties of the protocol. EDHOC could e.g., | could, e.g., be run when a device connects for the first time, or to | |||
be run when a device connects for the first time, or to establish | establish fresh keys which are not revealed by a later compromise of | |||
fresh keys which are not revealed by a later compromise of the long- | the long-term keys. | |||
term keys. Further security properties are described in Section 8.1. | ||||
EDHOC enables the reuse of the same lightweight primitives as OSCORE: | ||||
CBOR for encoding, COSE for cryptography, and CoAP for transport. By | ||||
reusing existing libraries, the additional code size can be kept very | ||||
low. Note that, while CBOR and COSE primitives are built into the | ||||
protocol messages, EDHOC is not bound to a particular transport. | ||||
Transfer of EDHOC messages in CoAP payloads is detailed in | ||||
Appendix A.3. | ||||
1.3. Message Size Examples | 1.2. Message Size Examples | |||
Compared to the DTLS 1.3 handshake [I-D.ietf-tls-dtls13] with ECDHE | Compared to the DTLS 1.3 handshake [RFC9147] with ECDHE and | |||
and connection ID, the number of bytes in EDHOC + CoAP can be less | connection ID, the EDHOC message size when transferred in CoAP can be | |||
than 1/6 when RPK authentication is used, see | less than 1/6 when RPK authentication is used, see | |||
[I-D.ietf-lwig-security-protocol-comparison]. Figure 1 shows | [I-D.ietf-lwig-security-protocol-comparison]. Figure 1 shows | |||
examples of message sizes for EDHOC with different kinds of | examples of EDHOC message sizes based on the assumptions in Section 2 | |||
authentication keys and different COSE header parameters for | of [I-D.ietf-lwig-security-protocol-comparison], comparing different | |||
kinds of authentication keys and COSE header parameters for | ||||
identification: static Diffie-Hellman keys or signature keys, either | identification: static Diffie-Hellman keys or signature keys, either | |||
in CBOR Web Token (CWT) / CWT Claims Set (CCS) [RFC8392] identified | in CBOR Web Token (CWT) / CWT Claims Set (CCS) [RFC8392] identified | |||
by a key identifier using 'kid' [I-D.ietf-cose-rfc8152bis-struct], or | by a key identifier using 'kid' [I-D.ietf-cose-rfc8152bis-struct], or | |||
in X.509 certificates identified by a hash value using 'x5t' | in X.509 certificates identified by a hash value using 'x5t' | |||
[I-D.ietf-cose-x509]. | [I-D.ietf-cose-x509]. | |||
======================================================== | ======================================================== | |||
Static DH Keys Signature Keys | Static DH Keys Signature Keys | |||
-------------- -------------- | -------------- -------------- | |||
kid x5t kid x5t | kid x5t kid x5t | |||
-------------------------------------------------------- | -------------------------------------------------------- | |||
message_1 37 37 37 37 | message_1 37 37 37 37 | |||
message_2 45 58 102 115 | message_2 45 58 102 115 | |||
message_3 19 33 77 90 | message_3 19 33 77 90 | |||
-------------------------------------------------------- | -------------------------------------------------------- | |||
Total 101 128 216 242 | Total 101 128 216 242 | |||
======================================================== | ======================================================== | |||
Figure 1: Example of message sizes in bytes. | Figure 1: Examples of EDHOC message sizes in bytes. | |||
1.4. Document Structure | 1.3. Document Structure | |||
The remainder of the document is organized as follows: Section 2 | The remainder of the document is organized as follows: Section 2 | |||
outlines EDHOC authenticated with digital signatures, Section 3 | outlines EDHOC authenticated with signature keys, Section 3 describes | |||
describes the protocol elements of EDHOC, including formatting of the | the protocol elements of EDHOC, including formatting of the ephemeral | |||
ephemeral public keys, Section 4 specifies the key derivation, | public keys, Section 4 specifies the key derivation, Section 5 | |||
Section 5 specifies message processing for EDHOC authenticated with | specifies message processing for EDHOC authenticated with signature | |||
signature keys or static Diffie-Hellman keys, Section 6 describes the | keys or static Diffie-Hellman keys, Section 6 describes the error | |||
error messages, and Appendix A shows how to transfer EDHOC with CoAP | messages, and Appendix A shows how to transfer EDHOC with CoAP and | |||
and establish an OSCORE security context. | establish an OSCORE security context. | |||
1.5. Terminology and Requirements Language | 1.4. Terminology and Requirements Language | |||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
"OPTIONAL" in this document are to be interpreted as described in BCP | "OPTIONAL" in this document are to be interpreted as described in BCP | |||
14 [RFC2119] [RFC8174] when, and only when, they appear in all | 14 [RFC2119] [RFC8174] when, and only when, they appear in all | |||
capitals, as shown here. | capitals, as shown here. | |||
Readers are expected to be familiar with the terms and concepts | Readers are expected to be familiar with the terms and concepts | |||
described in CBOR [RFC8949], CBOR Sequences [RFC8742], COSE | described in CBOR [RFC8949], CBOR Sequences [RFC8742], COSE | |||
structures and processing [I-D.ietf-cose-rfc8152bis-struct], COSE | structures and processing [I-D.ietf-cose-rfc8152bis-struct], COSE | |||
algorithms [I-D.ietf-cose-rfc8152bis-algs], CWT and CWT Claims Set | algorithms [I-D.ietf-cose-rfc8152bis-algs], CWT and CWT Claims Set | |||
[RFC8392], and CDDL [RFC8610]. The Concise Data Definition Language | [RFC8392], and the Concise Data Definition Language (CDDL, | |||
(CDDL) is used to express CBOR data structures [RFC8949]. Examples | [RFC8610]), which is used to express CBOR data structures. Examples | |||
of CBOR and CDDL are provided in Appendix C.1. When referring to | of CBOR and CDDL are provided in Appendix C.1. When referring to | |||
CBOR, this specification always refers to Deterministically Encoded | CBOR, this specification always refers to Deterministically Encoded | |||
CBOR as specified in Sections 4.2.1 and 4.2.2 of [RFC8949]. The | CBOR as specified in Sections 4.2.1 and 4.2.2 of [RFC8949]. The | |||
single output from authenticated encryption (including the | single output from authenticated encryption (including the | |||
authentication tag) is called "ciphertext", following [RFC5116]. | authentication tag) is called "ciphertext", following [RFC5116]. | |||
2. EDHOC Outline | 2. EDHOC Outline | |||
EDHOC specifies different authentication methods of the Diffie- | EDHOC specifies different authentication methods of the ephemeral | |||
Hellman key exchange: digital signatures and static Diffie-Hellman | Diffie-Hellman key exchange: signature keys and static Diffie-Hellman | |||
keys. This section outlines the digital signature-based method. | keys. This section outlines the signature key based method. Further | |||
Further details of protocol elements and other authentication methods | details of protocol elements and other authentication methods are | |||
are provided in the remainder of this document. | provided in the remainder of this document. | |||
SIGMA (SIGn-and-MAc) is a family of theoretical protocols with a | SIGMA (SIGn-and-MAc) is a family of theoretical protocols with a | |||
large number of variants [SIGMA]. Like IKEv2 [RFC7296] and (D)TLS | large number of variants [SIGMA]. Like IKEv2 [RFC7296] and (D)TLS | |||
1.3 [RFC8446], EDHOC authenticated with digital signatures is built | 1.3 [RFC8446][RFC9147], EDHOC authenticated with signature keys is | |||
on a variant of the SIGMA protocol which provides identity protection | built on a variant of the SIGMA protocol which provides identity | |||
of the initiator (SIGMA-I) against active attackers, and like IKEv2 | protection of the initiator (SIGMA-I) against active attackers, and | |||
[RFC7296], EDHOC implements the MAC-then-Sign variant of the SIGMA-I | like IKEv2, EDHOC implements the MAC-then-Sign variant of the SIGMA-I | |||
protocol shown in Figure 2. | protocol shown in Figure 2. | |||
Initiator Responder | Initiator Responder | |||
| G_X | | | G_X | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| | | | | | |||
| G_Y, Enc( ID_CRED_R, Sig( R; MAC( CRED_R, G_X, G_Y ) ) ) | | | G_Y, Enc( ID_CRED_R, Sig( R; MAC( CRED_R, G_X, G_Y ) ) ) | | |||
|<------------------------------------------------------------------+ | |<------------------------------------------------------------------+ | |||
| | | | | | |||
| AEAD( ID_CRED_I, Sig( I; MAC( CRED_I, G_Y, G_X ) ) ) | | | AEAD( ID_CRED_I, Sig( I; MAC( CRED_I, G_Y, G_X ) ) ) | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| | | | | | |||
Figure 2: MAC-then-Sign variant of the SIGMA-I protocol. | Figure 2: MAC-then-Sign variant of the SIGMA-I protocol used by | |||
EDHOC. | ||||
The parties exchanging messages are called Initiator (I) and | The parties exchanging messages are called Initiator (I) and | |||
Responder (R). They exchange ephemeral public keys, compute a shared | Responder (R). They exchange ephemeral public keys, compute a shared | |||
secret, and derive symmetric application keys used to protect | secret key PRK_out, and derive symmetric application keys used to | |||
application data. | protect application data. | |||
* G_X and G_Y are the ECDH ephemeral public keys of I and R, | * G_X and G_Y are the ECDH ephemeral public keys of I and R, | |||
respectively. | respectively. | |||
* CRED_I and CRED_R are the credentials containing the public | * CRED_I and CRED_R are the authentication credentials containing | |||
authentication keys of I and R, respectively. | the public authentication keys of I and R, respectively. | |||
* ID_CRED_I and ID_CRED_R are credential identifiers enabling the | * ID_CRED_I and ID_CRED_R are used to identify and optionally | |||
recipient party to retrieve the credential of I and R, | transport the credentials of the Initiator and the Responder, | |||
respectively. | respectively. | |||
* Sig(I; . ) and Sig(R; . ) denote signatures made with the private | * Sig(I; . ) and Sig(R; . ) denote signatures made with the private | |||
authentication key of I and R, respectively. | authentication key of I and R, respectively. | |||
* Enc(), AEAD(), and MAC() denotes encryption, authenticated | * Enc(), AEAD(), and MAC() denotes encryption, authenticated | |||
encryption with additional data, and message authentication code | encryption with additional data, and message authentication code | |||
using keys derived from the shared secret. | using keys derived from the shared secret. | |||
In order to create a "full-fledged" protocol some additional protocol | In order to create a "full-fledged" protocol some additional protocol | |||
elements are needed. EDHOC adds: | elements are needed. EDHOC adds: | |||
* Transcript hashes (hashes of message data) TH_2, TH_3, TH_4 used | * Transcript hashes (hashes of message data) TH_2, TH_3, TH_4 used | |||
for key derivation and as additional authenticated data. | for key derivation and as additional authenticated data. | |||
* Computationally independent keys derived from the ECDH shared | * Computationally independent keys derived from the ECDH shared | |||
secret and used for authenticated encryption of different | secret and used for authenticated encryption of different | |||
messages. | messages. | |||
* An optional fourth message giving explicit key confirmation to I | * An optional fourth message giving key confirmation to I in | |||
in deployments where no protected application data is sent from R | deployments where no protected application data is sent from R to | |||
to I. | I. | |||
* A key material exporter and a key update function with forward | * A keying material exporter and a key update function with forward | |||
secrecy. | secrecy. | |||
* Verification of a common preferred cipher suite. | * Verification of the selected cipher suite. | |||
* Method types and error handling. | * Method types and error handling. | |||
* Selection of connection identifiers C_I and C_R which may be used | * Selection of connection identifiers C_I and C_R which may be used | |||
to identify established keys or protocol state. | in EDHOC to identify protocol state. | |||
* Transport of external authorization data. | * Transport of external authorization data. | |||
EDHOC is designed to encrypt and integrity protect as much | EDHOC is designed to encrypt and integrity protect as much | |||
information as possible, and all symmetric keys are derived using as | information as possible, and all symmetric keys are derived using as | |||
much previous information as possible. EDHOC is furthermore designed | much previous information as possible. EDHOC is furthermore designed | |||
to be as compact and lightweight as possible, in terms of message | to be as compact and lightweight as possible, in terms of message | |||
sizes, processing, and the ability to reuse already existing CBOR, | sizes, processing, and the ability to reuse already existing CBOR, | |||
COSE, and CoAP libraries. | COSE, and CoAP libraries. | |||
To simplify for implementors, the use of CBOR and COSE in EDHOC is | To simplify for implementors, the use of CBOR and COSE in EDHOC is | |||
summarized in Appendix C. Test vectors including CBOR diagnostic | summarized in Appendix C. Test vectors including CBOR diagnostic | |||
notation are provided in [I-D.selander-lake-traces]. | notation are provided in [I-D.ietf-lake-traces]. | |||
3. Protocol Elements | 3. Protocol Elements | |||
3.1. General | 3.1. General | |||
The EDHOC protocol consists of three mandatory messages (message_1, | The EDHOC protocol consists of three mandatory messages (message_1, | |||
message_2, message_3) between Initiator and Responder, an optional | message_2, message_3) between Initiator and Responder, an optional | |||
fourth message (message_4), and an error message. All EDHOC messages | fourth message (message_4), and an error message. All EDHOC messages | |||
are CBOR Sequences [RFC8742]. Figure 3 illustrates an EDHOC message | are CBOR Sequences [RFC8742], and are deterministically encoded. | |||
flow with the optional fourth message as well as the content of each | Figure 3 illustrates an EDHOC message flow with the optional fourth | |||
message. The protocol elements in the figure are introduced in | message as well as the content of each message. The protocol | |||
Section 3 and Section 5. Message formatting and processing is | elements in the figure are introduced in Section 3 and Section 5. | |||
specified in Section 5 and Section 6. | Message formatting and processing are specified in Section 5 and | |||
Section 6. | ||||
Application data may be protected using the agreed application | Application data may be protected using the agreed application | |||
algorithms (AEAD, hash) in the selected cipher suite (see | algorithms (AEAD, hash) in the selected cipher suite (see | |||
Section 3.6) and the application can make use of the established | Section 3.6) and the application can make use of the established | |||
connection identifiers C_I and C_R (see Section 3.3). EDHOC may be | connection identifiers C_I and C_R (see Section 3.3). EDHOC may be | |||
used with the media type application/edhoc defined in Section 9. | used with the media type application/edhoc+cbor-seq defined in | |||
Section 9.8. | ||||
The Initiator can derive symmetric application keys after creating | The Initiator can derive symmetric application keys after creating | |||
EDHOC message_3, see Section 4.3. Protected application data can | EDHOC message_3, see Section 4.2.1. Protected application data can | |||
therefore be sent in parallel or together with EDHOC message_3. | therefore be sent in parallel or together with EDHOC message_3. | |||
EDHOC message_4 is typically not sent. | EDHOC message_4 is typically not sent. | |||
Initiator Responder | Initiator Responder | |||
| METHOD, SUITES_I, G_X, C_I, EAD_1 | | | METHOD, SUITES_I, G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
| | | | | | |||
| G_Y, Enc( ID_CRED_R, Signature_or_MAC_2, EAD_2 ), C_R | | | G_Y, Enc( ID_CRED_R, Signature_or_MAC_2, EAD_2 ), C_R | | |||
|<------------------------------------------------------------------+ | |<------------------------------------------------------------------+ | |||
| message_2 | | | message_2 | | |||
| | | | | | |||
| AEAD( ID_CRED_I, Signature_or_MAC_3, EAD_3 ) | | | AEAD( ID_CRED_I, Signature_or_MAC_3, EAD_3 ) | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_3 | | | message_3 | | |||
| | | | | | |||
| AEAD( EAD_4 ) | | | AEAD( EAD_4 ) | | |||
|<- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | |<- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | |||
| message_4 | | | message_4 | | |||
Figure 3: EDHOC Message Flow with the Optional Fourth Message | Figure 3: EDHOC message flow including the optional fourth message. | |||
3.2. Method | 3.2. Method | |||
The data item METHOD in message_1 (see Section 5.2.1), is an integer | The data item METHOD in message_1 (see Section 5.2.1), is an integer | |||
specifying the authentication method. EDHOC supports authentication | specifying the authentication method. EDHOC supports authentication | |||
with signature or static Diffie-Hellman keys, as defined in the four | with signature or static Diffie-Hellman keys, as defined in the four | |||
authentication methods: 0, 1, 2, and 3, see Figure 4. When using a | authentication methods: 0, 1, 2, and 3, see Figure 4. When using a | |||
static Diffie-Hellman key the authentication is provided by a Message | static Diffie-Hellman key the authentication is provided by a Message | |||
Authentication Code (MAC) computed from an ephemeral-static ECDH | Authentication Code (MAC) computed from an ephemeral-static ECDH | |||
shared secret which enables significant reductions in message sizes. | shared secret which enables significant reductions in message sizes. | |||
The Initiator and the Responder need to have agreed on a single | The Initiator and the Responder need to have agreed on a single | |||
method to be used for EDHOC, see Section 3.9. | method to be used for EDHOC, see Section 3.9. | |||
+-------+-------------------+-------------------+-------------------+ | +-------------+--------------------+--------------------+ | |||
| Value | Initiator | Responder | Reference | | | Method Type | Initiator | Responder | | |||
+-------+-------------------+-------------------+-------------------+ | | Value | Authentication Key | Authentication Key | | |||
| 0 | Signature Key | Signature Key | [[this document]] | | +-------------+--------------------+--------------------+ | |||
| 1 | Signature Key | Static DH Key | [[this document]] | | | 0 | Signature Key | Signature Key | | |||
| 2 | Static DH Key | Signature Key | [[this document]] | | | 1 | Signature Key | Static DH Key | | |||
| 3 | Static DH Key | Static DH Key | [[this document]] | | | 2 | Static DH Key | Signature Key | | |||
+-------+-------------------+-------------------+-------------------+ | | 3 | Static DH Key | Static DH Key | | |||
+-------------+--------------------+--------------------+ | ||||
Figure 4: Method Types | Figure 4: Authentication Keys for Method Types | |||
EDHOC does not have a dedicated message field to indicate protocol | ||||
version. Breaking changes to EDHOC can be introduced by specifying | ||||
and registering new methods. | ||||
3.3. Connection Identifiers | 3.3. Connection Identifiers | |||
EDHOC includes the selection of connection identifiers (C_I, C_R) | EDHOC includes the selection of connection identifiers (C_I, C_R) | |||
identifying a connection for which keys are agreed. | identifying a connection for which keys are agreed. | |||
Connection identifiers may be used to correlate EDHOC messages and | Connection identifiers may be used to correlate EDHOC messages and | |||
facilitate the retrieval of protocol state during EDHOC protocol | facilitate the retrieval of protocol state during EDHOC execution | |||
execution (see Section 3.4) or in a subsequent application protocol, | (see Section 3.4) or in subsequent applications of EDHOC, e.g., in | |||
e.g., OSCORE (see Section 3.3.2). The connection identifiers do not | OSCORE (see Section 3.3.3). The connection identifiers do not have | |||
have any cryptographic purpose in EDHOC. | any cryptographic purpose in EDHOC except facilitating the retrieval | |||
of security data associated to the protocol state. | ||||
Connection identifiers in EDHOC are byte strings or integers, encoded | Connection identifiers in EDHOC are CBOR byte strings. Since most | |||
in CBOR. One byte connection identifiers (the integers -24 to 23 and | constrained devices only have a few connections, short identifiers | |||
the empty CBOR byte string h'') are realistic in many scenarios as | are desirable in many cases. However, except for the empty byte | |||
most constrained devices only have a few connections. | string h'', which encodes as one byte (0x40), all byte strings are | |||
CBOR encoded as two or more bytes. Therefore EDHOC specifies certain | ||||
byte strings to be represented as CBOR ints on the wire, see | ||||
Section 3.3.2. | ||||
3.3.1. Selection of Connection Identifiers | 3.3.1. Selection of Connection Identifiers | |||
C_I and C_R are chosen by I and R, respectively. The Initiator | C_I and C_R are chosen by I and R, respectively. The Initiator | |||
selects C_I and sends it in message_1 for the Responder to use as a | selects C_I and sends it in message_1 for the Responder to use as a | |||
reference to the connection in communications with the Initiator. | reference to the connection in communications with the Initiator. | |||
The Responder selects C_R and sends in message_2 for the Initiator to | The Responder selects C_R and sends it in message_2 for the Initiator | |||
use as a reference to the connection in communications with the | to use as a reference to the connection in communications with the | |||
Responder. | Responder. | |||
If connection identifiers are used by an application protocol for | If connection identifiers are used by an application protocol for | |||
which EDHOC establishes keys then the selected connection identifiers | which EDHOC establishes keys then the selected connection identifiers | |||
SHALL adhere to the requirements for that protocol, see Section 3.3.2 | SHALL adhere to the requirements for that protocol, see Section 3.3.3 | |||
for an example. | for an example. | |||
3.3.2. Use of Connection Identifiers with OSCORE | 3.3.2. Representation of Byte String Identifiers | |||
For OSCORE, the choice of a connection identifier results in the | To allow identifiers with minimal overhead on the wire, certain byte | |||
strings are defined to have integer representations. | ||||
The integers with one-byte CBOR encoding are -24, ..., 23, see | ||||
Figure 5. This correspondence between integers and byte strings is a | ||||
natural mapping between the byte strings with CBOR diagnostic | ||||
notation h'00', h'01', ..., h'37' (except h'18', h'19', ..., h'1F') | ||||
and integers which are CBOR encoded as one byte. | ||||
Integer: -24 -23 ... -2 -1 0 1 ... 23 | ||||
CBOR encoding (1 byte): 37 36 ... 21 20 00 01 ... 17 | ||||
Figure 5: One-Byte CBOR Encoded Integers | ||||
The byte strings which coincide with a one-byte CBOR encoding of an | ||||
integer MUST be represented by the CBOR encoding of that integer. | ||||
Other byte strings are encoded as normal CBOR byte strings. | ||||
For example: | ||||
* h'21' is represented by 0x21 (CBOR encoding of the integer -2), | ||||
not by 0x4121. | ||||
* h'0D' is represented by 0x0D (CBOR encoding of the integer 13), | ||||
not by 0x410D. | ||||
* h'18' is represented by 0x4118. | ||||
* h'38' is represented by 0x4138. | ||||
* h'ABCD' is represented by 0x42ABCD. | ||||
One way to view this representation of byte strings is as a transport | ||||
encoding: A byte string which parses as a CBOR int in the range -24, | ||||
..., 23 is just copied directly into the message, a byte string which | ||||
doesn't is encoded as a CBOR bstr 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], | endpoint selecting its Recipient ID, see Section 3.1 of [RFC8613], | |||
for which certain uniqueness requirements apply, see Section 3.3 of | for which certain uniqueness requirements apply, see Section 3.3 of | |||
[RFC8613]. Therefore, the Initiator and the Responder MUST NOT | [RFC8613]. Therefore, the Initiator and the Responder MUST NOT | |||
select connection identifiers such that it results in same OSCORE | select connection identifiers such that it results in same OSCORE | |||
Recipient ID. Since the Recipient ID is a byte string and a EDHOC | Recipient ID. Since the connection identifier is a byte string, it | |||
connection identifier is either a CBOR byte string or a CBOR integer, | is converted to an OSCORE Recipient ID equal to the byte string. | |||
care must be taken when selecting the connection identifiers and | ||||
converting them to Recipient IDs. A mapping from EDHOC connection | For example, a C_I equal to 0xFF is converted to a (typically client) | |||
identifier to OSCORE Recipient ID is specified in Appendix A.1. | Responder ID equal to 0xFF; a C_R equal to 0x21 is converted to a | |||
(typically server) Responder ID equal to 0x21. Note that the | ||||
representation of connection identifiers as CBOR byte strings or CBOR | ||||
ints in EDHOC messages as described in Section 3.3.2 has no impact on | ||||
this mapping. | ||||
3.4. Transport | 3.4. Transport | |||
Cryptographically, EDHOC does not put requirements on the lower | Cryptographically, EDHOC does not put requirements on the lower | |||
layers. EDHOC is not bound to a particular transport layer and can | layers. EDHOC is not bound to a particular transport layer and can | |||
even be used in environments without IP. The transport is | even be used in environments without IP. In addition to transport of | |||
responsible, where necessary, to handle: | messages including errors, the transport is responsible, where | |||
necessary, to handle: | ||||
* message loss, | * message loss, | |||
* message reordering, | * message reordering, | |||
* message duplication, | * message duplication, | |||
* fragmentation, | * fragmentation, | |||
* demultiplex EDHOC messages from other types of messages, | * demultiplex EDHOC messages from other types of messages, | |||
skipping to change at page 12, line 8 ¶ | skipping to change at page 13, line 8 ¶ | |||
* denial-of-service protection, | * denial-of-service protection, | |||
* message correlation. | * message correlation. | |||
The Initiator and the Responder need to have agreed on a transport to | The Initiator and the Responder need to have agreed on a transport to | |||
be used for EDHOC, see Section 3.9. | be used for EDHOC, see Section 3.9. | |||
3.4.1. Use of Connection Identifiers for EDHOC Message Correlation | 3.4.1. Use of Connection Identifiers for EDHOC Message Correlation | |||
The transport needs to support the correlation between EDHOC messages | The transport needs to support the correlation between EDHOC messages | |||
and facilitate the retrieval of protocol state during EDHOC protocol | and facilitate the retrieval of protocol state and security context | |||
execution, including an indication of a message being message_1. The | during EDHOC protocol execution, including an indication of a message | |||
correlation may reuse existing mechanisms in the transport protocol. | being message_1. The correlation may reuse existing mechanisms in | |||
For example, the CoAP Token may be used to correlate EDHOC messages | the transport protocol. For example, the CoAP Token may be used to | |||
in a CoAP response and an associated CoAP request. | correlate EDHOC messages in a CoAP response and an associated CoAP | |||
request. | ||||
Connection identifiers may be used to correlate EDHOC messages and | Connection identifiers may be used to correlate EDHOC messages and | |||
facilitate the retrieval of protocol state during EDHOC protocol | facilitate the retrieval of protocol state/security context during | |||
execution. EDHOC transports that do not inherently provide | EDHOC protocol execution. Transports that do not inherently provide | |||
correlation across all messages of an exchange can send connection | correlation across all EDHOC messages of an exchange can send | |||
identifiers along with EDHOC messages to gain that required | connection identifiers along with EDHOC messages to gain that | |||
capability, e.g., by prepending the appropriate connection identifier | required capability, e.g., by prepending the appropriate connection | |||
(when available from the EDHOC protocol) to the EDHOC message. | identifier (when available from the EDHOC protocol) to the EDHOC | |||
Transport of EDHOC in CoAP payloads is described in Appendix A.3, | message. Transport of EDHOC in CoAP payloads is described in | |||
which also shows how to use connection identifiers and message_1 | Appendix A.2, which also shows how to use connection identifiers and | |||
indication with CoAP. | message_1 indication with CoAP. | |||
3.5. Authentication Parameters | 3.5. Authentication Parameters | |||
EDHOC supports various settings for how the other endpoint's | EDHOC supports various settings for how the other endpoint's | |||
authentication (public) key is transported, identified, and trusted | authentication (public) key may be transported, identified, and | |||
as described in this section. | trusted. | |||
The authentication key (see Section 3.5.2) is used in several parts | ||||
of EDHOC: | ||||
1. as part of the authentication credential included in the | ||||
integrity calculation | ||||
2. for verification of the Signature_or_MAC field in message_2 and | ||||
message_3 (see Section 5.3.2 and Section 5.4.2) | ||||
3. in the key derivation (in case of a static Diffie-Hellman key, | ||||
see Section 4). | ||||
The authentication credential (CRED_x) contains, in addition to the | ||||
authentication key, also the authentication key algorithm and | ||||
optionally other parameters such as identity, key usage, expiry, | ||||
issuer, etc. (see Section 3.5.3). Identical authentication | ||||
credentials need to be established in both endpoints to be able to | ||||
verify integrity. For many settings it is not necessary to transport | ||||
the authentication credential within EDHOC over constrained links, | ||||
for example, it may be pre-provisioned or acquired out-of-band over | ||||
less constrained links. | ||||
EDHOC relies on COSE for identification of authentication credentials | ||||
(using ID_CRED_x, see Section 3.5.4) and supports all credential | ||||
types for which COSE header parameters are defined (see | ||||
Section 3.5.3). | ||||
The choice of authentication credential depends also on the trust | ||||
model (see Section 3.5.1). For example, a certificate or CWT may | ||||
rely on a trusted third party, whereas a CCS or a self-signed | ||||
certificate/CWT may be used when trust in the public key can be | ||||
achieved by other means, or in the case of trust-on-first-use. | ||||
The type of authentication key, authentication credential, and the | ||||
way to identify the credential have a large impact on the message | ||||
size. For example, the signature_or_MAC field is much smaller with a | ||||
static DH key than with a signature key. A CCS is much smaller than | ||||
a self-signed certificate/CWT, but if it is possible to reference the | ||||
credential with a COSE header like 'kid', then that is typically much | ||||
smaller than to transport a CCS. | ||||
3.5.1. Identities and trust anchors | EDHOC performs the following authentication related operations: | |||
Policies for what connections to allow are typically set based on the | * EDHOC transports information about credentials in ID_CRED_I and | |||
identity of the other party, and parties typically only allow | ID_CRED_R (described in Section 3.5.3). Based on this | |||
connections from a specific identity or a small restricted set of | information, the authentication credentials CRED_I and CRED_R | |||
identities. For example, in the case of a device connecting to a | (described in Section 3.5.2) can be obtained. EDHOC may also | |||
network, the network may only allow connections from devices which | transport certain authentication related information as External | |||
authenticate with certificates having a particular range of serial | Authorization Data (see Section 3.8). | |||
numbers and signed by a particular CA. On the other hand, the device | ||||
may only be allowed to connect to a network which authenticates with | ||||
a particular public key (information of which may be provisioned, | ||||
e.g., out of band or in the external authorization data, see | ||||
Section 3.8). The EDHOC implementation or the application must | ||||
enforce information about the intended endpoint, and in particular | ||||
whether it is a specific identity or a set of identities. Either | ||||
EDHOC passes information about identity to the application for a | ||||
decision, or EDHOC needs to have access to relevant information and | ||||
makes the decision on its own. | ||||
EDHOC assumes the existence of mechanisms (certification authority, | * EDHOC uses the authentication credentials in two ways (see | |||
trusted third party, pre-provisioning, etc.) for specifying and | Section 5.3.2 and Section 5.4.2): | |||
distributing authentication credentials. | ||||
* When a Public Key Infrastructure (PKI) is used with certificates, | - The authentication credential is input to the integrity | |||
the trust anchor is a Certification Authority (CA) certificate, | verification using the MAC fields. | |||
and the identity is the subject whose unique name (e.g., a domain | ||||
name, NAI, or EUI) is included in the endpoint's certificate. In | ||||
order to run EDHOC each party needs at least one CA public key | ||||
certificate, or just the public key, and a specific identity or | ||||
set of identities it is allowed to communicate with. Only | ||||
validated public-key certificates with an allowed subject name, as | ||||
specified by the application, are to be accepted. EDHOC provides | ||||
proof that the other party possesses the private authentication | ||||
key corresponding to the public authentication key in its | ||||
certificate. The certification path provides proof that the | ||||
subject of the certificate owns the public key in the certificate. | ||||
* Similarly, when a PKI is used with CWTs, each party needs to have | - The authentication key of the authentication credential is used | |||
a trusted third party public key as trust anchor to verify the | with the Signature_or_MAC field to verify proof-of-possession | |||
end-entity CWTs, and a specific identity or set of identities in | of the private key. | |||
the 'sub' (subject) claim of the CWT to determine if it is allowed | ||||
to communicate with. The trusted third party public key can, | ||||
e.g., be stored in a self-signed CWT or in a CCS. | ||||
* When PKI is not used (CCS, self-signed certificate/CWT), the trust | Other authentication related verifications are out of scope for | |||
anchor is the authentication key of the other party. In this | EDHOC, and is the responsibility of the application. In particular, | |||
case, the identity is typically directly associated to the | the authentication credential needs to be validated in the context of | |||
authentication key of the other party. For example, the name of | the connection for which EDHOC is used, see Appendix D. EDHOC MUST | |||
the subject may be a canonical representation of the public key. | allow the application to read received information about credential | |||
Alternatively, if identities can be expressed in the form of | (ID_CRED_R, ID_CRED_I). EDHOC MUST have access to the authentication | |||
unique subject names assigned to public keys, then a binding to | key and the authentication credential. | |||
identity can be achieved by including both public key and | ||||
associated subject name in the protocol message computation: | ||||
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.3. In order to run EDHOC, each endpoint needs a | ||||
specific authentication key/unique associated subject name, or a | ||||
set of public authentication keys/unique associated subject names, | ||||
which it is allowed to communicate with. EDHOC provides the proof | ||||
that the other party possesses the private authentication key | ||||
corresponding to the public authentication key. | ||||
To prevent misbinding attacks in systems where an attacker can | Note that the type of authentication key, authentication credential, | |||
register public keys without proving knowledge of the private key, | and the identification of the credential have a large impact on the | |||
SIGMA [SIGMA] enforces a MAC to be calculated over the "identity". | message size. For example, the signature_or_MAC field is much | |||
EDHOC follows SIGMA by calculating a MAC over the whole credential, | smaller with a static DH key than with a signature key. A CCS is | |||
which in case of an X.509 or C509 certificate includes the "subject" | much smaller than a self-signed certificate/CWT, but if it is | |||
and "subjectAltName" fields, and in the case of CWT or CCS includes | possible to reference the credential with a COSE header like 'kid', | |||
the "sub" claim. While the SIGMA paper only focuses on the identity, | then that is in turn much smaller than a CCS. | |||
the same principle is true for other information such as policies | ||||
associated to the public key. | ||||
3.5.2. Authentication Keys | 3.5.1. Authentication Keys | |||
The authentication key (i.e. the public key used for authentication) | The authentication key (i.e. the public key used for authentication) | |||
MUST be a signature key or static Diffie-Hellman key. The Initiator | MUST be a signature key or static Diffie-Hellman key. The Initiator | |||
and the Responder MAY use different types of authentication keys, | and the Responder MAY use different types of authentication keys, | |||
e.g., one uses a signature key and the other uses a static Diffie- | e.g., one uses a signature key and the other uses a static Diffie- | |||
Hellman key. The authentication key algorithm needs to be compatible | Hellman key. | |||
with the method and the cipher suite. The authentication key | ||||
algorithm needs to be compatible with the EDHOC key exchange | The authentication key algorithm needs to be compatible with the | |||
method and the 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 | algorithm when static Diffie-Hellman authentication is used, and | |||
compatible with the EDHOC signature algorithm when signature | compatible with the EDHOC signature algorithm when signature | |||
authentication is used. | authentication is used. | |||
Note that for most signature algorithms, the signature is determined | Note that for most signature algorithms, the signature is determined | |||
by the signature algorithm and the authentication key algorithm | by the signature algorithm and the authentication key algorithm | |||
together. When using static Diffie-Hellman keys the Initiator's and | together. When using static Diffie-Hellman keys the Initiator's and | |||
Responder's private authentication keys are called I and R, | Responder's private authentication keys are denoted I and R, | |||
respectively, and the public authentication keys are called G_I and | respectively, and the public authentication keys are denoted G_I and | |||
G_R, respectively. | G_R, respectively. | |||
For X.509 the authentication key is represented with a | For X.509 certificates the authentication key is represented with a | |||
SubjectPublicKeyInfo field. For CWT and CCS, the authentication key | SubjectPublicKeyInfo field. For CWT and CCS (see Section 3.5.2)) the | |||
is represented with a 'cnf' claim [RFC8747] containing a COSE_Key | authentication key is represented with a 'cnf' claim [RFC8747] | |||
[I-D.ietf-cose-rfc8152bis-struct]. | containing a COSE_Key [I-D.ietf-cose-rfc8152bis-struct]. | |||
3.5.3. Authentication Credentials | 3.5.2. Authentication Credentials | |||
The authentication credentials, CRED_I and CRED_R, contain the public | The authentication credentials, CRED_I and CRED_R, contain the public | |||
authentication key of the Initiator and the Responder, respectively. | authentication key of the Initiator and the Responder, respectively. | |||
EDHOC relies on COSE for identification of authentication credentials | EDHOC relies on COSE for identification of credentials (see | |||
(see Section 3.5.4) and supports all credential types for which COSE | Section 3.5.3), for example X.509 certificates [RFC5280], C509 | |||
header parameters are defined including X.509 [RFC5280], C509 | certificates [I-D.ietf-cose-cbor-encoded-cert], CWTs [RFC8392] and | |||
[I-D.ietf-cose-cbor-encoded-cert], CWT [RFC8392] and CWT Claims Set | CWT Claims Sets (CCS) [RFC8392]. When the identified credential is a | |||
(CCS) [RFC8392]. When the identified credential is a chain or bag, | chain or a bag, the authentication credential CRED_x is just the end | |||
CRED_x is just the end-entity X.509 or C509 certificate / CWT. In | entity X.509 or C509 certificate / CWT. | |||
X.509 and C509 certificates, signature keys typically have key usage | ||||
"digitalSignature" and Diffie-Hellman public keys typically have key | ||||
usage "keyAgreement". | ||||
CRED_x needs to be defined such that it is identical when used by | Since CRED_R is used in the integrity verification, see | |||
Initiator or Responder. The Initiator and Responder are expected to | Section 5.3.2, it needs to be specified such that it is identical | |||
agree on a specific encoding of the credential, see Section 3.9. It | when used by Initiator or Responder. Similarly for CRED_I, see | |||
is RECOMMENDED that the COSE 'kid' parameter, when used, refers to a | Section 5.4.2. The Initiator and Responder are expected to agree on | |||
specific encoding. The Initiator and Responder SHOULD use an | a specific encoding of the credential, see Section 3.9. | |||
available authentication credential (transported in EDHOC or | ||||
otherwise provisioned) without re-encoding. If for some reason re- | It is RECOMMENDED that the COSE 'kid' parameter, when used to | |||
encoding of the authentication credential may occur, then a potential | identify the authentication credential, refers to a specific | |||
common encoding for CBOR based credentials is bytewise lexicographic | encoding. The Initiator and Responder SHOULD use an available | |||
order of their deterministic encodings as specified in Section 4.2.1 | authentication credential (transported in EDHOC or otherwise | |||
of [RFC8949]. | provisioned) without re-encoding. If for some reason re-encoding of | |||
the authentication credential may occur, then a potential common | ||||
encoding for CBOR based credentials is bytewise lexicographic order | ||||
of their deterministic encodings as specified in Section 4.2.1 of | ||||
[RFC8949]. | ||||
* When the authentication credential is an X.509 certificate, CRED_x | * When the authentication credential is an X.509 certificate, CRED_x | |||
SHALL be the end-entity DER encoded certificate, encoded as a bstr | SHALL be the DER encoded certificate, encoded as a bstr | |||
[I-D.ietf-cose-x509]. | [I-D.ietf-cose-x509]. | |||
* When the authentication credential is a C509 certificate, CRED_x | * When the authentication credential is a C509 certificate, CRED_x | |||
SHALL be the end-entity C509Certificate | SHALL be the C509Certificate [I-D.ietf-cose-cbor-encoded-cert]. | |||
[I-D.ietf-cose-cbor-encoded-cert] | ||||
* When the authentication credential is a COSE_Key in a CWT, CRED_x | * When the authentication credential is a COSE_Key in a CWT, CRED_x | |||
SHALL be the untagged CWT. | SHALL be the untagged CWT. | |||
* When the authentication credential is a COSE_Key but not in a CWT, | * When the authentication credential is a COSE_Key but not in a CWT, | |||
CRED_x SHALL be an untagged CCS. | CRED_x SHALL be an untagged CCS. | |||
- Naked COSE_Keys are thus dressed as CCS when used in EDHOC, | - Naked COSE_Keys are thus dressed as CCS when used in EDHOC, | |||
which is done by prefixing the COSE_Key with 0xA108A101. | which is done by prefixing the COSE_Key with 0xA108A101. | |||
An example of a CRED_x is shown below: | An example of a CRED_x is shown below: | |||
{ /CCS/ | { /CCS/ | |||
2 : "42-50-31-FF-EF-37-32-39", /sub/ | 2 : "42-50-31-FF-EF-37-32-39", /sub/ | |||
8 : { /cnf/ | 8 : { /cnf/ | |||
1 : { /COSE_Key/ | 1 : { /COSE_Key/ | |||
1 : 1, /kty/ | 1 : 1, /kty/ | |||
2 : 0, /kid/ | 2 : h'00', /kid/ | |||
-1 : 4, /crv/ | -1 : 4, /crv/ | |||
-2 : h'b1a3e89460e88d3a8d54211dc95f0b90 /x/ | -2 : h'b1a3e89460e88d3a8d54211dc95f0b90 /x/ | |||
3ff205eb71912d6db8f4af980d2db83a' | 3ff205eb71912d6db8f4af980d2db83a' | |||
} | } | |||
} | } | |||
} | } | |||
Figure 5: A CCS Containing an X25519 Static Diffie-Hellman Key | Figure 6: CWT Claims Set (CCS) containing an X25519 static | |||
and an EUI-64 Identity. | Diffie-Hellman key and an EUI-64 identity. | |||
3.5.4. Identification of Credentials | 3.5.3. Identification of Credentials | |||
ID_CRED_R and ID_CRED_I are transported in message_2 and message_3, | ID_CRED_R and ID_CRED_I are transported in message_2 and message_3, | |||
respectively (see Section 5.3.2 and Section 5.4.2). They are used to | respectively, see Section 5.3.2 and Section 5.4.2. They are used to | |||
identify and optionally transport the authentication keys of the | identify and optionally transport credentials: | |||
Initiator and the Responder, respectively. ID_CRED_I and ID_CRED_R | ||||
do not have any cryptographic purpose in EDHOC since EDHOC integrity | ||||
protects the authentication credential. EDHOC relies on COSE for | ||||
identification of authentication credentials and supports all types | ||||
of COSE header parameters used to identify authentication credentials | ||||
including X.509, C509, CWT and CCS. | ||||
* ID_CRED_R is intended to facilitate for the Initiator to retrieve | * ID_CRED_R is intended to facilitate for the Initiator to retrieve | |||
the Responder's authentication key. | the authentication credential CRED_R and the authentication key of | |||
R. | ||||
* ID_CRED_I is intended to facilitate for the Responder to retrieve | * ID_CRED_I is intended to facilitate for the Responder to retrieve | |||
the Initiator's authentication key. | the authentication credential CRED_I and the authentication key of | |||
I. | ||||
ID_CRED_x may contain the authentication credential CRED_x, but for | ||||
many settings it is not necessary to transport the authentication | ||||
credential within EDHOC, for example, it may be pre-provisioned or | ||||
acquired out-of-band over less constrained links. ID_CRED_I and | ||||
ID_CRED_R do not have any cryptographic purpose in EDHOC since the | ||||
authentication credentials are integrity protected. | ||||
EDHOC relies on COSE for identification of credentials and supports | ||||
all credential types for which COSE header parameters are defined | ||||
including X.509 certificates ([I-D.ietf-cose-x509]), C509 | ||||
certificates ([I-D.ietf-cose-cbor-encoded-cert]), CWT (Section 9.6) | ||||
and CWT Claims Set (CCS) (Section 9.6). | ||||
ID_CRED_I and ID_CRED_R are COSE header maps and contains one or more | ID_CRED_I and ID_CRED_R are COSE header maps and contains one or more | |||
COSE header parameter. ID_CRED_I and ID_CRED_R MAY contain different | COSE header parameters. ID_CRED_I and ID_CRED_R MAY contain | |||
header parameters. The header parameters typically provide some | different header parameters. The header parameters typically provide | |||
information about the format of authentication credential. | some information about the format of the credential. | |||
Note that COSE header parameters in ID_CRED_x are used to identify | Note that COSE header parameters in ID_CRED_x are used to identify | |||
the sender's authentication credential. There is therefore no reason | the sender's credential. There is therefore no reason to use the | |||
to use the "-sender" header parameters, such as x5t-sender, defined | "-sender" header parameters, such as x5t-sender, defined in Section 3 | |||
in Section 3 of [I-D.ietf-cose-x509]. Instead, the corresponding | of [I-D.ietf-cose-x509]. Instead, the corresponding parameter | |||
parameter without "-sender", such as x5t, SHOULD be used. | without "-sender", such as x5t, SHOULD be used. | |||
Example: X.509 certificates can be identified by a hash value using | Example: X.509 certificates can be identified by a hash value using | |||
the 'x5t' parameter: | the 'x5t' parameter: | |||
* ID_CRED_x = { 34 : COSE_CertHash }, for x = I or R, | * ID_CRED_x = { 34 : COSE_CertHash }, for x = I or R, | |||
Example: CWT or CCS can be identified by a key identifier using the | Example: CWT or CCS can be identified by a key identifier using the | |||
'kid' parameter: | 'kid' parameter: | |||
* ID_CRED_x = { 4 : key_id_x }, where key_id_x : kid, for x = I or | * ID_CRED_x = { 4 : key_id_x }, where key_id_x : kid, for x = I or | |||
R. | R. | |||
Note that 'kid' is extended to support int values to allow more one- | The value of a COSE 'kid' parameter is a byte string. To allow one- | |||
byte identifiers (see Section 9.7 and Section 9.8) which may be | byte encodings of ID_CRED_x with key identifiers 'kid', which is | |||
useful in many scenarios since constrained devices only have a few | useful in scenarios with only a few keys, the integer representation | |||
keys. As stated in Section 3.1 of [I-D.ietf-cose-rfc8152bis-struct], | of identifiers in Section 3.3.2 MUST be applied. For details, see | |||
Section 5.3.2 and Section 5.4.2. | ||||
As stated in Section 3.1 of [I-D.ietf-cose-rfc8152bis-struct], | ||||
applications MUST NOT assume that 'kid' values are unique and several | applications MUST NOT assume that 'kid' values are unique and several | |||
keys associated with a 'kid' may need to be checked before the | keys associated with a 'kid' may need to be checked before the | |||
correct one is found. Applications might use additional information | correct one is found. Applications might use additional information | |||
such as 'kid context' or lower layers to determine which key to try | such as 'kid context' or lower layers to determine which key to try | |||
first. Applications should strive to make ID_CRED_x as unique as | first. Applications should strive to make ID_CRED_x as unique as | |||
possible, since the recipient may otherwise have to try several keys. | possible, since the recipient may otherwise have to try several keys. | |||
See Appendix C.3 for more examples. | See Appendix C.3 for more examples. | |||
3.6. Cipher Suites | 3.6. Cipher Suites | |||
An EDHOC cipher suite consists of an ordered set of algorithms from | An EDHOC cipher suite consists of an ordered set of algorithms from | |||
the "COSE Algorithms" and "COSE Elliptic Curves" registries as well | the "COSE Algorithms" and "COSE Elliptic Curves" registries as well | |||
as the EDHOC MAC length. Algorithms need to be specified with enough | as the EDHOC MAC length. All algorithm names and definitions follows | |||
parameters to make them completely determined. EDHOC is currently | from COSE [I-D.ietf-cose-rfc8152bis-algs]. Note that COSE sometimes | |||
uses peculiar names such as ES256 for 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 MAC length MUST be at least 8 bytes. Any | ||||
cryptographic algorithm used in the COSE header parameters in ID_CRED | ||||
is selected independently of the cipher suite. EDHOC is currently | ||||
only specified for use with key exchange algorithms of type ECDH | only specified for use with key exchange algorithms of type ECDH | |||
curves, but any Key Encapsulation Method (KEM), including Post- | curves, but any Key Encapsulation Method (KEM), including Post- | |||
Quantum Cryptography (PQC) KEMs, can be used in method 0, see | Quantum Cryptography (PQC) KEMs, can be used in method 0, see | |||
Section 8.4. Use of other types of key exchange algorithms to | Section 8.4. Use of other types of key exchange algorithms to | |||
replace static DH authentication (method 1,2,3) would likely require | replace static DH authentication (method 1,2,3) would likely require | |||
a specification updating EDHOC with new methods. | a specification updating EDHOC with new methods. | |||
EDHOC supports all signature algorithms defined by COSE, including | EDHOC supports all signature algorithms defined by COSE. Just like | |||
PQC signature algorithms such as HSS-LMS. Just like in TLS 1.3 | in (D)TLS 1.3 [RFC8446][RFC9147] and IKEv2 [RFC7296], a signature in | |||
[RFC8446] and IKEv2 [RFC7296], a signature in COSE is determined by | COSE is determined by the signature algorithm and the authentication | |||
the signature algorithm and the authentication key algorithm | key algorithm together, see Section 3.5.1. The exact details of the | |||
together, see Section 3.5.2. The exact details of the authentication | authentication key algorithm depend on the type of authentication | |||
key algorithm depend on the type of authentication credential. COSE | credential. COSE supports different formats for storing the public | |||
supports different formats for storing the public authentication keys | authentication keys including COSE_Key and X.509, which use different | |||
including COSE_Key and X.509, which have different names and ways to | names and ways to represent the authentication key and the | |||
represent the authentication key and the authentication key | authentication key algorithm. | |||
algorithm. | ||||
An EDHOC cipher suite consists of the following parameters: | An EDHOC cipher suite consists of the following parameters: | |||
* EDHOC AEAD algorithm | * EDHOC AEAD algorithm | |||
* EDHOC hash algorithm | * EDHOC hash algorithm | |||
* EDHOC MAC length in bytes (Static DH) | * EDHOC MAC length in bytes (Static DH) | |||
* EDHOC key exchange algorithm (ECDH curve) | * EDHOC key exchange algorithm (ECDH curve) | |||
* EDHOC signature algorithm | * EDHOC signature algorithm | |||
* Application AEAD algorithm | * Application AEAD algorithm | |||
* Application hash algorithm | * Application hash algorithm | |||
Each cipher suite is identified with a pre-defined int label. | Each cipher suite is identified with a pre-defined integer label. | |||
EDHOC can be used with all algorithms and curves defined for COSE. | EDHOC can be used with all algorithms and curves defined for COSE. | |||
Implementation can either use any combination of COSE algorithms and | Implementations can either use any combination of COSE algorithms and | |||
parameters to define their own private cipher suite, or use one of | parameters to define their own private cipher suite, or use one of | |||
the pre-defined cipher suites. Private cipher suites can be | the pre-defined cipher suites. Private cipher suites can be | |||
identified with any of the four values -24, -23, -22, -21. The pre- | identified with any of the four values -24, -23, -22, -21. The pre- | |||
defined cipher suites are listed in the IANA registry (Section 9.2) | defined cipher suites are listed in the IANA registry (Section 9.2) | |||
with initial content outlined here: | with initial content outlined here: | |||
* Cipher suites 0-3, based on AES-CCM, are intended for constrained | * Cipher suites 0-3, based on AES-CCM, are intended for constrained | |||
IoT where message overhead is a very important factor. Note that | IoT where message overhead is a very important factor. Note that | |||
AES-CCM-16-64-128 and AES-CCM-16-64-128 are compatible with the | AES-CCM-16-64-128 and AES-CCM-16-64-128 are compatible with the | |||
IEEE CCM* mode. | IEEE CCM* mode. | |||
- Cipher suites 1 and 3 use a larger tag length (128-bit) in | - Cipher suites 1 and 3 use a larger tag length (128-bit) in | |||
EDHOC than in the Application AEAD algorithm (64-bit). | EDHOC than in the Application AEAD algorithm (64-bit). | |||
* Cipher suites 4 and 5, based on ChaCha20, are intended for less | * Cipher suites 4 and 5, based on ChaCha20, are intended for less | |||
constrained applications and only use 128-bit tag lengths. | constrained applications and only use 128-bit tag lengths. | |||
* Cipher suite 6, based on AES-GCM, is for general non-constrained | * Cipher suite 6, based on AES-GCM, is for general non-constrained | |||
applications. It uses high performance algorithms that are widely | applications. It consists of high performance algorithms that are | |||
supported. | widely used in non-constrained applications. | |||
* Cipher suites 24 and 25 are intended for high security | * Cipher suites 24 and 25 are intended for high security | |||
applications such as government use and financial applications. | applications such as government use and financial applications. | |||
These cipher suites do not share any algorithms. Cipher suite 24 | These cipher suites do not share any algorithms. Cipher suite 24 | |||
is compatible with the CNSA suite [CNSA]. | consists of algorithms from the CNSA suite [CNSA]. | |||
The different methods (Section 3.2) use the same cipher suites, but | The different methods (Section 3.2) use the same cipher suites, but | |||
some algorithms are not used in some methods. The EDHOC signature | some algorithms are not used in some methods. The EDHOC signature | |||
algorithm is not used in methods without signature authentication. | algorithm is not used in methods without signature authentication. | |||
The Initiator needs to have a list of cipher suites it supports in | 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 | order of preference. The Responder needs to have a list of cipher | |||
suites it supports. SUITES_I contains cipher suites supported by the | suites it supports. SUITES_I contains cipher suites supported by the | |||
Initiator, formatted and processed as detailed in Section 5.2.1 to | Initiator, formatted and processed as detailed in Section 5.2.1 to | |||
secure the cipher suite negotiation. Examples of cipher suite | secure the cipher suite negotiation. Examples of cipher suite | |||
negotiation are given in Section 6.3.2. | negotiation are given in Section 6.3.2. | |||
3.7. Ephemeral Public Keys | 3.7. Ephemeral Public Keys | |||
EDHOC always uses compact representation of elliptic curve points, | The ephemeral public keys in EDHOC (G_X and G_Y) use compact | |||
see Appendix B. In COSE compact representation is achieved by | representation of elliptic curve points, see Appendix B. In COSE | |||
formatting the ECDH ephemeral public keys as COSE_Keys of type EC2 or | compact representation is achieved by formatting the ECDH ephemeral | |||
OKP according to Sections 7.1 and 7.2 of | public keys as COSE_Keys of type EC2 or OKP according to Sections 7.1 | |||
[I-D.ietf-cose-rfc8152bis-algs], but only including the 'x' parameter | and 7.2 of [I-D.ietf-cose-rfc8152bis-algs], but only including the | |||
in G_X and G_Y. For Elliptic Curve Keys of type EC2, compact | 'x' parameter in G_X and G_Y. For Elliptic Curve Keys of type EC2, | |||
representation MAY be used also in the COSE_Key. If the COSE | compact representation MAY be used also in the COSE_Key. If the COSE | |||
implementation requires an 'y' parameter, the value y = false SHALL | implementation requires a 'y' parameter, the value y = false SHALL be | |||
be used. COSE always use compact output for Elliptic Curve Keys of | used. COSE always use compact output for Elliptic Curve Keys of type | |||
type EC2. | EC2. | |||
3.8. External Authorization Data (EAD) | 3.8. External Authorization Data (EAD) | |||
In order to reduce round trips and number of messages or to simplify | In order to reduce round trips and the number of messages or to | |||
processing, external security applications may be integrated into | simplify processing, external security applications may be integrated | |||
EDHOC by transporting authorization related data in the messages. | into EDHOC by transporting authorization related data in the | |||
One example is third-party identity and authorization information | messages. | |||
protected out of scope of EDHOC [I-D.selander-ace-ake-authz]. | ||||
Another example is a certificate enrolment request or the resulting | ||||
issued certificate. | ||||
EDHOC allows opaque external authorization data (EAD) to be sent in | EDHOC allows opaque external authorization data (EAD) to be sent in | |||
the EDHOC messages. External authorization data sent in message_1 | each of the four EDHOC messages (EAD_1, EAD_2, EAD_3, EAD_4). | |||
(EAD_1) or message_2 (EAD_2) should be considered unprotected by | ||||
EDHOC, see Section 8.5. External authorization data sent in | ||||
message_3 (EAD_3) or message_4 (EAD_4) is protected between Initiator | ||||
and Responder. | ||||
External authorization data is a CBOR sequence (see Appendix C.1) | External authorization data is a CBOR sequence (see Appendix C.1) | |||
consisting of one or more (ead_label, ead_value) pairs as defined | consisting of one or more (ead_label, ead_value) pairs as defined | |||
below: | below: | |||
ead = 1* ( | ead = 1* ( | |||
ead_label : int, | ead_label : int, | |||
ead_value : any, | ead_value : bstr, | |||
) | ) | |||
Applications using external authorization data need to specify | A security application using external authorization data need to | |||
format, processing, and security considerations and register the | register an ead_label, specify the ead_value format for each message | |||
(ead_label, ead_value) pair, see Section 9.5. The CDDL type of | (see Section 9.5), and describe processing and security | |||
ead_value is determined by the int ead_label and MUST be specified. | considerations. | |||
The EAD fields of EDHOC are not intended for generic application | The EAD fields of EDHOC must not be used for generic application | |||
data. Since data carried in EAD_1 and EAD_2 fields may not be | data. Examples of the use of EAD is provided in Appendix E. | |||
protected, special considerations need to be made such that it does | ||||
not violate security and privacy requirements of the service which | ||||
uses this data. Moreover, the content in an EAD field may impact the | ||||
security properties provided by EDHOC. Security applications making | ||||
use of the EAD fields must perform the necessary security analysis. | ||||
3.9. Applicability Statement | 3.9. Application Profile | |||
EDHOC requires certain parameters to be agreed upon between Initiator | EDHOC requires certain parameters to be agreed upon between Initiator | |||
and Responder. Some parameters can be agreed through the protocol | and Responder. Some parameters can be negotiated through the | |||
execution (specifically cipher suite negotiation, see Section 3.6) | protocol execution (specifically, cipher suite, see Section 3.6) but | |||
but other parameters may need to be known out-of-band (e.g., which | other parameters are only communicated and may not be negotiated | |||
authentication method is used, see Section 3.2). | (e.g., which authentication method is used, see Section 3.2). Yet | |||
other parameters need to be known out-of-band. | ||||
The purpose of the applicability statement is to describe the | The purpose of an application profile is to describe the intended use | |||
intended use of EDHOC to allow for the relevant processing and | of EDHOC to allow for the relevant processing and verifications to be | |||
verifications to be made, including things like: | made, including things like: | |||
1. How the endpoint detects that an EDHOC message is received. This | 1. How the endpoint detects that an EDHOC message is received. This | |||
includes how EDHOC messages are transported, for example in the | includes how EDHOC messages are transported, for example in the | |||
payload of a CoAP message with a certain Uri-Path or Content- | payload of a CoAP message with a certain Uri-Path or Content- | |||
Format; see Appendix A.3. | Format; see Appendix A.2. | |||
* The method of transporting EDHOC messages may also describe | * The method of transporting EDHOC messages may also describe | |||
data carried along with the messages that are needed for the | data carried along with the messages that are needed for the | |||
transport to satisfy the requirements of Section 3.4, e.g., | transport to satisfy the requirements of Section 3.4, e.g., | |||
connection identifiers used with certain messages, see | connection identifiers used with certain messages, see | |||
Appendix A.3. | Appendix A.2. | |||
2. Authentication method (METHOD; see Section 3.2). | 2. Authentication method (METHOD; see Section 3.2). | |||
3. Profile for authentication credentials (CRED_I, CRED_R; see | 3. Profile for authentication credentials (CRED_I, CRED_R; see | |||
Section 3.5.3), e.g., profile for certificate or CCS, including | Section 3.5.2), e.g., profile for certificate or CCS, including | |||
supported authentication key algorithms (subject public key | supported authentication key algorithms (subject public key | |||
algorithm in X.509 or C509 certificate). | algorithm in X.509 or C509 certificate). | |||
4. Type used to identify authentication credentials (ID_CRED_I, | 4. Type used to identify credentials (ID_CRED_I, ID_CRED_R; see | |||
ID_CRED_R; see Section 3.5.4). | Section 3.5.3). | |||
5. Use and type of external authorization data (EAD_1, EAD_2, EAD_3, | 5. Use and type of external authorization data (EAD_1, EAD_2, EAD_3, | |||
EAD_4; see Section 3.8). | EAD_4; see Section 3.8). | |||
6. Identifier used as identity of endpoint; see Section 3.5.1. | 6. Identifier used as the identity of the endpoint; see | |||
Appendix D.2. | ||||
7. If message_4 shall be sent/expected, and if not, how to ensure a | 7. If message_4 shall be sent/expected, and if not, how to ensure a | |||
protected application message is sent from the Responder to the | protected application message is sent from the Responder to the | |||
Initiator; see Section 5.5. | Initiator; see Section 5.5. | |||
The applicability statement may also contain information about | The application profile may also contain information about supported | |||
supported cipher suites. The procedure for selecting and verifying | cipher suites. The procedure for selecting and verifying a cipher | |||
cipher suite is still performed as described in Section 5.2.1 and | suite is still performed as described in Section 5.2.1 and | |||
Section 6.3, but it may become simplified by this knowledge. | Section 6.3, but it may become simplified by this knowledge. | |||
An example of an applicability statement is shown in Appendix D. | An example of an application profile is shown in Appendix F. | |||
For some parameters, like METHOD, ID_CRED_x, type of EAD, the | For some parameters, like METHOD, ID_CRED_x, type of EAD, the | |||
receiver is able to verify compliance with applicability statement, | receiver is able to verify compliance with the application profile, | |||
and if it needs to fail because of incompliance, to infer the reason | and if it needs to fail because of incompliance, to infer the reason | |||
why the protocol failed. | why the protocol failed. | |||
For other parameters, like CRED_x in the case that it is not | For other parameters, like the profile of CRED_x in the case that it | |||
transported, it may not be possible to verify that incompliance with | is not transported, it may not be possible to verify that | |||
applicability statement was the reason for failure: Integrity | incompliance with the application profile was the reason for failure: | |||
verification in message_2 or message_3 may fail not only because of | Integrity verification in message_2 or message_3 may fail not only | |||
wrong authentication credential. For example, in case the Initiator | because of wrong credential. For example, in case the Initiator uses | |||
uses public key certificate by reference (i.e., not transported | public key certificate by reference (i.e., not transported within the | |||
within the protocol) then both endpoints need to use an identical | protocol) then both endpoints need to use an identical data structure | |||
data structure as CRED_I or else the integrity verification will | as CRED_I or else the integrity verification will fail. | |||
fail. | ||||
Note that it is not necessary for the endpoints to specify a single | 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 | 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 | HTTP may be used along the path, and this may still allow correlation | |||
between messages. | between messages. | |||
The applicability statement may be dependent on the identity of the | The application profile may be dependent on the identity of the other | |||
other endpoint, or other information carried in an EDHOC message, but | endpoint, or other information carried in an EDHOC message, but it | |||
it then applies only to the later phases of the protocol when such | then applies only to the later phases of the protocol when such | |||
information is known. (The Initiator does not know identity of | information is known. (The Initiator does not know the identity of | |||
Responder before having verified message_2, and the Responder does | the Responder before having verified message_2, and the Responder | |||
not know identity of the Initiator before having verified message_3.) | does not know the identity of the Initiator before having verified | |||
message_3.) | ||||
Other conditions may be part of the applicability statement, such as | Other conditions may be part of the application profile, such as | |||
target application or use (if there is more than one application/use) | target application or use (if there is more than one application/use) | |||
to the extent that EDHOC can distinguish between them. In case | to the extent that EDHOC can distinguish between them. In case | |||
multiple applicability statements are used, the receiver needs to be | multiple application profiles are used, the receiver needs to be able | |||
able to determine which is applicable for a given session, for | to determine which is applicable for a given session, for example | |||
example based on URI or external authorization data type. | based on URI or external authorization data type. | |||
4. Key Derivation | 4. Key Derivation | |||
4.1. Keys for EDHOC Message Processing | ||||
EDHOC uses Extract-and-Expand [RFC5869] with the EDHOC hash algorithm | EDHOC uses Extract-and-Expand [RFC5869] with the EDHOC hash algorithm | |||
in the selected cipher suite to derive keys used in EDHOC and in the | in the selected cipher suite to derive keys used in message | |||
application. Extract is used to derive fixed-length uniformly | processing. This section defines Extract (Section 4.1.1) and Expand | |||
pseudorandom keys (PRK) from ECDH shared secrets. Expand is used to | (Section 4.1.2), and how to use them to derive PRK_out | |||
derive additional output keying material (OKM) from the PRKs. | (Section 4.1.3) which is the shared secret key resulting from a | |||
successful EDHOC exchange. | ||||
This section defines Extract, Expand and other key derivation | Extract is used to derive fixed-length uniformly pseudorandom keys | |||
functions based on these: Expand is used to define EDHOC-KDF and in | (PRK) from ECDH shared secrets. Expand is used to define EDHOC-KDF | |||
turn EDHOC-Exporter, whereas Extract is used to define EDHOC- | for generating MACs and for deriving output keying material (OKM) | |||
KeyUpdate. | from PRKs. | |||
4.1. Extract | In EDHOC a specific message is protected with a certain pseudorandom | |||
key, but how the key is derived depends on the method as detailed in | ||||
Section 5. | ||||
The pseudorandom keys (PRKs) are derived using Extract. | 4.1.1. Extract | |||
The pseudorandom keys (PRKs) used for EDHOC message processing are | ||||
derived using Extract: | ||||
PRK = Extract( salt, IKM ) | PRK = Extract( salt, IKM ) | |||
where the input keying material (IKM) and salt are defined for each | where the input keying material (IKM) and salt are defined for each | |||
PRK below. | PRK below. | |||
The definition of Extract depends on the EDHOC hash algorithm of the | The definition of Extract depends on the EDHOC hash algorithm of the | |||
selected cipher suite: | selected cipher suite: | |||
* if the EDHOC hash algorithm is SHA-2, then Extract( salt, IKM ) = | * if the EDHOC hash algorithm is SHA-2, then Extract( salt, IKM ) = | |||
HKDF-Extract( salt, IKM ) [RFC5869] | HKDF-Extract( salt, IKM ) [RFC5869] | |||
* if the EDHOC hash algorithm is SHAKE128, then Extract( salt, IKM ) | * if the EDHOC hash algorithm is SHAKE128, then Extract( salt, IKM ) | |||
= KMAC128( salt, IKM, 256, "" ) | = KMAC128( salt, IKM, 256, "" ) | |||
* if the EDHOC hash algorithm is SHAKE256, then Extract( salt, IKM ) | * if the EDHOC hash algorithm is SHAKE256, then Extract( salt, IKM ) | |||
= KMAC256( salt, IKM, 512, "" ) | = KMAC256( salt, IKM, 512, "" ) | |||
4.1.1. PRK_2e | The rest of the section defines the pseudo-random keys PRK_2e, | |||
PRK_3e2m and PRK_4e3m; their use is shown in Figure 7. | ||||
PRK_2e is used to derive a keystream to encrypt message_2. PRK_2e is | 4.1.1.1. PRK_2e | |||
derived with the following input: | ||||
The pseudo-random key PRK_2e is derived with the following input: | ||||
* The salt SHALL be a zero-length byte string. Note that [RFC5869] | * The salt SHALL be a zero-length byte string. Note that [RFC5869] | |||
specifies that if the salt is not provided, it is set to a string | specifies that if the salt is not provided, it is set to a string | |||
of zeros (see Section 2.2 of [RFC5869]). For implementation | of zeros (see Section 2.2 of [RFC5869]). For implementation | |||
purposes, not providing the salt is the same as setting the salt | purposes, not providing the salt is the same as setting the salt | |||
to the zero-length byte string (0x). | to the zero-length byte string (0x). | |||
* The IKM SHALL be the ephemeral-ephemeral ECDH shared secret G_XY | * 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 | (calculated from G_X and Y or G_Y and X) as defined in | |||
Section 6.3.1 of [I-D.ietf-cose-rfc8152bis-algs]. The use of G_XY | Section 6.3.1 of [I-D.ietf-cose-rfc8152bis-algs]. The use of G_XY | |||
skipping to change at page 24, line 7 ¶ | skipping to change at page 23, line 36 ¶ | |||
G_XY = X25519( Y, G_X ) = X25519( X, G_Y ) | G_XY = X25519( Y, G_X ) = X25519( X, G_Y ) | |||
Example: Assuming the use of SHA-256 the extract phase of HKDF | Example: Assuming the use of SHA-256 the extract phase of HKDF | |||
produces PRK_2e as follows: | produces PRK_2e as follows: | |||
PRK_2e = HMAC-SHA-256( salt, G_XY ) | PRK_2e = HMAC-SHA-256( salt, G_XY ) | |||
where salt = 0x (zero-length byte string). | where salt = 0x (zero-length byte string). | |||
4.1.2. PRK_3e2m | 4.1.1.2. PRK_3e2m | |||
PRK_3e2m is used to produce a MAC in message_2 and to encrypt | The pseudo-random key PRK_3e2m is derived as follows: | |||
message_3. PRK_3e2m is derived as follows: | ||||
If the Responder authenticates with a static Diffie-Hellman key, then | If the Responder authenticates with a static Diffie-Hellman key, then | |||
PRK_3e2m = Extract( PRK_2e, G_RX ), where G_RX is the ECDH shared | PRK_3e2m = Extract( SALT_3e2m, G_RX ), where | |||
secret calculated from G_R and X, or G_X and R, else PRK_3e2m = | ||||
PRK_2e. | ||||
4.1.3. PRK_4x3m | * SALT_3e2m is derived from PRK_2e, see Section 4.1.2, and | |||
PRK_4x3m is used to produce a MAC in message_3, to encrypt message_4, | * G_RX is the ECDH shared secret calculated from G_R and X, or G_X | |||
and to derive application specific data. PRK_4x3m is derived as | and R (the Responder's private authentication key, see | |||
follows: | Section 3.5.1), | |||
else PRK_3e2m = PRK_2e. | ||||
4.1.1.3. PRK_4e3m | ||||
The pseudo-random key PRK_4e3m is derived as follows: | ||||
If the Initiator authenticates with a static Diffie-Hellman key, then | If the Initiator authenticates with a static Diffie-Hellman key, then | |||
PRK_4x3m = Extract( PRK_3e2m, G_IY ), where G_IY is the ECDH shared | PRK_4e3m = Extract( SALT_4e3m, G_IY ), where | |||
secret calculated from G_I and Y, or G_Y and I, else PRK_4x3m = | ||||
PRK_3e2m. | ||||
4.2. Expand | * SALT_4e3m is derived from PRK_3e2m, see Section 4.1.2, and | |||
The keys, IVs and MACs used in EDHOC are derived from the PRKs using | * G_IY is the ECDH shared secret calculated from G_I and Y, or G_Y | |||
Expand, and instantiated with the EDHOC AEAD algorithm in the | and I (the Initiator's private authentication key, see | |||
selected cipher suite. | Section 3.5.1), | |||
OKM = EDHOC-KDF( PRK, transcript_hash, label, context, length ) | else PRK_4e3m = PRK_3e2m. | |||
4.1.2. Expand and EDHOC-KDF | ||||
The output keying material (OKM) - including keys, IVs, and salts - | ||||
are derived from the PRKs using the EDHOC-KDF, which is defined | ||||
through Expand: | ||||
OKM = EDHOC-KDF( PRK, label, context, length ) | ||||
= Expand( PRK, info, length ) | = Expand( PRK, info, length ) | |||
where info is encoded as the CBOR sequence | where info is encoded as the CBOR sequence | |||
info = ( | info = ( | |||
transcript_hash : bstr, | label : uint, | |||
label : tstr, | ||||
context : bstr, | context : bstr, | |||
length : uint, | length : uint, | |||
) | ) | |||
where | where | |||
* transcript_hash is a bstr set to one of the transcript hashes | * label is a uint | |||
TH_2, TH_3, or TH_4 as defined in Sections 5.3.1, 5.4.1, and 4.3. | ||||
* label is a tstr set to the name of the derived key, IV or MAC; | ||||
i.e., "KEYSTREAM_2", "MAC_2", "K_3", "IV_3", or "MAC_3". | ||||
* context is a bstr | * context is a bstr | |||
* length is the length of output keying material (OKM) in bytes | * length is the length of OKM in bytes | |||
When EDHOC-KDF is used to derive OKM for EDHOC message processing, | ||||
then context includes one of the transcript hashes TH_2, TH_3, or | ||||
TH_4 defined in Sections 5.3.2 and 5.4.2. | ||||
The definition of Expand depends on the EDHOC hash algorithm of the | The definition of Expand depends on the EDHOC hash algorithm of the | |||
selected cipher suite: | selected cipher suite: | |||
* if the EDHOC hash algorithm is SHA-2, then Expand( PRK, info, | * if the EDHOC hash algorithm is SHA-2, then Expand( PRK, info, | |||
length ) = HKDF-Expand( PRK, info, length ) [RFC5869] | length ) = HKDF-Expand( PRK, info, length ) [RFC5869] | |||
* if the EDHOC hash algorithm is SHAKE128, then Expand( PRK, info, | * if the EDHOC hash algorithm is SHAKE128, then Expand( PRK, info, | |||
length ) = KMAC128( PRK, info, L, "" ) | length ) = KMAC128( PRK, info, L, "" ) | |||
* if the EDHOC hash algorithm is SHAKE256, then Expand( PRK, info, | * if the EDHOC hash algorithm is SHAKE256, then Expand( PRK, info, | |||
length ) = KMAC256( PRK, info, L, "" ) | length ) = KMAC256( PRK, info, L, "" ) | |||
where L = 8*length, the output length in bits. | where L = 8*length, the output length in bits. | |||
The keys, IVs and MACs are derived as follows: | Figure 7 lists derivations made with EDHOC-KDF during message | |||
processing. How the output keying material is used is specified in | ||||
Section 5. | ||||
* KEYSTREAM_2 is derived using the transcript hash TH_2 and the | KEYSTREAM_2 = EDHOC-KDF( PRK_2e, 0, TH_2, plaintext_length ) | |||
pseudorandom key PRK_2e. | 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 ) | ||||
* MAC_2 is derived using the transcript hash TH_2 and the | Figure 7: Key derivations using EDHOC-KDF. | |||
pseudorandom key PRK_3e2m. | ||||
* K_3 and IV_3 are derived using the transcript hash TH_3 and the | 4.1.3. PRK_out | |||
pseudorandom key PRK_3e2m. IVs are only used if the EDHOC AEAD | ||||
algorithm uses IVs. | ||||
* MAC_3 is derived using the transcript hash TH_3 and the | The pseudo-random key PRK_out, derived as shown in Figure 7, is the | |||
pseudorandom key PRK_4x3m. | only secret key shared between Initiator and Responder that needs to | |||
be stored after a successful EDHOC exchange, see Section 5.4. Keys | ||||
for applications are derived from PRK_out, see Section 4.2.1. | ||||
KEYSTREAM_2, K_3, and IV_3 use an empty CBOR byte string h'' as | 4.2. Keys for EDHOC Applications | |||
context. MAC_2 and MAC_3 use context as defined in Section 5.3.2 and | ||||
Section 5.4.2, respectively. | ||||
4.3. EDHOC-Exporter | This section defines EDHOC-Exporter and EDHOC-KeyUpdate in terms of | |||
EDHOC-KDF and PRK_out. | ||||
Application keys and other application specific data can be derived | 4.2.1. EDHOC-Exporter | |||
using the EDHOC-Exporter interface defined as: | ||||
Keying material for the application can be derived using the EDHOC- | ||||
Exporter interface defined as: | ||||
EDHOC-Exporter(label, context, length) | EDHOC-Exporter(label, context, length) | |||
= EDHOC-KDF(PRK_4x3m, TH_4, label, context, length) | = EDHOC-KDF(PRK_exporter, label, context, length) | |||
where label is a registered tstr from the EDHOC Exporter Label | where | |||
registry (Section 9.1), context is a bstr defined by the application, | ||||
and length is a uint defined by the application. The (label, | ||||
context) pair must be unique, i.e., a (label, context) MUST NOT be | ||||
used for two different purposes. However an application can re- | ||||
derive the same key several times as long as it is done in a secure | ||||
way. For example, in most encryption algorithms the same key kan be | ||||
reused with different nonces. The context can for example be the | ||||
empty (zero-length) sequence or a single CBOR byte string. | ||||
The transcript hash TH_4 is a CBOR encoded bstr and the input to the | * label is a registered uint from the EDHOC Exporter Label registry | |||
hash function is a CBOR Sequence. | (Section 9.1) | |||
TH_4 = H( TH_3, CIPHERTEXT_3 ) | * context is a bstr defined by the application | |||
where H() is the hash function in the selected cipher suite. | * length is a uint defined by the application | |||
Examples of use of the EDHOC-Exporter are given in Section 5.5.2 and | ||||
Appendix A. | ||||
* K_4 and IV_4 are derived with the EDHOC-Exporter using the empty | * PRK_exporter is derived from PRK_out: | |||
CBOR byte string h'' as context, and labels "EDHOC_K_4" and | ||||
"EDHOC_IV_4", respectively. IVs are only used if the EDHOC AEAD | ||||
algorithm uses IVs. | ||||
4.4. EDHOC-KeyUpdate | PRK_exporter = EDHOC-KDF( PRK_out, 10, h'', hash_length ) | |||
where hash_length denotes the length of the hash function output in | ||||
bytes, as specified by the COSE hash algorithm definition. | ||||
PRK_exporter MUST be derived anew if PRK_out is updated, in | ||||
particular if EDHOC-KeyUpdate is used, see Section 4.2.2. | ||||
The (label, context) pair must be unique, i.e., a (label, context) | ||||
MUST NOT be used for two different purposes. However an application | ||||
can re-derive the same key several times as long as it is done in a | ||||
secure way. For example, in most encryption algorithms the same key | ||||
can be reused with different nonces. The context can for example be | ||||
the empty CBOR byte string. | ||||
Examples of use of the EDHOC-Exporter are given in Appendix A. | ||||
4.2.2. EDHOC-KeyUpdate | ||||
To provide forward secrecy in an even more efficient way than re- | To provide forward secrecy in an even more efficient way than re- | |||
running EDHOC, EDHOC provides the function EDHOC-KeyUpdate. When | running EDHOC, EDHOC provides the function EDHOC-KeyUpdate. When | |||
EDHOC-KeyUpdate is called the old PRK_4x3m is deleted and the new | EDHOC-KeyUpdate is called, the old PRK_out is deleted and the new | |||
PRK_4x3m is calculated as a "hash" of the old key using the Extract | PRK_out is calculated as a "hash" of the old key using the Expand | |||
function as illustrated by the following pseudocode: | function as illustrated by the following pseudocode: | |||
EDHOC-KeyUpdate( nonce ): | EDHOC-KeyUpdate( context ): | |||
PRK_4x3m = Extract( nonce, PRK_4x3m ) | PRK_out = EDHOC-KDF( PRK_out, 11, context, hash_length ) | |||
The EDHOC-KeyUpdate takes a nonce as input to guarantee that there | where hash_length denotes the length of the hash function output in | |||
are no short cycles. The Initiator and the Responder need to agree | bytes, as specified by the COSE hash algorithm definition. | |||
on the nonce, which can e.g., be a counter or a random number. While | ||||
the KeyUpdate method provides forward secrecy it does not give as | The EDHOC-KeyUpdate takes a context as input to enable binding of the | |||
strong security properties as re-running EDHOC, see Section 8. | updated PRK_out to some event that triggered the keyUpdate. The | |||
Initiator and the Responder need to agree on the context, which can, | ||||
e.g., be a counter or a pseudo-random number such as a hash. The | ||||
Initiator and the Responder also need to cache the old PRK_out until | ||||
it has verfied that the other endpoint has the correct new PRK_out. | ||||
[I-D.ietf-core-oscore-key-update] describes key update for OSCORE | ||||
using EDHOC-KeyUpdate. | ||||
While this key update method provides forward secrecy it does not | ||||
give as strong security properties as re-running EDHOC, see | ||||
Section 8. | ||||
5. Message Formatting and Processing | 5. Message Formatting and Processing | |||
This section specifies formatting of the messages and processing | This section specifies formatting of the messages and processing | |||
steps. Error messages are specified in Section 6. Annotated traces | steps. Error messages are specified in Section 6. Annotated traces | |||
of EDHOC protocol runs are provided in [I-D.selander-lake-traces]. | of EDHOC protocol runs are provided in [I-D.ietf-lake-traces]. | |||
An EDHOC message is encoded as a sequence of CBOR data items (CBOR | An EDHOC message is encoded as a sequence of CBOR data items (CBOR | |||
Sequence, [RFC8742]). Additional optimizations are made to reduce | Sequence, [RFC8742]). Additional optimizations are made to reduce | |||
message overhead. | message overhead. | |||
While EDHOC uses the COSE_Key, COSE_Sign1, and COSE_Encrypt0 | While EDHOC uses the COSE_Key, COSE_Sign1, and COSE_Encrypt0 | |||
structures, only a subset of the parameters is included in the EDHOC | structures, only a subset of the parameters is included in the EDHOC | |||
messages, see Appendix C.3. The unprotected COSE header in | messages, see Appendix C.3. The unprotected COSE header in | |||
COSE_Sign1, and COSE_Encrypt0 (not included in the EDHOC message) MAY | COSE_Sign1, and COSE_Encrypt0 (not included in the EDHOC message) MAY | |||
contain parameters (e.g., 'alg'). | contain parameters (e.g., 'alg'). | |||
5.1. Message Processing Outline | 5.1. Message Processing Outline | |||
This section outlines the message processing of EDHOC. | This section outlines the message processing of EDHOC. | |||
For each new/ongoing session, the endpoints are assumed to keep an | For each new/ongoing session, the endpoints are assumed to keep an | |||
associated protocol state containing identifiers, keying material, | associated protocol state containing identifiers, keying material, | |||
etc. used for subsequent processing of protocol related data. The | etc. used for subsequent processing of protocol related data. The | |||
protocol state is assumed to be associated to an applicability | protocol state is assumed to be associated to an application profile | |||
statement (Section 3.9) which provides the context for how messages | (Section 3.9) which provides the context for how messages are | |||
are transported, identified, and processed. | transported, identified, and processed. | |||
EDHOC messages SHALL be processed according to the current protocol | EDHOC messages SHALL be processed according to the current protocol | |||
state. The following steps are expected to be performed at reception | state. The following steps are expected to be performed at reception | |||
of an EDHOC message: | of an EDHOC message: | |||
1. Detect that an EDHOC message has been received, for example by | 1. Detect that an EDHOC message has been received, for example by | |||
means of port number, URI, or media type (Section 3.9). | means of port number, URI, or media type (Section 3.9). | |||
2. Retrieve the protocol state according to the message correlation | 2. Retrieve the protocol state according to the message correlation | |||
provided by the transport, see Section 3.4. If there is no | provided by the transport, see Section 3.4. If there is no | |||
protocol state, in the case of message_1, a new protocol state is | protocol state, in the case of message_1, a new protocol state is | |||
created. The Responder endpoint needs to make use of available | created. The Responder endpoint needs to make use of available | |||
Denial-of-Service mitigation (Section 8.6). | Denial-of-Service mitigation (Section 8.7). | |||
3. If the message received is an error message, then process | 3. If the message received is an error message, then process it | |||
according to Section 6, else process as the expected next message | according to Section 6, else process it as the expected next | |||
according to the protocol state. | message according to the protocol state. | |||
If the processing fails for some reason then, typically, an error | If the processing fails for some reason then, typically, an error | |||
message is sent, the protocol is discontinued, and the protocol state | message is sent, the protocol is discontinued, and the protocol state | |||
erased. Further details are provided in the following subsections | erased. Further details are provided in the following subsections | |||
and in Section 6. | and in Section 6. | |||
Different instances of the same message MUST NOT be processed in one | Different instances of the same message MUST NOT be processed in one | |||
session. Note that processing will fail if the same message appears | session. Note that processing will fail if the same message appears | |||
a second time for EDHOC processing because the state of the protocol | a second time for EDHOC processing in the same session because the | |||
has moved on and now expects something else. This assumes that | state of the protocol has moved on and now expects something else. | |||
message duplication due to re-transmissions is handled by the | This assumes that message duplication due to re-transmissions is | |||
transport protocol, see Section 3.4. The case when the transport | handled by the transport protocol, see Section 3.4. The case when | |||
does not support message deduplication is addressed in Appendix E. | the transport does not support message deduplication is addressed in | |||
Appendix G. | ||||
5.2. EDHOC Message 1 | 5.2. EDHOC Message 1 | |||
5.2.1. Formatting of Message 1 | 5.2.1. Formatting of Message 1 | |||
message_1 SHALL be a CBOR Sequence (see Appendix C.1) as defined | message_1 SHALL be a CBOR Sequence (see Appendix C.1) as defined | |||
below | below | |||
message_1 = ( | message_1 = ( | |||
METHOD : int, | METHOD : int, | |||
SUITES_I : suites, | SUITES_I : suites, | |||
G_X : bstr, | G_X : bstr, | |||
C_I : bstr / int, | C_I : bstr / -24..23, | |||
? EAD_1 : ead, | ? EAD_1 : ead, | |||
) | ) | |||
suites = [ 2* int ] / int | suites = [ 2* int ] / int | |||
where: | where: | |||
* METHOD - authentication method, see Section 3.2. | * METHOD - authentication method, see Section 3.2. | |||
* SUITES_I - array of cipher suites which the Initiator supports in | * SUITES_I - array of cipher suites which the Initiator supports in | |||
order of preference, starting with the most preferred and ending | order of preference, the first cipher suite in network byte order | |||
with the cipher suite selected for this session. If the most | is the most preferred by I, the last is the one selected by I for | |||
preferred cipher suite is selected then SUITES_I is encoded as | this session. If the most preferred cipher suite is selected then | |||
that cipher suite, i.e., as an int. The processing steps are | SUITES_I contains only that cipher suite and is encoded as an int. | |||
detailed below and in Section 6.3. | The processing steps are detailed below and in Section 6.3. | |||
* G_X - the ephemeral public key of the Initiator | * G_X - the ephemeral public key of the Initiator | |||
* C_I - variable length connection identifier | * C_I - 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. | ||||
* EAD_1 - unprotected external authorization data, see Section 3.8. | * EAD_1 - external authorization data, see Section 3.8. | |||
5.2.2. Initiator Processing of Message 1 | 5.2.2. Initiator Processing of Message 1 | |||
The Initiator SHALL compose message_1 as follows: | The Initiator SHALL compose message_1 as follows: | |||
* SUITES_I contains a list of supported cipher suites, in order of | * Construct SUITES_I complying with the definition in | |||
preference, truncated after the cipher suite selected for this | Section 5.2.1}, and furthermore: | |||
session. | ||||
- The Initiator MUST select its most preferred cipher suite, | - The Initiator MUST select its most preferred cipher suite, | |||
conditioned on what it can assume to be supported by the | conditioned on what it can assume to be supported by the | |||
Responder. | Responder. | |||
- The selected cipher suite MAY be changed between sessions, | - The selected cipher suite (i.e. the last cipher suite in | |||
e.g., based on previous error messages (see next bullet), but | SUITES_I) MAY be different between sessions, e.g., based on | |||
all cipher suites which are more preferred than the selected | previous error messages (see next bullet), but all cipher | |||
cipher suite in the list MUST be included in SUITES_I. | suites which are more preferred by I than the selected cipher | |||
suite MUST be included in SUITES_I. | ||||
- If the Initiator previously received from the Responder an | - If the Initiator previously received from the Responder an | |||
error message with error code 2 (see Section 6.3) indicating | error message with error code 2 containing SUITES_R (see | |||
cipher suites supported by the Responder, then the Initiator | Section 6.3) which indicates cipher suites supported by the | |||
SHOULD select the most preferred supported cipher suite among | Responder, then the Initiator SHOULD select its most preferred | |||
those (note that error messages are not authenticated and may | supported cipher suite among those (bearing in mind that error | |||
be forged). | messages are not authenticated and may be forged). | |||
- The supported cipher suites and the order of preference MUST | - The Initiator MUST NOT change the supported cipher suites and | |||
NOT be changed based on previous error messages. | the order of preference in SUITES_I based on previous error | |||
messages. | ||||
* Generate an ephemeral ECDH key pair using the curve in the | * 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 | selected cipher suite and format it as a COSE_Key. Let G_X be the | |||
'x' parameter of the COSE_Key. | 'x' parameter of the COSE_Key. | |||
* Choose a connection identifier C_I and store it for the length of | * Choose a connection identifier C_I and store it for the length of | |||
the protocol. | the protocol. | |||
* Encode message_1 as a sequence of CBOR encoded data items as | * Encode message_1 as a sequence of CBOR encoded data items as | |||
specified in Section 5.2.1 | specified in Section 5.2.1 | |||
5.2.3. Responder Processing of Message 1 | 5.2.3. Responder Processing of Message 1 | |||
The Responder SHALL process message_1 as follows: | The Responder SHALL process message_1 as follows: | |||
* Decode message_1 (see Appendix C.1). | * Decode message_1 (see Appendix C.1). | |||
* Verify that the selected cipher suite is supported and that no | * Verify that the selected cipher suite is supported and that no | |||
prior cipher suite in SUITES_I is supported. | prior cipher suite in SUITES_I is supported. | |||
* Pass EAD_1 to the security application. | * If EAD_1 is present then make it available to the application for | |||
EAD processing. | ||||
If any processing step fails, the Responder SHOULD send an EDHOC | If any processing step fails, the Responder MUST send an EDHOC error | |||
error message back, formatted as defined in Section 6, and the | message back, formatted as defined in Section 6, and the session MUST | |||
session MUST be discontinued. Sending error messages is essential | be discontinued. | |||
for debugging but MAY e.g., be skipped due to denial-of-service | ||||
reasons, see Section 8.6. If an error message is sent, the session | ||||
MUST be discontinued. | ||||
5.3. EDHOC Message 2 | 5.3. EDHOC Message 2 | |||
5.3.1. Formatting of Message 2 | 5.3.1. Formatting of Message 2 | |||
message_2 SHALL be a CBOR Sequence (see Appendix C.1) as defined | message_2 SHALL be a CBOR Sequence (see Appendix C.1) as defined | |||
below | below | |||
message_2 = ( | message_2 = ( | |||
G_Y_CIPHERTEXT_2 : bstr, | G_Y_CIPHERTEXT_2 : bstr, | |||
C_R : bstr / int, | C_R : bstr / -24..23, | |||
) | ) | |||
where: | where: | |||
* G_Y_CIPHERTEXT_2 - the concatenation of G_Y, the ephemeral public | * G_Y_CIPHERTEXT_2 - the concatenation of G_Y (i.e., the ephemeral | |||
key of the Responder, and CIPHERTEXT_2 | public key of the Responder) and CIPHERTEXT_2. | |||
* C_R - variable length connection identifier | * C_R - 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. | ||||
5.3.2. Responder Processing of Message 2 | 5.3.2. Responder Processing of Message 2 | |||
The Responder SHALL compose message_2 as follows: | The Responder SHALL compose message_2 as follows: | |||
* Generate an ephemeral ECDH key pair using the curve in the | * 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 | selected cipher suite and format it as a COSE_Key. Let G_Y be the | |||
'x' parameter of the COSE_Key. | 'x' parameter of the COSE_Key. | |||
* Choose a connection identifier C_R and store it for the length of | * Choose a connection identifier C_R and store it for the length of | |||
the protocol. | the protocol. | |||
* Compute the transcript hash TH_2 = H( H(message_1), G_Y, C_R ) | * Compute the transcript hash TH_2 = H( G_Y, C_R, H(message_1) ) | |||
where H() is the hash function in the selected cipher suite. The | where H() is the EDHOC hash algorithm of the selected cipher | |||
transcript hash TH_2 is a CBOR encoded bstr and the input to the | suite. The transcript hash TH_2 is a CBOR encoded bstr and the | |||
hash function is a CBOR Sequence. Note that H(message_1) can be | input to the hash function is a CBOR Sequence. Note that | |||
computed and cached already in the processing of message_1. | H(message_1) can be computed and cached already in the processing | |||
of message_1. | ||||
* Compute MAC_2 = EDHOC-KDF( PRK_3e2m, TH_2, "MAC_2", << ID_CRED_R, | * Compute MAC_2 as in Section 4.1.2 with context_2 = << ID_CRED_R, | |||
CRED_R, ? EAD_2 >>, mac_length_2 ). If the Responder | TH_2, CRED_R, ? EAD_2 >> | |||
authenticates with a static Diffie-Hellman key (method equals 1 or | ||||
3), then mac_length_2 is the EDHOC MAC length given by the | ||||
selected cipher suite. If the Responder authenticates with a | ||||
signature key (method equals 0 or 2), then mac_length_2 is equal | ||||
to the output size of the EDHOC hash algorithm given by the | ||||
selected cipher suite. | ||||
- ID_CRED_R - identifier to facilitate retrieval of CRED_R, see | - If the Responder authenticates with a static Diffie-Hellman key | |||
Section 3.5.4 | (method equals 1 or 3), then mac_length_2 is the EDHOC MAC | |||
length given by the selected cipher suite. If the Responder | ||||
authenticates with a signature key (method equals 0 or 2), then | ||||
mac_length_2 is equal to the output size of the EDHOC hash | ||||
algorithm given by the selected cipher suite. | ||||
- CRED_R - CBOR item containing the credential of the Responder, | - ID_CRED_R - identifier to facilitate the retrieval of CRED_R, | |||
see Section 3.5.3 | see Section 3.5.3 | |||
- EAD_2 - unprotected external authorization data, see | - CRED_R - CBOR item containing the authentication credential of | |||
Section 3.8 | the Responder, see Section 3.5.2 | |||
- EAD_2 - external authorization data, see Section 3.8 | ||||
* If the Responder authenticates with a static Diffie-Hellman key | * 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 | (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 | Responder authenticates with a signature key (method equals 0 or | |||
2), then Signature_or_MAC_2 is the 'signature' field of a | 2), then Signature_or_MAC_2 is the 'signature' field of a | |||
COSE_Sign1 object as defined in Section 4.4 of | COSE_Sign1 object, computed as specified in Section 4.4 of | |||
[I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm of | [I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm of | |||
the selected cipher suite, the private authentication key of the | the selected cipher suite, the private authentication key of the | |||
Responder, and the following parameters as input (see | Responder, and the following parameters as input (see Appendix C.3 | |||
Appendix C.3): | for an overview of COSE and Appendix C.1 for notation): | |||
- protected = << ID_CRED_R >> | - protected = << ID_CRED_R >> | |||
- external_aad = << TH_2, CRED_R, ? EAD_2 >> | - external_aad = << TH_2, CRED_R, ? EAD_2 >> | |||
- payload = MAC_2 | - payload = MAC_2 | |||
* CIPHERTEXT_2 is calculated by using the Expand function as a | * CIPHERTEXT_2 is calculated by using the Expand function as a | |||
binary additive stream cipher. | binary additive stream cipher over the following plaintext: | |||
- plaintext = ( ID_CRED_R / bstr / int, Signature_or_MAC_2, ? | - PLAINTEXT_2 = ( ? PAD, ID_CRED_R / bstr / -24..23, | |||
EAD_2 ) | Signature_or_MAC_2, ? EAD_2 ) | |||
o If ID_CRED_R contains a single 'kid' parameter, i.e., | o If ID_CRED_R contains a single 'kid' parameter, i.e., | |||
ID_CRED_R = { 4 : kid_R }, then only the byte string or | ID_CRED_R = { 4 : kid_R }, then only the byte string kid_R | |||
integer kid_R is conveyed in the plaintext encoded | is conveyed in the plaintext, represented as described in | |||
accordingly as bstr or int. | Section 3.3.2. | |||
- Compute KEYSTREAM_2 = EDHOC-KDF( PRK_2e, TH_2, "KEYSTREAM_2", | o PAD = 1*true is padding that may be used to hide the length | |||
h'', plaintext_length ), where plaintext_length is the length | of the unpadded plaintext | |||
of the plaintext. | ||||
- CIPHERTEXT_2 = plaintext XOR KEYSTREAM_2 | - Compute KEYSTREAM_2 as in Section 4.1.2, where plaintext_length | |||
is the length of PLAINTEXT_2. | ||||
- CIPHERTEXT_2 = PLAINTEXT_2 XOR KEYSTREAM_2 | ||||
* Encode message_2 as a sequence of CBOR encoded data items as | * Encode message_2 as a sequence of CBOR encoded data items as | |||
specified in Section 5.3.1. | specified in Section 5.3.1. | |||
5.3.3. Initiator Processing of Message 2 | 5.3.3. Initiator Processing of Message 2 | |||
The Initiator SHALL process message_2 as follows: | The Initiator SHALL process message_2 as follows: | |||
* Decode message_2 (see Appendix C.1). | * Decode message_2 (see Appendix C.1). | |||
* Retrieve the protocol state using the message correlation provided | * Retrieve the protocol state using the message correlation provided | |||
by the transport (e.g., the CoAP Token, the 5-tuple, or the | by the transport (e.g., the CoAP Token, the 5-tuple, or the | |||
prepended C_I, see Appendix A.3). | prepended C_I, see Appendix A.2). | |||
* Decrypt CIPHERTEXT_2, see Section 5.3.2. | * Decrypt CIPHERTEXT_2, see Section 5.3.2, and discard padding, if | |||
present. | ||||
* Pass EAD_2 to the security application. | * Make ID_CRED_R and EAD_2 (if present) available to the application | |||
for authentication- and EAD processing. | ||||
* Verify that the identity of the Responder is an allowed identity | * Obtain the authentication credential (CRED_R) and the | |||
for this connection, see Section 3.5.1. | authentication key of R from the application (or by other means). | |||
* Verify Signature_or_MAC_2 using the algorithm in the selected | * Verify Signature_or_MAC_2 using the algorithm in the selected | |||
cipher suite. The verification process depends on the method, see | cipher suite. The verification process depends on the method, see | |||
Section 5.3.2. | Section 5.3.2. | |||
If any processing step fails, the Initiator SHOULD send an EDHOC | If any processing step fails, the Responder MUST send an EDHOC error | |||
error message back, formatted as defined in Section 6. Sending error | message back, formatted as defined in Section 6, and the session MUST | |||
messages is essential for debugging but MAY e.g., be skipped if a | be discontinued. | |||
session cannot be found or due to denial-of-service reasons, see | ||||
Section 8.6. If an error message is sent, the session MUST be | ||||
discontinued. | ||||
5.4. EDHOC Message 3 | 5.4. EDHOC Message 3 | |||
5.4.1. Formatting of Message 3 | 5.4.1. Formatting of Message 3 | |||
message_3 SHALL be a CBOR Sequence (see Appendix C.1) as defined | message_3 SHALL be a CBOR Sequence (see Appendix C.1) as defined | |||
below | below | |||
message_3 = ( | message_3 = ( | |||
CIPHERTEXT_3 : bstr, | CIPHERTEXT_3 : bstr, | |||
) | ) | |||
5.4.2. Initiator Processing of Message 3 | 5.4.2. Initiator Processing of Message 3 | |||
skipping to change at page 32, line 38 ¶ | skipping to change at page 33, line 17 ¶ | |||
below | below | |||
message_3 = ( | message_3 = ( | |||
CIPHERTEXT_3 : bstr, | CIPHERTEXT_3 : bstr, | |||
) | ) | |||
5.4.2. Initiator Processing of Message 3 | 5.4.2. Initiator Processing of Message 3 | |||
The Initiator SHALL compose message_3 as follows: | The Initiator SHALL compose message_3 as follows: | |||
* Compute the transcript hash TH_3 = H(TH_2, CIPHERTEXT_2) where H() | * Compute the transcript hash TH_3 = H(TH_2, PLAINTEXT_2) where H() | |||
is the hash function in the selected cipher suite. The transcript | is the EDHOC hash algorithm of the selected cipher suite. The | |||
hash TH_3 is a CBOR encoded bstr and the input to the hash | transcript hash TH_3 is a CBOR encoded bstr and the input to the | |||
function is a CBOR Sequence. Note that H(TH_2, CIPHERTEXT_2) can | hash function is a CBOR Sequence. Note that H(TH_2, PLAINTEXT_2) | |||
be computed and cached already in the processing of message_2. | can be computed and cached already in the processing of message_2. | |||
* Compute MAC_3 = EDHOC-KDF( PRK_4x3m, TH_3, "MAC_3", << ID_CRED_I, | * Compute MAC_3 as in Section 4.1.2, with context_3 = << ID_CRED_I, | |||
CRED_I, ? EAD_3 >>, mac_length_3 ). If the Initiator | TH_3, CRED_I, ? EAD_3 >> | |||
authenticates with a static Diffie-Hellman key (method equals 2 or | ||||
3), then mac_length_3 is the EDHOC MAC length given by the | ||||
selected cipher suite. If the Initiator authenticates with a | ||||
signature key (method equals 0 or 1), then mac_length_3 is equal | ||||
to the output size of the EDHOC hash algorithm given by the | ||||
selected cipher suite. | ||||
- ID_CRED_I - identifier to facilitate retrieval of CRED_I, see | - If the Initiator authenticates with a static Diffie-Hellman key | |||
Section 3.5.4 | (method equals 2 or 3), then mac_length_3 is the EDHOC MAC | |||
length given by the selected cipher suite. If the Initiator | ||||
authenticates with a signature key (method equals 0 or 1), then | ||||
mac_length_3 is equal to the output size of the EDHOC hash | ||||
algorithm given by the selected cipher suite. | ||||
- CRED_I - CBOR item containing the credential of the Initiator, | - ID_CRED_I - identifier to facilitate the retrieval of CRED_I, | |||
see Section 3.5.3 | see Section 3.5.3 | |||
- EAD_3 - protected external authorization data, see Section 3.8 | - CRED_I - CBOR item containing the authentication credential of | |||
the Initiator, see Section 3.5.2 | ||||
- EAD_3 - external authorization data, see Section 3.8 | ||||
* If the Initiator authenticates with a static Diffie-Hellman key | * 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 | (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 | Initiator authenticates with a signature key (method equals 0 or | |||
1), then Signature_or_MAC_3 is the 'signature' field of a | 1), then Signature_or_MAC_3 is the 'signature' field of a | |||
COSE_Sign1 object as defined in Section 4.4 of | COSE_Sign1 object, computed as specified in Section 4.4 of | |||
[I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm of | [I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm of | |||
the selected cipher suite, the private authentication key of the | the selected cipher suite, the private authentication key of the | |||
Initiator, and the following parameters as input (see | Initiator, and the following parameters as input (see | |||
Appendix C.3): | Appendix C.3): | |||
- protected = << ID_CRED_I >> | - protected = << ID_CRED_I >> | |||
- external_aad = << TH_3, CRED_I, ? EAD_3 >> | - external_aad = << TH_3, CRED_I, ? EAD_3 >> | |||
- payload = MAC_3 | - payload = MAC_3 | |||
* Compute a COSE_Encrypt0 object as defined in Section 5.3 of | * Compute a COSE_Encrypt0 object as defined in Sections 5.2 and 5.3 | |||
[I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm | of [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD | |||
of the selected cipher suite, using the encryption key K_3, the | algorithm of the selected cipher suite, using the encryption key | |||
initialization vector IV_3, the plaintext P, and the following | 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): | parameters as input (see Appendix C.3): | |||
- protected = h'' | - protected = h'' | |||
- external_aad = TH_3 | - external_aad = TH_3 | |||
where | - K_3 and IV_3 are defined in Section 4.1.2, with | |||
- K_3 = EDHOC-KDF( PRK_3e2m, TH_3, "K_3", h'', key_length ) | ||||
o key_length - length of the encryption key of the EDHOC AEAD | o key_length - length of the encryption key of the EDHOC AEAD | |||
algorithm | algorithm | |||
- IV_3 = EDHOC-KDF( PRK_3e2m, TH_3, "IV_3", h'', iv_length ) | o iv_length - length of the initialization vector of the EDHOC | |||
o iv_length - length of the intialization vector of the EDHOC | ||||
AEAD algorithm | AEAD algorithm | |||
- P = ( ID_CRED_I / bstr / int, Signature_or_MAC_3, ? EAD_3 ) | - PLAINTEXT_3 = ( ? PAD, ID_CRED_I / bstr / -24..23, | |||
Signature_or_MAC_3, ? EAD_3 ) | ||||
o If ID_CRED_I contains a single 'kid' parameter, i.e., | o If ID_CRED_I contains a single 'kid' parameter, i.e., | |||
ID_CRED_I = { 4 : kid_I }, only the byte string or integer | ID_CRED_I = { 4 : kid_I }, then only the byte string kid_I | |||
kid_I is conveyed in the plaintext encoded accordingly as | is conveyed in the plaintext, represented as described in | |||
bstr or int. | Section 3.3.2. | |||
o PAD = 1*true is padding that may be used to hide the length | ||||
of the unpadded plaintext | ||||
CIPHERTEXT_3 is the 'ciphertext' of COSE_Encrypt0. | CIPHERTEXT_3 is the 'ciphertext' of COSE_Encrypt0. | |||
* Compute the transcript hash TH_4 = H(TH_3, PLAINTEXT_3) where H() | ||||
is the EDHOC hash algorithm of the selected cipher suite. The | ||||
transcript hash TH_4 is a CBOR encoded bstr and the input to the | ||||
hash function is a CBOR Sequence. | ||||
* Calculate PRK_out as defined in Figure 7. 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 | * Encode message_3 as a CBOR data item as specified in | |||
Section 5.4.1. | Section 5.4.1. | |||
Pass the connection identifiers (C_I, C_R) and the application | * Make the connection identifiers (C_I, C_R) and the application | |||
algorithms in the selected cipher suite to the application. The | algorithms in the selected cipher suite available to the | |||
application can now derive application keys using the EDHOC-Exporter | application. | |||
interface, see Section 4.3. | ||||
After sending message_3, the Initiator is assured that no other party | The Initiator SHOULD NOT persistently store PRK_out or application | |||
than the Responder can compute the key PRK_4x3m (implicit key | keys until the Initiator has verified message_4 or a message | |||
authentication). The Initiator can securely derive application keys | protected with a derived application key, such as an OSCORE message, | |||
and send protected application data. However, the Initiator does not | from the Responder. This is similar to waiting for acknowledgement | |||
know that the Responder has actually computed the key PRK_4x3m and | (ACK) in a transport protocol. | |||
therefore the Initiator SHOULD NOT permanently store the keying | ||||
material PRK_4x3m and TH_4, or derived application keys, until the | ||||
Initiator is assured that the Responder has actually computed the key | ||||
PRK_4x3m (explicit key confirmation). This is similar to waiting for | ||||
acknowledgement (ACK) in a transport protocol. Explicit key | ||||
confirmation is e.g., assured when the Initiator has verified an | ||||
OSCORE message or message_4 from the Responder. | ||||
5.4.3. Responder Processing of Message 3 | 5.4.3. Responder Processing of Message 3 | |||
The Responder SHALL process message_3 as follows: | The Responder SHALL process message_3 as follows: | |||
* Decode message_3 (see Appendix C.1). | * Decode message_3 (see Appendix C.1). | |||
* Retrieve the protocol state using the message correlation provided | * Retrieve the protocol state using the message correlation provided | |||
by the transport (e.g., the CoAP Token, the 5-tuple, or the | by the transport (e.g., the CoAP Token, the 5-tuple, or the | |||
prepended C_I, see Appendix A.3). | prepended C_R, see Appendix A.2). | |||
* Decrypt and verify the COSE_Encrypt0 as defined in Section 5.3 of | * Decrypt and verify the COSE_Encrypt0 as defined in Sections 5.2 | |||
[I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm | and 5.3 of [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD | |||
in the selected cipher suite, and the parameters defined in | algorithm in the selected cipher suite, and the parameters defined | |||
Section 5.4.2. | in Section 5.4.2. Discard padding, if present. | |||
* Pass EAD_3 to the security application. | * Make ID_CRED_I and EAD_3 (if present) available to the application | |||
for authentication- and EAD processing. | ||||
* Verify that the identity of the Initiator is an allowed identity | * Obtain the authentication credential (CRED_I) and the | |||
for this connection, see Section 3.5.1. | authentication key of I from the application (or by other means). | |||
* Verify Signature_or_MAC_3 using the algorithm in the selected | * Verify Signature_or_MAC_3 using the algorithm in the selected | |||
cipher suite. The verification process depends on the method, see | cipher suite. The verification process depends on the method, see | |||
Section 5.4.2. | Section 5.4.2. | |||
* Pass the connection identifiers (C_I, C_R), and the application | * Make the connection identifiers (C_I, C_R) and the application | |||
algorithms in the selected cipher suite to the security | algorithms in the selected cipher suite available to the | |||
application. The application can now derive application keys | application. | |||
using the EDHOC-Exporter interface. | ||||
If any processing step fails, the Responder SHOULD send an EDHOC | After verifying message_3, the Responder can compute PRK_out, see | |||
error message back, formatted as defined in Section 6. Sending error | Section 4.1.3, derive application keys using the EDHOC-Exporter | |||
messages is essential for debugging but MAY e.g., be skipped if a | interface, see Section 4.2.1, persistently store the keying material, | |||
session cannot be found or due to denial-of-service reasons, see | and send protected application data. | |||
Section 8.6. If an error message is sent, the session MUST be | ||||
discontinued. | ||||
After verifying message_3, the Responder is assured that the | If any processing step fails, the Responder MUST send an EDHOC error | |||
Initiator has calculated the key PRK_4x3m (explicit key confirmation) | message back, formatted as defined in Section 6, and the session MUST | |||
and that no other party than the Responder can compute the key. The | be discontinued. | |||
Responder can securely send protected application data and store the | ||||
keying material PRK_4x3m and TH_4. | ||||
5.5. EDHOC Message 4 | 5.5. EDHOC Message 4 | |||
This section specifies message_4 which is OPTIONAL to support. Key | This section specifies message_4 which is OPTIONAL to support. Key | |||
confirmation is normally provided by sending an application message | confirmation is normally provided by sending an application message | |||
from the Responder to the Initiator protected with a key derived with | from the Responder to the Initiator protected with a key derived with | |||
the EDHOC-Exporter, e.g., using OSCORE (see Appendix A). In | the EDHOC-Exporter, e.g., using OSCORE (see Appendix A). In | |||
deployments where no protected application message is sent from the | deployments where no protected application message is sent from the | |||
Responder to the Initiator, the Responder MUST send message_4. Two | Responder to the Initiator, message_4 MUST be supported and MUST be | |||
examples of such deployments: | used. Two examples of such deployments: | |||
1. When EDHOC is only used for authentication and no application | 1. When EDHOC is only used for authentication and no application | |||
data is sent. | data is sent. | |||
2. When application data is only sent from the Initiator to the | 2. When application data is only sent from the Initiator to the | |||
Responder. | Responder. | |||
Further considerations about when to use message_4 are provided in | Further considerations about when to use message_4 are provided in | |||
Section 3.9 and Section 8.1. | Section 3.9 and Section 8.1. | |||
skipping to change at page 36, line 4 ¶ | skipping to change at page 36, line 28 ¶ | |||
2. When application data is only sent from the Initiator to the | 2. When application data is only sent from the Initiator to the | |||
Responder. | Responder. | |||
Further considerations about when to use message_4 are provided in | Further considerations about when to use message_4 are provided in | |||
Section 3.9 and Section 8.1. | Section 3.9 and Section 8.1. | |||
5.5.1. Formatting of Message 4 | 5.5.1. Formatting of Message 4 | |||
message_4 SHALL be a CBOR Sequence (see Appendix C.1) as defined | message_4 SHALL be a CBOR Sequence (see Appendix C.1) as defined | |||
below | below | |||
message_4 = ( | message_4 = ( | |||
CIPHERTEXT_4 : bstr, | CIPHERTEXT_4 : bstr, | |||
) | ) | |||
5.5.2. Responder Processing of Message 4 | 5.5.2. Responder Processing of Message 4 | |||
The Responder SHALL compose message_4 as follows: | The Responder SHALL compose message_4 as follows: | |||
* Compute a COSE_Encrypt0 as defined in Section 5.3 of | * Compute a COSE_Encrypt0 as defined in Sections 5.2 and 5.3 of | |||
[I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm | [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm | |||
of the selected cipher suite, using the encryption key K_4, the | of the selected cipher suite, using the encryption key K_4, the | |||
initialization vector IV_4, the plaintext P, and the following | initialization vector IV_4 (if used by the AEAD algorithm), the | |||
parameters as input (see Appendix C.3): | plaintext PLAINTEXT_4, and the following parameters as input (see | |||
Appendix C.3): | ||||
- protected = h'' | - protected = h'' | |||
- external_aad = TH_4 | - external_aad = TH_4 | |||
where | - K_4 and IV_4 are defined in Section 4.1.2, with | |||
- K_4 = EDHOC-Exporter( "EDHOC_K_4", h'', key_length ) | ||||
o key_length - length of the encryption key of the EDHOC AEAD | o key_length - length of the encryption key of the EDHOC AEAD | |||
algorithm | algorithm | |||
- IV_4 = EDHOC-Exporter( "EDHOC_IV_4", h'', iv_length ) | o iv_length - length of the initialization vector of the EDHOC | |||
o iv_length - length of the intialization vector of the EDHOC | ||||
AEAD algorithm | AEAD algorithm | |||
- P = ( ? EAD_4 ) | - PLAINTEXT_4 = ( ? PAD, ? EAD_4 ) | |||
o EAD_4 - protected external authorization data, see | o PAD = 1*true is padding that may be used to hide the length | |||
Section 3.8. | of the unpadded plaintext. | |||
o EAD_4 - external authorization data, see Section 3.8. | ||||
CIPHERTEXT_4 is the 'ciphertext' of COSE_Encrypt0. | CIPHERTEXT_4 is the 'ciphertext' of COSE_Encrypt0. | |||
* Encode message_4 as a CBOR data item as specified in | * Encode message_4 as a CBOR data item as specified in | |||
Section 5.5.1. | Section 5.5.1. | |||
5.5.3. Initiator Processing of Message 4 | 5.5.3. Initiator Processing of Message 4 | |||
The Initiator SHALL process message_4 as follows: | The Initiator SHALL process message_4 as follows: | |||
* Decode message_4 (see Appendix C.1). | * Decode message_4 (see Appendix C.1). | |||
* Retrieve the protocol state using the message correlation provided | * Retrieve the protocol state using the message correlation provided | |||
by the transport (e.g., the CoAP Token, the 5-tuple, or the | by the transport (e.g., the CoAP Token, the 5-tuple, or the | |||
prepended C_I, see Appendix A.3). | prepended C_I, see Appendix A.2). | |||
* Decrypt and verify the COSE_Encrypt0 as defined in Section 5.3 of | * Decrypt and verify the COSE_Encrypt0 as defined in Sections 5.2 | |||
[I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm | and 5.3 of [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD | |||
in the selected cipher suite, and the parameters defined in | algorithm in the selected cipher suite, and the parameters defined | |||
Section 5.5.2. | in Section 5.5.2. Discard padding, if present. | |||
* Pass EAD_4 to the security application. | * Make EAD_4 (if present) available to the application for EAD | |||
processing. | ||||
If any processing step fails, the Responder SHOULD send an EDHOC | If any processing step fails, the Responder MUST send an EDHOC error | |||
error message back, formatted as defined in Section 6. Sending error | message back, formatted as defined in Section 6, and the session MUST | |||
messages is essential for debugging but MAY e.g., be skipped if a | be discontinued. | |||
session cannot be found or due to denial-of-service reasons, see | ||||
Section 8.6. If an error message is sent, the session MUST be | After verifying message_4, the Initiator is assured that the | |||
discontinued. | Responder has calculated the key PRK_out (key confirmation) and that | |||
no other party can derive the key. | ||||
6. Error Handling | 6. Error Handling | |||
This section defines the format for error messages. | This section defines the format for error messages, and the | |||
processing associated to the currently defined error codes. | ||||
Additional error codes may be registered, see Section 9.4. | ||||
There are many kinds of errors that can occur during EDHOC | ||||
processing. As in CoAP, an error can be triggered by errors in the | ||||
received message or internal errors in the recieving endpoint. | ||||
Except for processing and formatting errors, it is up to the | ||||
implementation when to send an error message. Sending error messages | ||||
is essential for debugging but MAY be skipped if, for example, a | ||||
session cannot be found or due to denial-of-service reasons, see | ||||
Section 8.7. Errors messages in EDHOC are always fatal. After | ||||
sending an error message, the sender MUST discontinue the protocol. | ||||
The receiver SHOULD treat an error message as an indication that the | ||||
other party likely has discontinued the protocol. But as the error | ||||
message is not authenticated, a received error message might also | ||||
have been sent by an attacker and the receiver MAY therefore try to | ||||
continue the protocol. | ||||
An EDHOC error message can be sent by either endpoint as a reply to | 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 | any non-error EDHOC message. How errors at the EDHOC layer are | |||
transported depends on lower layers, which need to enable error | transported depends on lower layers, which need to enable error | |||
messages to be sent and processed as intended. | messages to be sent and processed as intended. | |||
Errors in EDHOC are fatal. After sending an error message, the | ||||
sender MUST discontinue the protocol. The receiver SHOULD treat an | ||||
error message as an indication that the other party likely has | ||||
discontinued the protocol. But as the error message is not | ||||
authenticated, a received error message might also have been sent by | ||||
an attacker and the receiver MAY therefore try to continue the | ||||
protocol. | ||||
error SHALL be a CBOR Sequence (see Appendix C.1) as defined below | error SHALL be a CBOR Sequence (see Appendix C.1) as defined below | |||
error = ( | error = ( | |||
ERR_CODE : int, | ERR_CODE : int, | |||
ERR_INFO : any, | ERR_INFO : any, | |||
) | ) | |||
Figure 6: EDHOC Error Message | Figure 8: EDHOC error message. | |||
where: | where: | |||
* ERR_CODE - error code encoded as an integer. The value 0 is used | * ERR_CODE - error code encoded as an integer. The value 0 is used | |||
for success, all other values (negative or positive) indicate | for success, all other values (negative or positive) indicate | |||
errors. | errors. | |||
* ERR_INFO - error information. Content and encoding depend on | * ERR_INFO - error information. Content and encoding depend on | |||
error code. | error code. | |||
The remainder of this section specifies the currently defined error | The remainder of this section specifies the currently defined error | |||
codes, see Figure 7. Additional error codes and corresponding error | codes, see Figure 9. Additional error codes and corresponding error | |||
information may be specified. | information may be specified. | |||
+----------+---------------+----------------------------------------+ | +----------+---------------+----------------------------------------+ | |||
| ERR_CODE | ERR_INFO Type | Description | | | ERR_CODE | ERR_INFO Type | Description | | |||
+==========+===============+========================================+ | +==========+===============+========================================+ | |||
| 0 | any | Success | | | 0 | any | Success | | |||
+----------+---------------+----------------------------------------+ | +----------+---------------+----------------------------------------+ | |||
| 1 | tstr | Unspecified | | | 1 | tstr | Unspecified error | | |||
+----------+---------------+----------------------------------------+ | +----------+---------------+----------------------------------------+ | |||
| 2 | suites | Wrong selected cipher suite | | | 2 | suites | Wrong selected cipher suite | | |||
+----------+---------------+----------------------------------------+ | +----------+---------------+----------------------------------------+ | |||
Figure 7: Error Codes and Error Information | Figure 9: Error codes and error information included in the EDHOC | |||
error message. | ||||
6.1. Success | 6.1. Success | |||
Error code 0 MAY be used internally in an application to indicate | Error code 0 MAY be used internally in an application to indicate | |||
success, e.g., in log files. ERR_INFO can contain any type of CBOR | success, i.e., as a standard value in case of no error, e.g., in | |||
item. Error code 0 MUST NOT be used as part of the EDHOC message | status reporting or log files. ERR_INFO can contain any type of CBOR | |||
exchange flow. | item, the content is out of scope for this specification. Error code | |||
0 MUST NOT be used as part of the EDHOC message exchange flow. If an | ||||
endpoint receives an error message with error code 0, then it MUST | ||||
discontinue the protocol and MUST NOT send an error message. | ||||
6.2. Unspecified | 6.2. Unspecified Error | |||
Error code 1 is used for errors that do not have a specific error | Error code 1 is used for errors that do not have a specific error | |||
code defined. ERR_INFO MUST be a text string containing a human- | code defined. ERR_INFO MUST be a text string containing a human- | |||
readable diagnostic message written in English. The diagnostic text | readable diagnostic message written in English, for example "Method | |||
message is mainly intended for software engineers that during | not supported". The diagnostic text message is mainly intended for | |||
debugging need to interpret it in the context of the EDHOC | software engineers that during debugging need to interpret it in the | |||
specification. The diagnostic message SHOULD be provided to the | context of the EDHOC specification. The diagnostic message SHOULD be | |||
calling application where it SHOULD be logged. | provided to the calling application where it SHOULD be logged. | |||
6.3. Wrong Selected Cipher Suite | 6.3. Wrong Selected Cipher Suite | |||
Error code 2 MUST only be used in a response to message_1 in case the | Error code 2 MUST only be used when replying to message_1 in case the | |||
cipher suite selected by the Initiator is not supported by the | cipher suite selected by the Initiator is not supported by the | |||
Responder, or if the Responder supports a cipher suite more preferred | Responder, or if the Responder supports a cipher suite more preferred | |||
by the Initiator than the selected cipher suite, see Section 5.2.3. | by the Initiator than the selected cipher suite, see Section 5.2.3. | |||
ERR_INFO is in this case denoted SUITES_R and is of type suites, see | ERR_INFO is in this case denoted SUITES_R and is of type suites, see | |||
Section 5.2.1. If the Responder does not support the selected cipher | Section 5.2.1. If the Responder does not support the selected cipher | |||
suite, then SUITES_R MUST include one or more supported cipher | suite, then SUITES_R MUST include one or more supported cipher | |||
suites. If the Responder supports a cipher suite in SUITES_I other | suites. If the Responder supports a cipher suite in SUITES_I other | |||
than the selected cipher suite (independently of if the selected | than the selected cipher suite (independently of if the selected | |||
cipher suite is supported or not) then SUITES_R MUST include the | cipher suite is supported or not) then SUITES_R MUST include the | |||
supported cipher suite in SUITES_I which is most preferred by the | supported cipher suite in SUITES_I which is most preferred by the | |||
Initiator. SUITES_R MAY include a single cipher suite, i.e., be | Initiator. SUITES_R MAY include a single cipher suite, i.e., be | |||
encoded as an int. If the Responder does not support any cipher | encoded as an int. If the Responder does not support any cipher | |||
suite in SUITES_I, then it SHOULD include all its supported cipher | suite in SUITES_I, then it SHOULD include all its supported cipher | |||
suites in SUITES_R in any order. | suites in SUITES_R. | |||
In contrast to SUITES_I, the order of the cipher suites in SUITES_R | ||||
has no significance. | ||||
6.3.1. Cipher Suite Negotiation | 6.3.1. Cipher Suite Negotiation | |||
After receiving SUITES_R, the Initiator can determine which cipher | After receiving SUITES_R, the Initiator can determine which cipher | |||
suite to select (if any) for the next EDHOC run with the Responder. | suite to select (if any) for the next EDHOC run with the Responder. | |||
If the Initiator intends to contact the Responder in the future, the | If the Initiator intends to contact the Responder in the future, the | |||
Initiator SHOULD remember which selected cipher suite to use until | Initiator SHOULD remember which selected cipher suite to use until | |||
the next message_1 has been sent, otherwise the Initiator and | the next message_1 has been sent, otherwise the Initiator and | |||
Responder will likely run into an infinite loop where the Initiator | Responder will likely run into an infinite loop where the Initiator | |||
selects its most preferred and the Responder sends an error with | selects its most preferred and the Responder sends an error with | |||
supported cipher suites. After a successful run of EDHOC, the | supported cipher suites. After a successful run of EDHOC, the | |||
Initiator MAY remember the selected cipher suite to use in future | Initiator MAY remember the selected cipher suite to use in future | |||
EDHOC sessions. Note that if the Initiator or Responder is updated | EDHOC sessions. Note that if the Initiator or Responder is updated | |||
with new cipher suite policies, any cached information may be | with new cipher suite policies, any cached information may be | |||
outdated. | outdated. | |||
Note that the Initiator's list of supported cipher suites and order | ||||
of preference is fixed (see Section 5.2.1 and Section 5.2.2). | ||||
Furthermore, the Responder SHALL only accept message_1 if the | ||||
selected cipher suite is the first cipher suite in SUITES_I that the | ||||
Responder supports (see Section 5.2.3). Following this procedure | ||||
ensures that the selected cipher suite is the most preferred (by the | ||||
Initiator) cipher suite supported by both parties. | ||||
If the selected cipher suite is not the first cipher suite which the | ||||
Responder supports in SUITES_I received in message_1, then the | ||||
Responder MUST discontinue the protocol, see Section 5.2.3. If | ||||
SUITES_I in message_1 is manipulated, then the integrity verification | ||||
of message_2 containing the transcript hash TH_2 will fail and the | ||||
Initiator will discontinue the protocol. | ||||
6.3.2. Examples | 6.3.2. Examples | |||
Assume that the Initiator supports the five cipher suites 5, 6, 7, 8, | 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 | and 9 in decreasing order of preference. Figures 10 and 11 show | |||
examples of how the Initiator can format SUITES_I and how SUITES_R is | examples of how the Initiator can format SUITES_I and how SUITES_R is | |||
used by Responders to give the Initiator information about the cipher | used by Responders to give the Initiator information about the cipher | |||
suites that the Responder supports. | suites that the Responder supports. | |||
In the first example (Figure 8), the Responder supports cipher suite | In the first example (Figure 10), the Responder supports cipher suite | |||
6 but not the initially selected cipher suite 5. | 6 but not the initially selected cipher suite 5. | |||
Initiator Responder | Initiator Responder | |||
| METHOD, SUITES_I = 5, G_X, C_I, EAD_1 | | | METHOD, SUITES_I = 5, G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
| | | | | | |||
| ERR_CODE = 2, SUITES_R = 6 | | | ERR_CODE = 2, SUITES_R = 6 | | |||
|<------------------------------------------------------------------+ | |<------------------------------------------------------------------+ | |||
| error | | | error | | |||
| | | | | | |||
| METHOD, SUITES_I = [5, 6], G_X, C_I, EAD_1 | | | METHOD, SUITES_I = [5, 6], G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
Figure 8: Example of Responder supporting suite 6 but not suite 5. | Figure 10: Example of an Initiator supporting suites 5, 6, 7, 8, | |||
and 9 in decreasing order of preference, and a Responder | ||||
supporting suite 6 but not suite 5. The Responder rejects the | ||||
first message_1 with an error indicating support for suite 6. | ||||
The Initiator also supports suite 6, and therefore selects suite | ||||
6 in the second message_1. The initiator prepends in SUITES_I | ||||
the selected suite 6 with the more preferred suites, in this case | ||||
suite 5, to mitigate a potential attack on the cipher suite | ||||
negotiation. | ||||
In the second example (Figure 9), the Responder supports cipher | In the second example (Figure 11), the Responder supports cipher | |||
suites 8 and 9 but not the more preferred (by the Initiator) 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 | 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 | Initiator first make a guess that the Responder supports suite 6 but | |||
not suite 5. Since the Responder supports neither 5 nor 6, it | not suite 5. Since the Responder supports neither 5 nor 6, it | |||
responds with SUITES_R containing the supported suites, after which | responds with SUITES_R containing the supported suites, after which | |||
the Initiator selects its most preferred supported suite. The order | the Initiator selects its most preferred supported suite. (If the | |||
of cipher suites in SUITES_R does not matter. (If the Responder had | Responder had supported suite 5, it would have included it in | |||
supported suite 5, it would have included it in SUITES_R of the | SUITES_R of the response, and it would in that case have become the | |||
response, and it would in that case have become the selected suite in | selected suite in the second message_1.) | |||
the second message_1.) | ||||
Initiator Responder | Initiator Responder | |||
| METHOD, SUITES_I = [5, 6], G_X, C_I, EAD_1 | | | METHOD, SUITES_I = [5, 6], G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
| | | | | | |||
| ERR_CODE = 2, SUITES_R = [9, 8] | | | ERR_CODE = 2, SUITES_R = [9, 8] | | |||
|<------------------------------------------------------------------+ | |<------------------------------------------------------------------+ | |||
| error | | | error | | |||
| | | | | | |||
| METHOD, SUITES_I = [5, 6, 7, 8], G_X, C_I, EAD_1 | | | METHOD, SUITES_I = [5, 6, 7, 8], G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
Figure 11: Example of an Initiator supporting suites 5, 6, 7, 8, | ||||
and 9 in decreasing order of preference, and a Responder | ||||
supporting suites 8 and 9 but not 5, 6 or 7. The Responder | ||||
rejects the first message_1 with an error indicating support for | ||||
suites 8 and 9 (in any order). The Initiator also supports | ||||
suites 8 and 9, and prefers suite 8, so therefore selects suite 8 | ||||
in the second message_1. The initiator prepends in SUITES_I the | ||||
selected suite 8 with the more preferred suites in order of | ||||
preference, in this case suites 5, 6 and 7, to mitigate a | ||||
potential attack on the cipher suite negotiation. | ||||
Figure 9: Example of Responder supporting suites 8 and 9 but not | 7. Compliance Requirements | |||
5, 6 or 7. | ||||
Note that the Initiator's list of supported cipher suites and order | ||||
of preference is fixed (see Section 5.2.1 and Section 5.2.2). | ||||
Furthermore, the Responder shall only accept message_1 if the | ||||
selected cipher suite is the first cipher suite in SUITES_I that the | ||||
Responder supports (see Section 5.2.3). Following this procedure | ||||
ensures that the selected cipher suite is the most preferred (by the | ||||
Initiator) cipher suite supported by both parties. | ||||
If the selected cipher suite is not the first cipher suite which the | ||||
Responder supports in SUITES_I received in message_1, then Responder | ||||
MUST discontinue the protocol, see Section 5.2.3. If SUITES_I in | ||||
message_1 is manipulated, then the integrity verification of | ||||
message_2 containing the transcript hash TH_2 will fail and the | ||||
Initiator will discontinue the protocol. | ||||
7. Mandatory-to-Implement Compliance Requirements | In the absence of an application profile specifying otherwise: | |||
An implementation may support only Initiator or only Responder. | An implementation MAY support only Initiator or only Responder. | |||
An implementation may support only a single method. None of the | An implementation MAY support only a single method. None of the | |||
methods are mandatory-to-implement. | methods are mandatory-to-implement. | |||
Implementations MUST support 'kid' parameters of type int. None of | Implementations MUST support 'kid' parameters. None of the other | |||
the other COSE header parameters are mandatory-to-implement. | COSE header parameters are mandatory-to-implement. | |||
An implementation may support only a single credential type (CCS, | An implementation MAY support only a single credential type (CCS, | |||
CWT, X.509, C509). None of the credential types are mandatory-to- | CWT, X.509, C509). None of the credential types are mandatory-to- | |||
implement. | implement. | |||
Implementations MUST support the EDHOC-Exporter. Implementations | Implementations MUST support the EDHOC-Exporter. Implementations | |||
SHOULD support EDHOC-KeyUpdate. | SHOULD support EDHOC-KeyUpdate. | |||
Implementations MAY support message_4. Error codes 1 and 2 MUST be | Implementations MAY support message_4. Error codes (ERR_CODE) 1 and | |||
supported. | 2 MUST be supported. | |||
Implementations MAY support EAD. | Implementations MAY support EAD. | |||
For many constrained IoT devices it is problematic to support more | Implementations MAY support padding of plaintext when sending | |||
than one cipher suite. Existing devices can be expected to support | messages. Implementations MUST support padding of plaintext when | |||
either ECDSA or EdDSA. To enable as much interoperability as we can | receiving messages, i.e. MUST be able to parse padded messages. | |||
reasonably achieve, less constrained devices SHOULD implement both | ||||
cipher suite 0 (AES-CCM-16-64-128, SHA-256, 8, X25519, EdDSA, AES- | Implementations MUST support cipher suite 2 and 3. Cipher suites 2 | |||
CCM-16-64-128, SHA-256) and cipher suite 2 (AES-CCM-16-64-128, SHA- | (AES-CCM-16-64-128, SHA-256, 8, P-256, ES256, AES-CCM-16-64-128, SHA- | |||
256, 8, P-256, ES256, AES-CCM-16-64-128, SHA-256). Constrained | 256) and 3 (AES-CCM-16-128-128, SHA-256, 16, P-256, ES256, AES-CCM- | |||
endpoints SHOULD implement cipher suite 0 or cipher suite 2. | 16-64-128, SHA-256) only differ in size of the MAC length, so | |||
supporting one or both of these is no essential difference. | ||||
Implementations only need to implement the algorithms needed for | Implementations only need to implement the algorithms needed for | |||
their supported methods. | their supported methods. | |||
8. Security Considerations | 8. Security Considerations | |||
8.1. Security Properties | 8.1. Security Properties | |||
EDHOC inherits its security properties from the theoretical SIGMA-I | EDHOC inherits its security properties from the theoretical SIGMA-I | |||
protocol [SIGMA]. Using the terminology from [SIGMA], EDHOC provides | protocol [SIGMA]. Using the terminology from [SIGMA], EDHOC provides | |||
forward secrecy, mutual authentication with aliveness, consistency, | forward secrecy, mutual authentication with aliveness, consistency, | |||
and peer awareness. As described in [SIGMA], peer awareness is | and peer awareness. As described in [SIGMA], peer awareness is | |||
provided to the Responder, but not to the Initiator. | provided to the Responder, but not to the Initiator. | |||
As described in [SIGMA], different levels of identity protection is | As described in [SIGMA], different levels of identity protection are | |||
provided to the Initiator and the Responder. EDHOC protects the | provided to the Initiator and the Responder. EDHOC protects the | |||
credential identifier of the Initiator against active attacks and the | credential identifier of the Initiator against active attacks and the | |||
credential identifier of the Responder against passive attacks. The | credential identifier of the Responder against passive attacks. An | |||
roles should be assigned to protect the most sensitive identity/ | active attacker can get the credential identifier of the Responder by | |||
identifier, typically that which is not possible to infer from | eavesdropping on the destination address used for transporting | |||
routing information in the lower layers. | message_1 and send its own message_1 to the same address. The roles | |||
should be assigned to protect the most sensitive identity/identifier, | ||||
typically that which is not possible to infer from routing | ||||
information in the lower layers. | ||||
Compared to [SIGMA], EDHOC adds an explicit method type and expands | Compared to [SIGMA], EDHOC adds an explicit method type and expands | |||
the message authentication coverage to additional elements such as | the message authentication coverage to additional elements such as | |||
algorithms, external authorization data, and previous messages. This | algorithms, external authorization data, and previous messages. This | |||
protects against an attacker replaying messages or injecting messages | protects against an attacker replaying messages or injecting messages | |||
from another session. | from another session. | |||
EDHOC also adds selection of connection identifiers and downgrade | EDHOC also adds selection of connection identifiers and downgrade | |||
protected negotiation of cryptographic parameters, i.e., an attacker | protected negotiation of cryptographic parameters, i.e., an attacker | |||
cannot affect the negotiated parameters. A single session of EDHOC | cannot affect the negotiated parameters. A single session of EDHOC | |||
skipping to change at page 43, line 27 ¶ | skipping to change at page 44, line 30 ¶ | |||
Compromise of the long-term keys (private signature or static DH | Compromise of the long-term keys (private signature or static DH | |||
keys) does not compromise the security of completed EDHOC exchanges. | keys) does not compromise the security of completed EDHOC exchanges. | |||
Compromising the private authentication keys of one party lets an | Compromising the private authentication keys of one party lets an | |||
active attacker impersonate that compromised party in EDHOC exchanges | active attacker impersonate that compromised party in EDHOC exchanges | |||
with other parties but does not let the attacker impersonate other | with other parties but does not let the attacker impersonate other | |||
parties in EDHOC exchanges with the compromised party. Compromise of | parties in EDHOC exchanges with the compromised party. Compromise of | |||
the long-term keys does not enable a passive attacker to compromise | the long-term keys does not enable a passive attacker to compromise | |||
future session keys. Compromise of the HDKF input parameters (ECDH | future session keys. Compromise of the HDKF input parameters (ECDH | |||
shared secret) leads to compromise of all session keys derived from | shared secret) leads to compromise of all session keys derived from | |||
that compromised shared secret. Compromise of one session key does | that compromised shared secret. Compromise of one session key does | |||
not compromise other session keys. Compromise of PRK_4x3m leads to | not compromise other session keys. Compromise of PRK_out leads to | |||
compromise of all exported keying material derived after the last | compromise of all keying material derived with the EDHOC-Exporter | |||
invocation of the EDHOC-KeyUpdate function. | since the last invocation (if any) of the EDHOC-KeyUpdate function. | |||
EDHOC provides a minimum of 64-bit security against online brute | Based on the cryptographic algorithms requirements Section 8.3, EDHOC | |||
force attacks and a minimum of 128-bit security against offline brute | provides a minimum of 64-bit security against online brute force | |||
force attacks. This is in line with IPsec, TLS, and COSE. To break | attacks and a minimum of 128-bit security against offline brute force | |||
64-bit security against online brute force an attacker would on | attacks. To break 64-bit security against online brute force an | |||
average have to send 4.3 billion messages per second for 68 years, | attacker would on average have to send 4.3 billion messages per | |||
which is infeasible in constrained IoT radio technologies. | 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. | ||||
After sending message_3, the Initiator is assured that no other party | After sending message_3, the Initiator is assured that no other party | |||
than the Responder can compute the key PRK_4x3m (implicit key | than the Responder can compute the key PRK_out. While the Initiator | |||
authentication). The Initiator does however not know that the | can securely send protected application data, the Initiator SHOULD | |||
Responder has actually computed the key PRK_4x3m. While the | NOT persistently store the keying material PRK_out until the | |||
Initiator can securely send protected application data, the Initiator | Initiator has verified an OSCORE message or message_4 from the | |||
SHOULD NOT permanently store the keying material PRK_4x3m and TH_4 | Responder. After verifying message_3, the Responder is assured that | |||
until the Initiator is assured that the Responder has actually | an honest Initiator has computed the key PRK_out. The Responder can | |||
computed the key PRK_4x3m (explicit key confirmation). Explicit key | securely derive and store the keying material PRK_out, and send | |||
confirmation is e.g., assured when the Initiator has verified an | protected application data. | |||
OSCORE message or message_4 from the Responder. After verifying | ||||
message_3, the Responder is assured that the Initiator has calculated | External authorization data sent in message_1 (EAD_1) or message_2 | |||
the key PRK_4x3m (explicit key confirmation) and that no other party | (EAD_2) should be considered unprotected by EDHOC, see Section 8.5. | |||
than the Responder can compute the key. The Responder can securely | EAD_2 is encrypted but the Responder has not yet authenticated the | |||
send protected application data and store the keying material | Initiator. External authorization data sent in message_3 (EAD_3) or | |||
PRK_4x3m and TH_4. | message_4 (EAD_4) is protected between Initiator and Responder by the | |||
protocol, but note that EAD fields may be used by the application | ||||
before the message verification is completed, see Section 3.8. | ||||
Designing a secure mechanism that uses EAD is not necessarily | ||||
straightforward. This document only provides the EAD transport | ||||
mechanism, but the problem of agreeing on the surrounding context and | ||||
the meaning of the information passed to and from the application | ||||
remains. Any new uses of EAD should be subject to careful review. | ||||
Key compromise impersonation (KCI): In EDHOC authenticated with | Key compromise impersonation (KCI): In EDHOC authenticated with | |||
signature keys, EDHOC provides KCI protection against an attacker | signature keys, EDHOC provides KCI protection against an attacker | |||
having access to the long-term key or the ephemeral secret key. With | having access to the long-term key or the ephemeral secret key. With | |||
static Diffie-Hellman key authentication, KCI protection would be | static Diffie-Hellman key authentication, KCI protection would be | |||
provided against an attacker having access to the long-term Diffie- | provided against an attacker having access to the long-term Diffie- | |||
Hellman key, but not to an attacker having access to the ephemeral | Hellman key, but not to an attacker having access to the ephemeral | |||
secret key. Note that the term KCI has typically been used for | 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 | compromise of long-term keys, and that an attacker with access to the | |||
ephemeral secret key can only attack that specific session. | ephemeral secret key can only attack that specific session. | |||
Repudiation: In EDHOC authenticated with signature keys, the | Repudiation: If an endpoint authenticates with a signature, the other | |||
Initiator could theoretically prove that the Responder performed a | endpoint can prove that the endpoint performed a run of the protocol | |||
run of the protocol by presenting the private ephemeral key, and vice | by presenting the data being signed as well as the signature itself. | |||
versa. Note that storing the private ephemeral keys violates the | With static Diffie-Hellman key authentication, the authenticating | |||
protocol requirements. With static Diffie-Hellman key | endpoint can deny having participated in the protocol. | |||
authentication, both parties can always deny having participated in | ||||
the protocol. | ||||
Two earlier versions of EDHOC have been formally analyzed [Norrman20] | Two earlier versions of EDHOC have been formally analyzed [Norrman20] | |||
[Bruni18] and the specification has been updated based on the | [Bruni18] and the specification has been updated based on the | |||
analysis. | analysis. | |||
8.2. Cryptographic Considerations | 8.2. Cryptographic Considerations | |||
The SIGMA protocol requires that the encryption of message_3 provides | The SIGMA protocol requires that the encryption of message_3 provides | |||
confidentiality against active attackers and EDHOC message_4 relies | confidentiality against active attackers and EDHOC message_4 relies | |||
on the use of authenticated encryption. Hence the message | on the use of authenticated encryption. Hence the message | |||
authenticating functionality of the authenticated encryption in EDHOC | authenticating functionality of the authenticated encryption in EDHOC | |||
is critical: authenticated encryption MUST NOT be replaced by plain | is critical: authenticated encryption MUST NOT be replaced by plain | |||
encryption only, even if authentication is provided at another level | encryption only, even if authentication is provided at another level | |||
or through a different mechanism. | or through a different mechanism. | |||
To reduce message overhead EDHOC does not use explicit nonces and | To reduce message overhead EDHOC does not use explicit nonces and | |||
instead rely on the ephemeral public keys to provide randomness to | instead relies on the ephemeral public keys to provide randomness to | |||
each session. A good amount of randomness is important for the key | each session. A good amount of randomness is important for the key | |||
generation, to provide liveness, and to protect against interleaving | generation, to provide liveness, and to protect against interleaving | |||
attacks. For this reason, the ephemeral keys MUST NOT be used in | attacks. For this reason, the ephemeral keys MUST NOT be used in | |||
more than one EDHOC message, and both parties SHALL generate fresh | more than one EDHOC message, and both parties SHALL generate fresh | |||
random ephemeral key pairs. Note that an ephemeral key may be used | random ephemeral key pairs. Note that an ephemeral key may be used | |||
to calculate several ECDH shared secrets. When static Diffie-Hellman | to calculate several ECDH shared secrets. When static Diffie-Hellman | |||
authentication is used the same ephemeral key is used in both | authentication is used the same ephemeral key is used in both | |||
ephemeral-ephemeral and ephemeral-static ECDH. | ephemeral-ephemeral and ephemeral-static ECDH. | |||
As discussed in [SIGMA], the encryption of message_2 does only need | As discussed in [SIGMA], the encryption of message_2 does only need | |||
to protect against passive attacker as active attackers can always | to protect against passive attacker as active attackers can always | |||
get the Responders identity by sending their own message_1. EDHOC | get the Responder's identity by sending their own message_1. EDHOC | |||
uses the Expand function (typically HKDF-Expand) as a binary additive | uses the Expand function (typically HKDF-Expand) as a binary additive | |||
stream cipher. HKDF-Expand provides better confidentiality than AES- | stream cipher which is proven secure as long as the expand function | |||
CTR but is not often used as it is slow on long messages, and most | is a PRF. HKDF-Expand is not often used as a stream cipher as it is | |||
applications require both IND-CCA confidentiality as well as | slow on long messages, and most applications require both IND-CCA | |||
integrity protection. For the encryption of message_2, any speed | confidentiality as well as integrity protection. For the encryption | |||
difference is negligible, IND-CCA does not increase security, and | of message_2, any speed difference is negligible, IND-CCA does not | |||
integrity is provided by the inner MAC (and signature depending on | increase security, and integrity is provided by the inner MAC (and | |||
method). | signature depending on method). | |||
Requirement for how to securely generate, validate, and process the | Requirements for how to securely generate, validate, and process the | |||
ephemeral public keys depend on the elliptic curve. For X25519 and | ephemeral public keys depend on the elliptic curve. For X25519 and | |||
X448, the requirements are defined in [RFC7748]. For secp256r1, | X448, the requirements are defined in [RFC7748]. For secp256r1, | |||
secp384r1, and secp521r1, the requirements are defined in Section 5 | secp384r1, and secp521r1, the requirements are defined in Section 5 | |||
of [SP-800-56A]. For secp256r1, secp384r1, and secp521r1, at least | of [SP-800-56A]. For secp256r1, secp384r1, and secp521r1, at least | |||
partial public-key validation MUST be done. | partial public-key validation MUST be done. | |||
As noted in Section 12 of [I-D.ietf-cose-rfc8152bis-struct] the use | ||||
of a single key for multiple algorithms is strongly disencouraged | ||||
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 secure shared | ||||
signature and ECDH key usage in [Degabriele11] and [Thormarker21]. | ||||
So-called selfie attacks are mitigated 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 on first use (TOFU) use cases | ||||
the Initiator should verify that the the Responder's identity is not | ||||
equal to its own. Any future EHDOC methods using e.g., pre-shared | ||||
keys might need to mitigate this in other ways. | ||||
8.3. Cipher Suites and Cryptographic Algorithms | 8.3. Cipher Suites and Cryptographic Algorithms | |||
When using private cipher suite or registering new cipher suites, the | When using private cipher suite or registering new cipher suites, the | |||
choice of key length used in the different algorithms needs to be | choice of key length used in the different algorithms needs to be | |||
harmonized, so that a sufficient security level is maintained for | harmonized, so that a sufficient security level is maintained for | |||
certificates, EDHOC, and the protection of application data. The | certificates, EDHOC, and the protection of application data. The | |||
Initiator and the Responder should enforce a minimum security level. | Initiator and the Responder should enforce a minimum security level. | |||
The hash algorithms SHA-1 and SHA-256/64 (SHA-256 truncated to | The output size of the EDHOC hash algorithm MUST be at least | |||
64-bits) SHALL NOT be supported for use in EDHOC except for | 256-bits, i.e., the hash algorithms SHA-1 and SHA-256/64 (SHA-256 | |||
certificate identification with x5t and c5t. Note that secp256k1 is | truncated to 64-bits) SHALL NOT be supported for use in EDHOC except | |||
only defined for use with ECDSA and not for ECDH. Note that some | for certificate identification with x5t and c5t. For security | |||
COSE algorithms are marked as not recommended in the COSE IANA | considerations of SHA-1, see [RFC6194]. As EDHOC integrity protects | |||
registry. | the whole authentication credential, the choice of hash algorithm in | |||
x5t and c5t does not affect security and it is RECOMMENDED to use the | ||||
same hash algorithm as in the cipher suite but with as much | ||||
truncation as possible, i.e, when the EDHOC hash algorithm is SHA-256 | ||||
it is RECOMMENDED to use SHA-256/64 in x5t and c5t. 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. | ||||
8.4. Post-Quantum Considerations | 8.4. Post-Quantum Considerations | |||
As of the publication of this specification, it is unclear when or | As of the publication of this specification, it is unclear when or | |||
even if a quantum computer of sufficient size and power to exploit | even if a quantum computer of sufficient size and power to exploit | |||
public key cryptography will exist. Deployments that need to | public key cryptography will exist. Deployments that need to | |||
consider risks decades into the future should transition to Post- | consider risks decades into the future should transition to Post- | |||
Quantum Cryptography (PQC) in the not-too-distant future. Many other | Quantum Cryptography (PQC) in the not-too-distant future. Many other | |||
systems should take a slower wait-and-see approach where PQC is | systems should take a slower wait-and-see approach where PQC is | |||
phased in when the quantum threat is more imminent. Current PQC | phased in when the quantum threat is more imminent. Current PQC | |||
skipping to change at page 46, line 31 ¶ | skipping to change at page 48, line 5 ¶ | |||
including PQC signature algorithms such as HSS-LMS. EDHOC is | including PQC signature algorithms such as HSS-LMS. EDHOC is | |||
currently only specified for use with key exchange algorithms of type | currently only specified for use with key exchange algorithms of type | |||
ECDH curves, but any Key Encapsulation Method (KEM), including PQC | 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 | KEMs, can be used in method 0. While the key exchange in method 0 is | |||
specified with terms of the Diffie-Hellman protocol, the key exchange | specified with terms of the Diffie-Hellman protocol, the key exchange | |||
adheres to a KEM interface: G_X is then the public key of the | adheres to a KEM interface: G_X is then the public key of the | |||
Initiator, G_Y is the encapsulation, and G_XY is the shared secret. | Initiator, G_Y is the encapsulation, and G_XY is the shared secret. | |||
Use of PQC KEMs to replace static DH authentication would likely | Use of PQC KEMs to replace static DH authentication would likely | |||
require a specification updating EDHOC with new methods. | require a specification updating EDHOC with new methods. | |||
8.5. Unprotected Data | 8.5. Unprotected Data and Privacy | |||
The Initiator and the Responder must make sure that unprotected data | The Initiator and the Responder must make sure that unprotected data | |||
and metadata do not reveal any sensitive information. This also | and metadata do not reveal any sensitive information. This also | |||
applies for encrypted data sent to an unauthenticated party. In | applies for encrypted data sent to an unauthenticated party. In | |||
particular, it applies to EAD_1, ID_CRED_R, EAD_2, and error | particular, it applies to EAD_1, ID_CRED_R, EAD_2, and error | |||
messages. Using the same EAD_1 in several EDHOC sessions allows | messages. Using the same EAD_1 in several EDHOC sessions allows | |||
passive eavesdroppers to correlate the different sessions. Another | passive eavesdroppers to correlate the different sessions. Another | |||
consideration is that the list of supported cipher suites may | consideration is that the list of supported cipher suites may | |||
potentially be used to identify the application. | potentially be used to identify the application. The Initiator and | |||
the Responder must also make sure that unauthenticated data does not | ||||
trigger any harmful actions. In particular, this applies to EAD_1 | ||||
and error messages. | ||||
The Initiator and the Responder must also make sure that | An attacker observing network traffic may use connection identifiers | |||
unauthenticated data does not trigger any harmful actions. In | sent in clear in EDHOC or the subsequent application protocol to | |||
particular, this applies to EAD_1 and error messages. | 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 identifier and MAY provide mechanisms to issue several | ||||
simultaneously active connection identifiers. See [RFC9000] for a | ||||
non-constrained example of such mechanisms. | ||||
8.6. Denial-of-Service | 8.6. Updated Internet Threat Model Considerations | |||
As CoAP provides Denial-of-Service protection in the form of the Echo | Since the publication of [RFC3552] there has been an increased | |||
option [RFC9175], EDHOC itself does not provide countermeasures | awareness of the need to protect against endpoints that are | |||
against Denial-of-Service attacks. By sending a number of new or | compromised, malicious, or whose interests simply do not align with | |||
the interests of users | ||||
[I-D.arkko-arch-internet-threat-model-guidance]. [RFC7624] describes | ||||
an updated threat model for Internet confidentiality, see | ||||
Section 8.1. [I-D.arkko-arch-internet-threat-model-guidance] further | ||||
expands the threat model. Implementations and users SHOULD consider | ||||
these threat models. In particular, even data sent protected to the | ||||
other endpoint such as ID_CRED and EAD can be used for tracking, see | ||||
Section 2.7 of [I-D.arkko-arch-internet-threat-model-guidance]. | ||||
The fields ID_CRED_I, ID_CRED_R, EAD_2, EAD_3, and EAD_4 have | ||||
variable length and information regarding the length may leak to an | ||||
attacker. An passive attacker may e.g., be able to differentiating | ||||
endpoints using identifiers of different length. To mitigate this | ||||
information leakage an inmplementation may ensure that the fields | ||||
have fixed length or use padding. An implementation may e.g., only | ||||
use fix length identifiers like 'kid' of length 1. Alternatively | ||||
padding may be used to hide the true length of e.g., certificates by | ||||
value in 'x5chain' or 'c5c'. | ||||
8.7. Denial-of-Service | ||||
EDHOC itself does not provide countermeasures against Denial-of- | ||||
Service attacks. In particular, by sending a number of new or | ||||
replayed message_1 an attacker may cause the Responder to allocate | replayed message_1 an attacker may cause the Responder to allocate | |||
state, perform cryptographic operations, and amplify messages. To | state, perform cryptographic operations, and amplify messages. To | |||
mitigate such attacks, an implementation SHOULD rely on lower layer | mitigate such attacks, an implementation SHOULD rely on lower layer | |||
mechanisms such as the Echo option in CoAP that forces the initiator | mechanisms. For instance, when EDHOC is transferred as an exchange | |||
to demonstrate reachability at its apparent network address. | of CoAP messages, the CoAP server can use the Echo option defined in | |||
[RFC9175] which forces the CoAP client to demonstrate reachability at | ||||
its apparent network address. | ||||
An attacker can also send faked message_2, message_3, message_4, or | An attacker can also send faked message_2, message_3, message_4, or | |||
error in an attempt to trick the receiving party to send an error | error in an attempt to trick the receiving party to send an error | |||
message and discontinue the session. EDHOC implementations MAY | message and discontinue the session. EDHOC implementations MAY | |||
evaluate if a received message is likely to have been forged by an | evaluate if a received message is likely to have been forged by an | |||
attacker and ignore it without sending an error message or | attacker and ignore it without sending an error message or | |||
discontinuing the session. | discontinuing the session. | |||
8.7. Implementation Considerations | 8.8. Implementation Considerations | |||
The availability of a secure random number generator is essential for | The availability of a secure random number generator is essential for | |||
the security of EDHOC. If no true random number generator is | the security of EDHOC. If no true random number generator is | |||
available, a truly random seed MUST be provided from an external | available, a random seed must be provided from an external source and | |||
source and used with a cryptographically secure pseudorandom number | used with a cryptographically secure pseudorandom number generator. | |||
generator. As each pseudorandom number must only be used once, an | As each pseudorandom number must only be used once, an implementation | |||
implementation needs to get a new truly random seed after reboot, or | needs to get a unique input to the pseudorandom number generator | |||
continuously store state in nonvolatile memory, see ([RFC8613], | after reboot, or continuously store state in nonvolatile memory. | |||
Appendix B.1.1) for issues and solution approaches for writing to | Appendix B.1.1 in [RFC8613] describes issues and solution approaches | |||
nonvolatile memory. Intentionally or unintentionally weak or | for writing to nonvolatile memory. Intentionally or unintentionally | |||
predictable pseudorandom number generators can be abused or exploited | weak or predictable pseudorandom number generators can be abused or | |||
for malicious purposes. [RFC8937] describes a way for security | exploited for malicious purposes. [RFC8937] describes a way for | |||
protocol implementations to augment their (pseudo)random number | security protocol implementations to augment their (pseudo)random | |||
generators using a long-term private key and a deterministic | number generators using a long-term private key and a deterministic | |||
signature function. This improves randomness from broken or | signature function. This improves randomness from broken or | |||
otherwise subverted random number generators. The same idea can be | otherwise subverted random number generators. The same idea can be | |||
used with other secrets and functions such as a Diffie-Hellman | used with other secrets and functions such as a Diffie-Hellman | |||
function or a symmetric secret and a PRF like HMAC or KMAC. It is | function or a symmetric secret and a PRF like HMAC or KMAC. It is | |||
RECOMMENDED to not trust a single source of randomness and to not put | RECOMMENDED to not trust a single source of randomness and to not put | |||
unaugmented random numbers on the wire. | unaugmented random numbers on the wire. | |||
If ECDSA is supported, "deterministic ECDSA" as specified in | Implementations might consider deriving secret and non-secret | |||
[RFC6979] MAY be used. Pure deterministic elliptic-curve signatures | randomness from different PNRG/PRF/KDF instances to limit the damage | |||
such as deterministic ECDSA and EdDSA have gained popularity over | if the PNRG/PRF/KDF turns out to be fundamentally broken. NIST | |||
randomized ECDSA as their security do not depend on a source of high- | generally forbids deriving secret and non-secret randomness from the | |||
quality randomness. Recent research has however found that | same KDF instance, but this decision has been criticized by Krawczyk | |||
implementations of these signature algorithms may be vulnerable to | [HKDFpaper] and doing so is common practice. In addition to IVs, | |||
certain side-channel and fault injection attacks due to their | other examples are the challenge in EAP-TTLS, the RAND in 3GPP AKAs, | |||
determinism. See e.g., Section 1 of | and the Session-Id in EAP-TLS 1.3. Note that part of KEYSTREAM_2 is | |||
also non-secret randomness as it is known or predictable to an | ||||
attacker. As explained by Krawczyk, if any attack is mitigated by | ||||
the NIST requirement it would mean that the KDF is fully broken and | ||||
would have to be replaced anyway. | ||||
For many constrained IoT devices it is problematic to support several | ||||
crypto primitives. Existing devices can be expected to support | ||||
either ECDSA or 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 do 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. See e.g., Section 1 of | ||||
[I-D.mattsson-cfrg-det-sigs-with-noise] for a list of attack papers. | [I-D.mattsson-cfrg-det-sigs-with-noise] for a list of attack papers. | |||
As suggested in Section 6.1.2 of [I-D.ietf-cose-rfc8152bis-algs] this | As suggested in Section 2.1.1 of [I-D.ietf-cose-rfc8152bis-algs] this | |||
can be addressed by combining randomness and determinism. | can be addressed by combining randomness and determinism. | |||
Appendix D of [I-D.ietf-lwig-curve-representations] describes how | ||||
Montgomery curves such as X25519 and X448 and (twisted) Edwards | ||||
curves as curves such as Ed25519 and Ed448 can mapped to and from | ||||
short-Weierstrass form for implementation on platforms that | ||||
accelerate elliptic curve group operations in short-Weierstrass form. | ||||
All private keys, symmetric keys, and IVs MUST be secret. | All private keys, symmetric keys, and IVs MUST be secret. | |||
Implementations should provide countermeasures to side-channel | Implementations should provide countermeasures to side-channel | |||
attacks such as timing attacks. Intermediate computed values such as | attacks such as timing attacks. Intermediate computed values such as | |||
ephemeral ECDH keys and ECDH shared secrets MUST be deleted after key | ephemeral ECDH keys and ECDH shared secrets MUST be deleted after key | |||
derivation is completed. | derivation is completed. | |||
The Initiator and the Responder are responsible for verifying the | The Initiator and the Responder are responsible for verifying the | |||
integrity of certificates. The selection of trusted CAs should be | integrity and validity of certificates. The selection of trusted CAs | |||
done very carefully and certificate revocation should be supported. | should be done very carefully and certificate revocation should be | |||
The private authentication keys MUST be kept secret, only the | supported. The choice of revocation mechanism is left to the | |||
application. For example, in case of X.509 certificates, Certificate | ||||
Revocation Lists [RFC5280] or OCSP [RFC6960] may be used. | ||||
Verification of validity may require the use of a Real-Time Clock | ||||
(RTC). The private authentication keys MUST be kept secret, only the | ||||
Responder SHALL have access to the Responder's private authentication | Responder SHALL have access to the Responder's private authentication | |||
key and only the Initiator SHALL have access to the Initiator's | key and only the Initiator SHALL have access to the Initiator's | |||
private authentication key. | private authentication key. | |||
The Initiator and the Responder are allowed to select the connection | The Initiator and the Responder are allowed to select its connection | |||
identifiers C_I and C_R, respectively, for the other party to use in | identifiers C_I and C_R, respectively, for the other party to use in | |||
the ongoing EDHOC protocol as well as in a subsequent application | the ongoing EDHOC protocol as well as in a subsequent application | |||
protocol (e.g., OSCORE [RFC8613]). The choice of connection | protocol (e.g., OSCORE [RFC8613]). The choice of connection | |||
identifier is not security critical in EDHOC but intended to simplify | identifier is not security critical in EDHOC but intended to simplify | |||
the retrieval of the right security context in combination with using | the retrieval of the right security context in combination with using | |||
short identifiers. If the wrong connection identifier of the other | short identifiers. If the wrong connection identifier of the other | |||
party is used in a protocol message it will result in the receiving | party is used in a protocol message it will result in the receiving | |||
party not being able to retrieve a security context (which will | party not being able to retrieve a security context (which will | |||
terminate the protocol) or retrieve the wrong security context (which | terminate the protocol) or retrieve the wrong security context (which | |||
also terminates the protocol as the message cannot be verified). | also terminates the protocol as the message cannot be verified). | |||
If two nodes unintentionally initiate two simultaneous EDHOC message | If two nodes unintentionally initiate two simultaneous EDHOC message | |||
exchanges with each other even if they only want to complete a single | exchanges with each other even if they only want to complete a single | |||
EDHOC message exchange, they MAY terminate the exchange with the | EDHOC message exchange, they MAY terminate the exchange with the | |||
lexicographically smallest G_X. If the two G_X values are equal, the | lexicographically smallest G_X. Note that in cases where several | |||
received message_1 MUST be discarded to mitigate reflection attacks. | EDHOC exchanges with different parameter sets (method, COSE headers, | |||
Note that in the case of two simultaneous EDHOC exchanges where the | etc.) are used, an attacker can affect which of the parameter sets | |||
nodes only complete one and where the nodes have different preferred | that will be used by blocking some of the parameter sets. | |||
cipher suites, an attacker can affect which of the two nodes' | ||||
preferred cipher suites will be used by blocking the other exchange. | ||||
If supported by the device, it is RECOMMENDED that at least the long- | If supported by the device, it is RECOMMENDED that at least the long- | |||
term private keys are stored in a Trusted Execution Environment (TEE) | term private keys are stored in a Trusted Execution Environment (TEE) | |||
and that sensitive operations using these keys are performed inside | and that sensitive operations using these keys are performed inside | |||
the TEE. To achieve even higher security it is RECOMMENDED that | the TEE. To achieve even higher security it is RECOMMENDED that | |||
additional operations such as ephemeral key generation, all | additional operations such as ephemeral key generation, all | |||
computations of shared secrets, and storage of the PRK keys can be | computations of shared secrets, and storage of the PRK keys can be | |||
done inside the TEE. The use of a TEE enforces that code within that | done inside the TEE. The use of a TEE aims at preventing code within | |||
environment cannot be tampered with, and that any data used by such | that environment to be tampered with, and preventing data used by | |||
code cannot be read or tampered with by code outside that | such code to be read or tampered with by code outside that | |||
environment. | environment. | |||
9. IANA Considerations | Note that HKDF-Expand has a relativly small maximum output length of | |||
255 * hash_length. This means that when when SHA-256 is used as hash | ||||
algorithm, message_2 cannot be longer than 8160 bytes. | ||||
The sequence of transcript hashes in EHDOC (TH_2, TH_3, TH_4) do not | ||||
make use of a so called running hash, this is a design choice as | ||||
running hashes are often not supported on constrained platforms. | ||||
When parsing a received EDHOC message, implementations MUST terminate | ||||
the protocol if the message does not comply with the CDDL for that | ||||
message. It is RECOMMENDED to terminate the protocol if the received | ||||
EDHOC message is not deterministic CBOR. | ||||
9. IANA Considerations | ||||
9.1. EDHOC Exporter Label Registry | 9.1. EDHOC Exporter Label Registry | |||
IANA has created a new registry titled "EDHOC Exporter Label" under | IANA has created a new registry titled "EDHOC Exporter Label" under | |||
the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The | the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The | |||
registration procedure is "Expert Review". The columns of the | registration procedure is "Expert Review". The columns of the | |||
registry are Label, Description, and Reference. All columns are text | registry are Label and Description. Label is a uint. Description is | |||
strings where Label consists only of the printable ASCII characters | a text string. The initial contents of the registry are: | |||
0x21 - 0x7e. Labels beginning with "PRIVATE" MAY be used for private | ||||
use without registration. All other label values MUST be registered. | ||||
The initial contents of the registry are: | ||||
Label: EDHOC_K_4 | ||||
Description: Key used to protect EDHOC message_4 | ||||
Reference: [[this document]] | ||||
Label: EDHOC_IV_4 | ||||
Description: IV used to protect EDHOC message_4 | ||||
Reference: [[this document]] | ||||
Label: OSCORE_Master_Secret | Label: 0 | |||
Description: Derived OSCORE Master Secret | Description: Derived OSCORE Master Secret | |||
Reference: [[this document]] | ||||
Label: OSCORE_Master_Salt | Label: 1 | |||
Description: Derived OSCORE Master Salt | Description: Derived OSCORE Master Salt | |||
Reference: [[this document]] | ||||
9.2. EDHOC Cipher Suites Registry | 9.2. EDHOC Cipher Suites Registry | |||
IANA has created a new registry titled "EDHOC Cipher Suites" under | IANA has created a new registry titled "EDHOC Cipher Suites" under | |||
the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The | the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The | |||
registration procedure is "Expert Review". The columns of the | registration procedure is "Expert Review". The columns of the | |||
registry are Value, Array, Description, and Reference, where Value is | registry are Value, Array and Description, where Value is an integer | |||
an integer and the other columns are text strings. The initial | and the other columns are text strings. The initial contents of the | |||
contents of the registry are: | registry are: | |||
Value: -24 | Value: -24 | |||
Algorithms: N/A | Algorithms: N/A | |||
Desc: Reserved for Private Use | Desc: Reserved for Private Use | |||
Reference: [[this document]] | ||||
Value: -23 | Value: -23 | |||
Algorithms: N/A | Algorithms: N/A | |||
Desc: Reserved for Private Use | Desc: Reserved for Private Use | |||
Reference: [[this document]] | ||||
Value: -22 | Value: -22 | |||
Algorithms: N/A | Algorithms: N/A | |||
Desc: Reserved for Private Use | Desc: Reserved for Private Use | |||
Reference: [[this document]] | ||||
Value: -21 | Value: -21 | |||
Algorithms: N/A | Algorithms: N/A | |||
Desc: Reserved for Private Use | Desc: Reserved for Private Use | |||
Reference: [[this document]] | ||||
Value: 0 | Value: 0 | |||
Array: 10, -16, 8, 4, -8, 10, -16 | Array: 10, -16, 8, 4, -8, 10, -16 | |||
Desc: AES-CCM-16-64-128, SHA-256, 8, X25519, EdDSA, | Desc: AES-CCM-16-64-128, SHA-256, 8, X25519, EdDSA, | |||
AES-CCM-16-64-128, SHA-256 | AES-CCM-16-64-128, SHA-256 | |||
Reference: [[this document]] | ||||
Value: 1 | Value: 1 | |||
Array: 30, -16, 16, 4, -8, 10, -16 | Array: 30, -16, 16, 4, -8, 10, -16 | |||
Desc: AES-CCM-16-128-128, SHA-256, 16, X25519, EdDSA, | Desc: AES-CCM-16-128-128, SHA-256, 16, X25519, EdDSA, | |||
AES-CCM-16-64-128, SHA-256 | AES-CCM-16-64-128, SHA-256 | |||
Reference: [[this document]] | ||||
Value: 2 | Value: 2 | |||
Array: 10, -16, 8, 1, -7, 10, -16 | Array: 10, -16, 8, 1, -7, 10, -16 | |||
Desc: AES-CCM-16-64-128, SHA-256, 8, P-256, ES256, | Desc: AES-CCM-16-64-128, SHA-256, 8, P-256, ES256, | |||
AES-CCM-16-64-128, SHA-256 | AES-CCM-16-64-128, SHA-256 | |||
Reference: [[this document]] | ||||
Value: 3 | Value: 3 | |||
Array: 30, -16, 16, 1, -7, 10, -16 | Array: 30, -16, 16, 1, -7, 10, -16 | |||
Desc: AES-CCM-16-128-128, SHA-256, 16, P-256, ES256, | Desc: AES-CCM-16-128-128, SHA-256, 16, P-256, ES256, | |||
AES-CCM-16-64-128, SHA-256 | AES-CCM-16-64-128, SHA-256 | |||
Reference: [[this document]] | ||||
Value: 4 | Value: 4 | |||
Array: 24, -16, 16, 4, -8, 24, -16 | Array: 24, -16, 16, 4, -8, 24, -16 | |||
Desc: ChaCha20/Poly1305, SHA-256, 16, X25519, EdDSA, | Desc: ChaCha20/Poly1305, SHA-256, 16, X25519, EdDSA, | |||
ChaCha20/Poly1305, SHA-256 | ChaCha20/Poly1305, SHA-256 | |||
Reference: [[this document]] | ||||
Value: 5 | Value: 5 | |||
Array: 24, -16, 16, 1, -7, 24, -16 | Array: 24, -16, 16, 1, -7, 24, -16 | |||
Desc: ChaCha20/Poly1305, SHA-256, 16, P-256, ES256, | Desc: ChaCha20/Poly1305, SHA-256, 16, P-256, ES256, | |||
ChaCha20/Poly1305, SHA-256 | ChaCha20/Poly1305, SHA-256 | |||
Reference: [[this document]] | ||||
Value: 6 | Value: 6 | |||
Array: 1, -16, 16, 4, -7, 1, -16 | Array: 1, -16, 16, 4, -7, 1, -16 | |||
Desc: A128GCM, SHA-256, 16, X25519, ES256, | Desc: A128GCM, SHA-256, 16, X25519, ES256, | |||
A128GCM, SHA-256 | A128GCM, SHA-256 | |||
Reference: [[this document]] | ||||
Value: 24 | Value: 24 | |||
Array: 3, -43, 16, 2, -35, 3, -43 | Array: 3, -43, 16, 2, -35, 3, -43 | |||
Desc: A256GCM, SHA-384, 16, P-384, ES384, | Desc: A256GCM, SHA-384, 16, P-384, ES384, | |||
A256GCM, SHA-384 | A256GCM, SHA-384 | |||
Reference: [[this document]] | ||||
Value: 25 | Value: 25 | |||
Array: 24, -45, 16, 5, -8, 24, -45 | Array: 24, -45, 16, 5, -8, 24, -45 | |||
Desc: ChaCha20/Poly1305, SHAKE256, 16, X448, EdDSA, | Desc: ChaCha20/Poly1305, SHAKE256, 16, X448, EdDSA, | |||
ChaCha20/Poly1305, SHAKE256 | ChaCha20/Poly1305, SHAKE256 | |||
Reference: [[this document]] | ||||
9.3. EDHOC Method Type Registry | 9.3. EDHOC Method Type Registry | |||
IANA has created a new registry entitled "EDHOC Method Type" under | IANA has created a new registry entitled "EDHOC Method Type" under | |||
the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The | the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The | |||
registration procedure is "Expert Review". The columns of the | registration procedure is "Specification Required". The columns of | |||
registry are Value, Description, and Reference, where Value is an | the registry are Value, Initiator Authentication Key, and Responder | |||
integer and the other columns are text strings. The initial contents | Authentication Key, where Value is an integer and the other columns | |||
of the registry are shown in Figure 4. | are text strings describing the authentication keys. The initial | |||
contents of the registry are shown in Figure 4. | ||||
9.4. EDHOC Error Codes Registry | 9.4. EDHOC Error Codes Registry | |||
IANA has created a new registry entitled "EDHOC Error Codes" under | IANA has created a new registry entitled "EDHOC Error Codes" under | |||
the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The | the new group name "Ephemeral Diffie-Hellman Over COSE (EDHOC)". The | |||
registration procedure is "Expert Review". The columns of the | registration procedure is "Expert Review". The columns of the | |||
registry are ERR_CODE, ERR_INFO Type and Description, where ERR_CODE | registry are ERR_CODE, ERR_INFO Type and Description, where ERR_CODE | |||
is an integer, ERR_INFO is a CDDL defined type, and Description is a | is an integer, ERR_INFO is a CDDL defined type, and Description is a | |||
text string. The initial contents of the registry are shown in | text string. The initial contents of the registry are shown in | |||
Figure 7. | Figure 9. | |||
9.5. EDHOC External Authorization Data Registry | 9.5. EDHOC External Authorization Data Registry | |||
IANA has created a new registry entitled "EDHOC External | IANA has created a new registry entitled "EDHOC External | |||
Authorization Data" under the new group name "Ephemeral Diffie- | Authorization Data" under the new group name "Ephemeral Diffie- | |||
Hellman Over COSE (EDHOC)". The registration procedure is "Expert | Hellman Over COSE (EDHOC)". The registration procedure is | |||
Review". The columns of the registry are Label, Description, Value | "Specification Required". The columns of the registry are Label, | |||
Type, and Reference, where Label is an integer and the other columns | Message, Description, and Reference, where Label is an integer and | |||
are text strings. | the other columns are text strings. | |||
9.6. COSE Header Parameters Registry | 9.6. COSE Header Parameters Registry | |||
IANA has registered the following entries in the "COSE Header | IANA has registered the following entries in the "COSE Header | |||
Parameters" registry under the group name "CBOR Object Signing and | Parameters" registry under the group name "CBOR Object Signing and | |||
Encryption (COSE)". The value of the 'kcwt' header parameter is a | Encryption (COSE)". The value of the 'kcwt' header parameter is a | |||
COSE Web Token (CWT) [RFC8392], and the value of the 'kccs' header | COSE Web Token (CWT) [RFC8392], and the value of the 'kccs' header | |||
parameter is an CWT Claims Set (CCS), see Section 1.5. The CWT/CCS | parameter is a CWT Claims Set (CCS), see Section 1.4. The CWT/CCS | |||
must contain a COSE_Key in a 'cnf' claim [RFC8747]. The Value | must contain a COSE_Key in a 'cnf' claim [RFC8747]. The Value | |||
Registry for this item is empty and omitted from the table below. | Registry for this item is empty and omitted from the table below. | |||
+-----------+-------+----------------+---------------------------+ | +-----------+-------+----------------+---------------------------+ | |||
| Name | Label | Value Type | Description | | | Name | Label | Value Type | Description | | |||
+===========+=======+================+===========================+ | +===========+=======+================+===========================+ | |||
| kcwt | TBD1 | COSE_Messages | A CBOR Web Token (CWT) | | | kcwt | TBD1 | COSE_Messages | A CBOR Web Token (CWT) | | |||
| | | | containing a COSE_Key in | | | | | | containing a COSE_Key in | | |||
| | | | a 'cnf' claim | | | | | | a 'cnf' claim | | |||
+-----------+-------+----------------+---------------------------+ | +-----------+-------+----------------+---------------------------+ | |||
| kccs | TBD2 | map / #6(map) | A CWT Claims Set (CCS) | | | kccs | TBD2 | map / #6(map) | A CWT Claims Set (CCS) | | |||
| | | | containing a COSE_Key in | | | | | | containing a COSE_Key in | | |||
| | | | a 'cnf' claim | | | | | | a 'cnf' claim | | |||
+-----------+-------+----------------+---------------------------+ | +-----------+-------+----------------+---------------------------+ | |||
9.7. COSE Header Parameters Registry | 9.7. The Well-Known URI Registry | |||
IANA has extended the Value Type of 'kid' in the "COSE Header | IANA has added the well-known URI "edhoc" to the "Well-Known URIs" | |||
Parameters" registry under the group name "CBOR Object Signing and | registry under the group name "Well-Known URIs". | |||
Encryption (COSE)" to also allow the Value Type int. The resulting | ||||
Value Type is bstr / int. The Value Registry for this item is empty | ||||
and omitted from the table below. | ||||
+------+-------+------------+----------------+-------------------+ | * URI suffix: edhoc | |||
| Name | Label | Value Type | Description | Reference | | * Change controller: IETF | |||
+------+-------+------------+----------------+-------------------+ | ||||
| kid | 4 | bstr / int | Key identifier | [[This document]] | | ||||
+------+-------+------------+----------------+-------------------+ | ||||
9.8. COSE Key Common Parameters Registry | * Specification document(s): [[this document]] | |||
IANA has extended the Value Type of 'kid' in the "COSE Key Common | * Related information: None | |||
Parameters" registry under the group name "CBOR Object Signing and | ||||
Encryption (COSE)" to also allow the Value Type int. The resulting | ||||
Value Type is bstr / int. The Value Registry for this item is empty | ||||
and omitted from the table below. | ||||
+------+-------+------------+----------------+-------------------+ | 9.8. Media Types Registry | |||
| Name | Label | Value Type | Description | Reference | | ||||
+------+-------+------------+----------------+-------------------+ | ||||
| kid | 2 | bstr / int | Key identifi- | [[This document]] | | ||||
| | | | cation value - | | | ||||
| | | | match to kid | | | ||||
| | | | in message | | | ||||
+------+-------+------------+----------------+-------------------+ | ||||
9.9. CWT Confirmation Methods Registry | IANA has added the media types "application/edhoc+cbor-seq" and | |||
"application/cid-edhoc+cbor-seq" to the "Media Types" registry. | ||||
IANA has extended the Value Type of 'kid' in the "CWT Confirmation | 9.8.1. application/edhoc+cbor-seq Media Type Registration | |||
Methods" registry under the group name "CBOR Web Token (CWT) Claims" | ||||
to also allow the Value Type int. The incorrect term binary string | ||||
has been corrected to bstr. The resulting Value Type is bstr / int. | ||||
The new updated content for the 'kid' method is shown in the list | ||||
below. | ||||
* Confirmation Method Name: kid | * Type name: application | |||
* Confirmation Method Description: Key Identifier | * Subtype name: edhoc+cbor-seq | |||
* JWT Confirmation Method Name: kid | * Required parameters: N/A | |||
* Confirmation Key: 3 | * Optional parameters: N/A | |||
* Confirmation Value Type(s): bstr / int | * Encoding considerations: binary | |||
* Change Controller: IESG | * Security considerations: See Section 7 of this document. | |||
* Specification Document(s): Section 3.4 of RFC 8747 [[This | * Interoperability considerations: N/A | |||
document]] | ||||
9.10. The Well-Known URI Registry | * Published specification: [[this document]] (this document) | |||
IANA has added the well-known URI "edhoc" to the "Well-Known URIs" | * Applications that use this media type: To be identified | |||
registry under the group name "Well-Known URIs". | ||||
* URI suffix: edhoc | * Fragment identifier considerations: N/A | |||
* Change controller: IETF | ||||
* Specification document(s): [[this document]] | * Additional information: | |||
* Related information: None | - Magic number(s): N/A | |||
9.11. Media Types Registry | - File extension(s): N/A | |||
IANA has added the media type "application/edhoc" to the "Media | - Macintosh file type code(s): N/A | |||
Types" registry. | ||||
* Person & email address to contact for further information: See | ||||
"Authors' Addresses" section. | ||||
* Intended usage: COMMON | ||||
* Restrictions on usage: N/A | ||||
* Author: See "Authors' Addresses" section. | ||||
* Change Controller: IESG | ||||
9.8.2. application/cid-edhoc+cbor-seq Media Type Registration | ||||
* Type name: application | * Type name: application | |||
* Subtype name: edhoc | * Subtype name: cid-edhoc+cbor-seq | |||
* Required parameters: N/A | * Required parameters: N/A | |||
* Optional parameters: N/A | * Optional parameters: N/A | |||
* Encoding considerations: binary | * Encoding considerations: binary | |||
* Security considerations: See Section 7 of this document. | * Security considerations: See Section 7 of this document. | |||
* Interoperability considerations: N/A | * Interoperability considerations: N/A | |||
skipping to change at page 55, line 7 ¶ | skipping to change at page 57, line 5 ¶ | |||
"Authors' Addresses" section. | "Authors' Addresses" section. | |||
* Intended usage: COMMON | * Intended usage: COMMON | |||
* Restrictions on usage: N/A | * Restrictions on usage: N/A | |||
* Author: See "Authors' Addresses" section. | * Author: See "Authors' Addresses" section. | |||
* Change Controller: IESG | * Change Controller: IESG | |||
9.12. CoAP Content-Formats Registry | 9.9. CoAP Content-Formats Registry | |||
IANA has added the media type "application/edhoc" to the "CoAP | ||||
Content-Formats" registry under the group name "Constrained RESTful | ||||
Environments (CoRE) Parameters". | ||||
* Media Type: application/edhoc | ||||
* Encoding: | IANA has added the media types "application/edhoc+cbor-seq" and | |||
"application/cid-edhoc+cbor-seq" to the "CoAP Content-Formats" | ||||
registry under the group name "Constrained RESTful Environments | ||||
(CoRE) Parameters". | ||||
* ID: TBD42 | +--------------------------------+----------+------+-------------------+ | |||
| Media Type | Encoding | ID | Reference | | ||||
+--------------------------------+----------+------+-------------------+ | ||||
| application/edhoc+cbor-seq | - | TBD5 | [[this document]] | | ||||
| application/cid-edhoc+cbor-seq | - | TBD6 | [[this document]] | | ||||
+--------------------------------+----------+------+-------------------+ | ||||
* Reference: [[this document]] | Figure 12: CoAP Content-Format IDs | |||
9.13. Resource Type (rt=) Link Target Attribute Values Registry | 9.10. Resource Type (rt=) Link Target Attribute Values Registry | |||
IANA has added the resource type "core.edhoc" to the "Resource Type | IANA has added the resource type "core.edhoc" to the "Resource Type | |||
(rt=) Link Target Attribute Values" registry under the group name | (rt=) Link Target Attribute Values" registry under the group name | |||
"Constrained RESTful Environments (CoRE) Parameters". | "Constrained RESTful Environments (CoRE) Parameters". | |||
* Value: "core.edhoc" | * Value: "core.edhoc" | |||
* Description: EDHOC resource. | * Description: EDHOC resource. | |||
* Reference: [[this document]] | * Reference: [[this document]] | |||
Client applications can use this resource type to discover a server's | 9.11. Expert Review Instructions | |||
resource for EDHOC, where to send a request for executing the EDHOC | ||||
protocol. | ||||
9.14. Expert Review Instructions | ||||
The IANA Registries established in this document is defined as | The IANA Registries established in this document are defined as | |||
"Expert Review". This section gives some general guidelines for what | "Expert Review". This section gives some general guidelines for what | |||
the experts should be looking for, but they are being designated as | the experts should be looking for, but they are being designated as | |||
experts for a reason so they should be given substantial latitude. | experts for a reason so they should be given substantial latitude. | |||
Expert reviewers should take into consideration the following points: | Expert reviewers should take into consideration the following points: | |||
* Clarity and correctness of registrations. Experts are expected to | * Clarity and correctness of registrations. Experts are expected to | |||
check the clarity of purpose and use of the requested entries. | check the clarity of purpose and use of the requested entries. | |||
Expert needs to make sure the values of algorithms are taken from | Expert needs to make sure the values of algorithms are taken from | |||
the right registry, when that is required. Expert should consider | the right registry, when that is required. Expert should consider | |||
skipping to change at page 57, line 10 ¶ | skipping to change at page 58, line 46 ¶ | |||
certificates", Work in Progress, Internet-Draft, draft- | certificates", Work in Progress, Internet-Draft, draft- | |||
ietf-cose-x509-08, 14 December 2020, | ietf-cose-x509-08, 14 December 2020, | |||
<https://www.ietf.org/internet-drafts/draft-ietf-cose- | <https://www.ietf.org/internet-drafts/draft-ietf-cose- | |||
x509-08.txt>. | x509-08.txt>. | |||
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
<https://www.rfc-editor.org/info/rfc2119>. | <https://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/RFC3279, April | ||||
2002, <https://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/RFC3552, July 2003, | ||||
<https://www.rfc-editor.org/info/rfc3552>. | ||||
[RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated | [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated | |||
Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, | Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, | |||
<https://www.rfc-editor.org/info/rfc5116>. | <https://www.rfc-editor.org/info/rfc5116>. | |||
[RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., | [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., | |||
Housley, R., and W. Polk, "Internet X.509 Public Key | Housley, R., and W. Polk, "Internet X.509 Public Key | |||
Infrastructure Certificate and Certificate Revocation List | Infrastructure Certificate and Certificate Revocation List | |||
(CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, | (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, | |||
<https://www.rfc-editor.org/info/rfc5280>. | <https://www.rfc-editor.org/info/rfc5280>. | |||
[RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand | [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand | |||
Key Derivation Function (HKDF)", RFC 5869, | Key Derivation Function (HKDF)", RFC 5869, | |||
DOI 10.17487/RFC5869, May 2010, | DOI 10.17487/RFC5869, May 2010, | |||
<https://www.rfc-editor.org/info/rfc5869>. | <https://www.rfc-editor.org/info/rfc5869>. | |||
[RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic | [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic | |||
Curve Cryptography Algorithms", RFC 6090, | Curve Cryptography Algorithms", RFC 6090, | |||
DOI 10.17487/RFC6090, February 2011, | DOI 10.17487/RFC6090, February 2011, | |||
<https://www.rfc-editor.org/info/rfc6090>. | <https://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/RFC6960, June 2013, | ||||
<https://www.rfc-editor.org/info/rfc6960>. | ||||
[RFC6979] Pornin, T., "Deterministic Usage of the Digital Signature | [RFC6979] Pornin, T., "Deterministic Usage of the Digital Signature | |||
Algorithm (DSA) and Elliptic Curve Digital Signature | Algorithm (DSA) and Elliptic Curve Digital Signature | |||
Algorithm (ECDSA)", RFC 6979, DOI 10.17487/RFC6979, August | Algorithm (ECDSA)", RFC 6979, DOI 10.17487/RFC6979, August | |||
2013, <https://www.rfc-editor.org/info/rfc6979>. | 2013, <https://www.rfc-editor.org/info/rfc6979>. | |||
[RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained | [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained | |||
Application Protocol (CoAP)", RFC 7252, | Application Protocol (CoAP)", RFC 7252, | |||
DOI 10.17487/RFC7252, June 2014, | DOI 10.17487/RFC7252, June 2014, | |||
<https://www.rfc-editor.org/info/rfc7252>. | <https://www.rfc-editor.org/info/rfc7252>. | |||
skipping to change at page 58, line 22 ¶ | skipping to change at page 60, line 26 ¶ | |||
May 2017, <https://www.rfc-editor.org/info/rfc8174>. | May 2017, <https://www.rfc-editor.org/info/rfc8174>. | |||
[RFC8376] Farrell, S., Ed., "Low-Power Wide Area Network (LPWAN) | [RFC8376] Farrell, S., Ed., "Low-Power Wide Area Network (LPWAN) | |||
Overview", RFC 8376, DOI 10.17487/RFC8376, May 2018, | Overview", RFC 8376, DOI 10.17487/RFC8376, May 2018, | |||
<https://www.rfc-editor.org/info/rfc8376>. | <https://www.rfc-editor.org/info/rfc8376>. | |||
[RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, | [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, | |||
"CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, | "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, | |||
May 2018, <https://www.rfc-editor.org/info/rfc8392>. | May 2018, <https://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/RFC8410, August 2018, | ||||
<https://www.rfc-editor.org/info/rfc8410>. | ||||
[RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data | [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data | |||
Definition Language (CDDL): A Notational Convention to | Definition Language (CDDL): A Notational Convention to | |||
Express Concise Binary Object Representation (CBOR) and | Express Concise Binary Object Representation (CBOR) and | |||
JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, | JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, | |||
June 2019, <https://www.rfc-editor.org/info/rfc8610>. | June 2019, <https://www.rfc-editor.org/info/rfc8610>. | |||
[RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, | [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, | |||
"Object Security for Constrained RESTful Environments | "Object Security for Constrained RESTful Environments | |||
(OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, | (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, | |||
<https://www.rfc-editor.org/info/rfc8613>. | <https://www.rfc-editor.org/info/rfc8613>. | |||
skipping to change at page 59, line 28 ¶ | skipping to change at page 61, line 38 ¶ | |||
edhoc/16284348>. | edhoc/16284348>. | |||
[CborMe] Bormann, C., "CBOR Playground", May 2018, | [CborMe] Bormann, C., "CBOR Playground", May 2018, | |||
<http://cbor.me/>. | <http://cbor.me/>. | |||
[CNSA] (Placeholder), ., "Commercial National Security Algorithm | [CNSA] (Placeholder), ., "Commercial National Security Algorithm | |||
Suite", August 2015, | Suite", August 2015, | |||
<https://apps.nsa.gov/iaarchive/programs/iad-initiatives/ | <https://apps.nsa.gov/iaarchive/programs/iad-initiatives/ | |||
cnsa-suite.cfm>. | cnsa-suite.cfm>. | |||
[Degabriele11] | ||||
Degabriele, J.P., Lehmann, A., Paterson, K.G., Smart, | ||||
N.P., and M. Strefler, "On the Joint Security of | ||||
Encryption and Signature in EMV", December 2011, | ||||
<https://eprint.iacr.org/2011/615>. | ||||
[HKDFpaper] | ||||
Krawczyk, H., "Cryptographic Extraction and Key | ||||
Derivation: The HKDF Scheme", May 2010, | ||||
<https://eprint.iacr.org/2010/264.pdf>. | ||||
[I-D.arkko-arch-internet-threat-model-guidance] | ||||
Arkko, J. and S. Farrell, "Internet Threat Model | ||||
Guidance", Work in Progress, Internet-Draft, draft-arkko- | ||||
arch-internet-threat-model-guidance-00, 12 July 2021, | ||||
<https://www.ietf.org/archive/id/draft-arkko-arch- | ||||
internet-threat-model-guidance-00.txt>. | ||||
[I-D.ietf-core-oscore-edhoc] | [I-D.ietf-core-oscore-edhoc] | |||
Palombini, F., Tiloca, M., Hoeglund, R., Hristozov, S., | Palombini, F., Tiloca, M., Hoeglund, R., Hristozov, S., | |||
and G. Selander, "Profiling EDHOC for CoAP and OSCORE", | and G. Selander, "Profiling EDHOC for CoAP and OSCORE", | |||
Work in Progress, Internet-Draft, draft-ietf-core-oscore- | Work in Progress, Internet-Draft, draft-ietf-core-oscore- | |||
edhoc-03, 7 March 2022, <https://www.ietf.org/archive/id/ | edhoc-03, 7 March 2022, <https://www.ietf.org/archive/id/ | |||
draft-ietf-core-oscore-edhoc-03.txt>. | draft-ietf-core-oscore-edhoc-03.txt>. | |||
[I-D.ietf-core-resource-directory] | [I-D.ietf-core-oscore-key-update] | |||
Amsüss, C., Shelby, Z., Koster, M., Bormann, C., and P. V. | Höglund, R. and M. Tiloca, "Key Update for OSCORE | |||
D. Stok, "CoRE Resource Directory", Work in Progress, | (KUDOS)", Work in Progress, Internet-Draft, draft-ietf- | |||
Internet-Draft, draft-ietf-core-resource-directory-28, 7 | core-oscore-key-update-01, 7 March 2022, | |||
March 2021, <https://www.ietf.org/archive/id/draft-ietf- | <https://www.ietf.org/archive/id/draft-ietf-core-oscore- | |||
core-resource-directory-28.txt>. | key-update-01.txt>. | |||
[I-D.ietf-cose-cbor-encoded-cert] | [I-D.ietf-cose-cbor-encoded-cert] | |||
Mattsson, J. P., Selander, G., Raza, S., Höglund, J., and | Mattsson, J. P., Selander, G., Raza, S., Höglund, J., and | |||
M. Furuhed, "CBOR Encoded X.509 Certificates (C509 | M. Furuhed, "CBOR Encoded X.509 Certificates (C509 | |||
Certificates)", Work in Progress, Internet-Draft, draft- | Certificates)", Work in Progress, Internet-Draft, draft- | |||
ietf-cose-cbor-encoded-cert-03, 10 January 2022, | ietf-cose-cbor-encoded-cert-03, 10 January 2022, | |||
<https://www.ietf.org/archive/id/draft-ietf-cose-cbor- | <https://www.ietf.org/archive/id/draft-ietf-cose-cbor- | |||
encoded-cert-03.txt>. | encoded-cert-03.txt>. | |||
[I-D.ietf-lake-reqs] | [I-D.ietf-lake-reqs] | |||
Vucinic, M., Selander, G., Mattsson, J. P., and D. Garcia- | Vucinic, M., Selander, G., Mattsson, J. P., and D. Garcia- | |||
Carrillo, "Requirements for a Lightweight AKE for OSCORE", | Carrillo, "Requirements for a Lightweight AKE for OSCORE", | |||
Work in Progress, Internet-Draft, draft-ietf-lake-reqs-04, | Work in Progress, Internet-Draft, draft-ietf-lake-reqs-04, | |||
8 June 2020, <https://www.ietf.org/archive/id/draft-ietf- | 8 June 2020, <https://www.ietf.org/archive/id/draft-ietf- | |||
lake-reqs-04.txt>. | lake-reqs-04.txt>. | |||
[I-D.ietf-lake-traces] | ||||
Selander, G. and J. P. Mattsson, "Traces of EDHOC", Work | ||||
in Progress, Internet-Draft, draft-ietf-lake-traces-00, 25 | ||||
November 2021, <https://www.ietf.org/archive/id/draft- | ||||
ietf-lake-traces-00.txt>. | ||||
[I-D.ietf-lwig-curve-representations] | ||||
Struik, R., "Alternative Elliptic Curve Representations", | ||||
Work in Progress, Internet-Draft, draft-ietf-lwig-curve- | ||||
representations-23, 21 January 2022, | ||||
<https://www.ietf.org/archive/id/draft-ietf-lwig-curve- | ||||
representations-23.txt>. | ||||
[I-D.ietf-lwig-security-protocol-comparison] | [I-D.ietf-lwig-security-protocol-comparison] | |||
Mattsson, J. P., Palombini, F., and M. Vucinic, | Mattsson, J. P., Palombini, F., and M. Vucinic, | |||
"Comparison of CoAP Security Protocols", Work in Progress, | "Comparison of CoAP Security Protocols", Work in Progress, | |||
Internet-Draft, draft-ietf-lwig-security-protocol- | Internet-Draft, draft-ietf-lwig-security-protocol- | |||
comparison-05, 2 November 2020, | comparison-05, 2 November 2020, | |||
<https://www.ietf.org/archive/id/draft-ietf-lwig-security- | <https://www.ietf.org/archive/id/draft-ietf-lwig-security- | |||
protocol-comparison-05.txt>. | protocol-comparison-05.txt>. | |||
[I-D.ietf-tls-dtls13] | [I-D.ietf-rats-eat] | |||
Rescorla, E., Tschofenig, H., and N. Modadugu, "The | Lundblade, L., Mandyam, G., and J. O'Donoghue, "The Entity | |||
Datagram Transport Layer Security (DTLS) Protocol Version | Attestation Token (EAT)", Work in Progress, Internet- | |||
1.3", Work in Progress, Internet-Draft, draft-ietf-tls- | Draft, draft-ietf-rats-eat-12, 24 February 2022, | |||
dtls13-43, 30 April 2021, <https://www.ietf.org/internet- | <https://www.ietf.org/archive/id/draft-ietf-rats-eat- | |||
drafts/draft-ietf-tls-dtls13-43.txt>. | 12.txt>. | |||
[I-D.mattsson-cfrg-det-sigs-with-noise] | [I-D.mattsson-cfrg-det-sigs-with-noise] | |||
Mattsson, J. P., Thormarker, E., and S. Ruohomaa, | Mattsson, J. P., Thormarker, E., and S. Ruohomaa, | |||
"Deterministic ECDSA and EdDSA Signatures with Additional | "Deterministic ECDSA and EdDSA Signatures with Additional | |||
Randomness", Work in Progress, Internet-Draft, draft- | Randomness", Work in Progress, Internet-Draft, draft- | |||
mattsson-cfrg-det-sigs-with-noise-04, 15 February 2022, | mattsson-cfrg-det-sigs-with-noise-04, 15 February 2022, | |||
<https://www.ietf.org/archive/id/draft-mattsson-cfrg-det- | <https://www.ietf.org/archive/id/draft-mattsson-cfrg-det- | |||
sigs-with-noise-04.txt>. | sigs-with-noise-04.txt>. | |||
[I-D.selander-ace-ake-authz] | [I-D.selander-ace-ake-authz] | |||
Selander, G., Mattsson, J. P., Vučinić, M., Richardson, | Selander, G., Mattsson, J. P., Vučinić, M., Richardson, | |||
M., and A. Schellenbaum, "Lightweight Authorization for | M., and A. Schellenbaum, "Lightweight Authorization for | |||
Authenticated Key Exchange.", Work in Progress, Internet- | Authenticated Key Exchange.", Work in Progress, Internet- | |||
Draft, draft-selander-ace-ake-authz-04, 22 October 2021, | Draft, draft-selander-ace-ake-authz-05, 18 April 2022, | |||
<https://www.ietf.org/archive/id/draft-selander-ace-ake- | <https://www.ietf.org/archive/id/draft-selander-ace-ake- | |||
authz-04.txt>. | authz-05.txt>. | |||
[I-D.selander-lake-traces] | ||||
Selander, G. and J. P. Mattsson, "Traces of EDHOC", Work | ||||
in Progress, Internet-Draft, draft-selander-lake-traces- | ||||
02, 20 October 2021, <https://www.ietf.org/archive/id/ | ||||
draft-selander-lake-traces-02.txt>. | ||||
[Norrman20] | [Norrman20] | |||
Norrman, K., Sundararajan, V., and A. Bruni, "Formal | Norrman, K., Sundararajan, V., and A. Bruni, "Formal | |||
Analysis of EDHOC Key Establishment for Constrained IoT | Analysis of EDHOC Key Establishment for Constrained IoT | |||
Devices", September 2020, | Devices", September 2020, | |||
<https://arxiv.org/abs/2007.11427>. | <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/RFC2986, November 2000, | ||||
<https://www.rfc-editor.org/info/rfc2986>. | ||||
[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/RFC6194, March 2011, | ||||
<https://www.rfc-editor.org/info/rfc6194>. | ||||
[RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for | [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for | |||
Constrained-Node Networks", RFC 7228, | Constrained-Node Networks", RFC 7228, | |||
DOI 10.17487/RFC7228, May 2014, | DOI 10.17487/RFC7228, May 2014, | |||
<https://www.rfc-editor.org/info/rfc7228>. | <https://www.rfc-editor.org/info/rfc7228>. | |||
[RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an | [RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an | |||
Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May | Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May | |||
2014, <https://www.rfc-editor.org/info/rfc7258>. | 2014, <https://www.rfc-editor.org/info/rfc7258>. | |||
[RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. | [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. | |||
Kivinen, "Internet Key Exchange Protocol Version 2 | Kivinen, "Internet Key Exchange Protocol Version 2 | |||
(IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October | (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October | |||
2014, <https://www.rfc-editor.org/info/rfc7296>. | 2014, <https://www.rfc-editor.org/info/rfc7296>. | |||
[RFC8366] Watsen, K., Richardson, M., Pritikin, M., and T. Eckert, | ||||
"A Voucher Artifact for Bootstrapping Protocols", | ||||
RFC 8366, DOI 10.17487/RFC8366, May 2018, | ||||
<https://www.rfc-editor.org/info/rfc8366>. | ||||
[RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol | [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol | |||
Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, | Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, | |||
<https://www.rfc-editor.org/info/rfc8446>. | <https://www.rfc-editor.org/info/rfc8446>. | |||
[RFC8937] Cremers, C., Garratt, L., Smyshlyaev, S., Sullivan, N., | [RFC8937] Cremers, C., Garratt, L., Smyshlyaev, S., Sullivan, N., | |||
and C. Wood, "Randomness Improvements for Security | and C. Wood, "Randomness Improvements for Security | |||
Protocols", RFC 8937, DOI 10.17487/RFC8937, October 2020, | Protocols", RFC 8937, DOI 10.17487/RFC8937, October 2020, | |||
<https://www.rfc-editor.org/info/rfc8937>. | <https://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/RFC9000, May 2021, | ||||
<https://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/RFC9147, April 2022, | ||||
<https://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/RFC9176, April | ||||
2022, <https://www.rfc-editor.org/info/rfc9176>. | ||||
[SECG] "Standards for Efficient Cryptography 1 (SEC 1)", May | [SECG] "Standards for Efficient Cryptography 1 (SEC 1)", May | |||
2009, <https://www.secg.org/sec1-v2.pdf>. | 2009, <https://www.secg.org/sec1-v2.pdf>. | |||
[SIGMA] Krawczyk, H., "SIGMA - The 'SIGn-and-MAc' Approach to | [SIGMA] Krawczyk, H., "SIGMA - The 'SIGn-and-MAc' Approach to | |||
Authenticated Diffie-Hellman and Its Use in the IKE- | Authenticated Diffie-Hellman and Its Use in the IKE- | |||
Protocols (Long version)", June 2003, | Protocols (Long version)", June 2003, | |||
<http://webee.technion.ac.il/~hugo/sigma-pdf.pdf>. | <https://webee.technion.ac.il/~hugo/sigma-pdf.pdf>. | |||
[SP-800-56A] | [SP-800-56A] | |||
Barker, E., Chen, L., Roginsky, A., Vassilev, A., and R. | Barker, E., Chen, L., Roginsky, A., Vassilev, A., and R. | |||
Davis, "Recommendation for Pair-Wise Key-Establishment | Davis, "Recommendation for Pair-Wise Key-Establishment | |||
Schemes Using Discrete Logarithm Cryptography", | Schemes Using Discrete Logarithm Cryptography", | |||
NIST Special Publication 800-56A Revision 3, April 2018, | NIST Special Publication 800-56A Revision 3, April 2018, | |||
<https://doi.org/10.6028/NIST.SP.800-56Ar3>. | <https://doi.org/10.6028/NIST.SP.800-56Ar3>. | |||
Appendix A. Use with OSCORE and Transfer over CoAP | [Thormarker21] | |||
Thormarker, E., "On using the same key pair for Ed25519 | ||||
This appendix describes how to select EDHOC connection identifiers | and an X25519 based KEM", April 2021, | |||
and derive an OSCORE security context when OSCORE is used with EDHOC, | <https://eprint.iacr.org/2021/509.pdf>. | |||
and how to transfer EDHOC messages over CoAP. | ||||
A.1. Selecting EDHOC Connection Identifier | ||||
This section specifies a rule for converting from EDHOC connection | ||||
identifier to OSCORE Sender/Recipient ID. (An identifier is Sender | ||||
ID or Recipient ID depending on from which endpoint is the point of | ||||
view, see Section 3.1 of [RFC8613].) | ||||
* If the EDHOC connection identifier is numeric, i.e., encoded as a | ||||
CBOR integer on the wire, it is converted to a (naturally byte- | ||||
string shaped) OSCORE Sender/Recipient ID equal to its CBOR | ||||
encoded form. | ||||
For example, a numeric C_R equal to 10 (0x0A in CBOR encoding) is | ||||
converted to a (typically client) Sender ID equal to 0x0A, while a | ||||
numeric C_I equal to -12 (0x2B in CBOR encoding) is converted to a | ||||
(typically client) Sender ID equal to 0x2B. | ||||
* If the EDHOC connection identifier is byte-valued, hence encoded | ||||
as a CBOR byte string on the wire, it is converted to an OSCORE | ||||
Sender/Recipient ID equal to the byte string. | ||||
For example, a byte-string valued C_R equal to 0xFF (0x41FF in CBOR | ||||
encoding) is converted to a (typically client) Sender ID equal to | ||||
0xFF. | ||||
Two EDHOC connection identifiers are called "equivalent" if and only | Appendix A. Use with OSCORE and Transfer over CoAP | |||
if, by applying the conversion above, they both result in the same | ||||
OSCORE Sender/Recipient ID. For example, the two EDHOC connection | ||||
identifiers with CBOR encoding 0x0A (numeric) and 0x410A (byte- | ||||
valued) are equivalent since they both result in the same OSCORE | ||||
Sender/Recipient ID 0x0A. | ||||
When EDHOC is used to establish an OSCORE security context, the | This appendix describes how to derive an OSCORE security context when | |||
connection identifiers C_I and C_R MUST NOT be equivalent. | OSCORE is used with EDHOC, and how to transfer EDHOC messages over | |||
Furthermore, in case of multiple OSCORE security contexts with | CoAP. | |||
potentially different endpoints, to facilitate retrieval of the | ||||
correct OSCORE security context, an endpoint SHOULD select an EDHOC | ||||
connection identifier that when converted to OSCORE Recipient ID does | ||||
not coincide with its other Recipient IDs. | ||||
A.2. Deriving the OSCORE Security Context | A.1. Deriving the OSCORE Security Context | |||
This section specifies how to use EDHOC output to derive the OSCORE | This section specifies how to use EDHOC output to derive the OSCORE | |||
security context. | security context. | |||
After successful processing of EDHOC message_3, Client and Server | After successful processing of EDHOC message_3, Client and Server | |||
derive Security Context parameters for OSCORE as follows (see | derive Security Context parameters for OSCORE as follows (see | |||
Section 3.2 of [RFC8613]): | Section 3.2 of [RFC8613]): | |||
* The Master Secret and Master Salt are derived by using the EDHOC- | * The Master Secret and Master Salt are derived by using the EDHOC- | |||
Exporter interface, see Section 4.3. | Exporter interface, see Section 4.2.1. | |||
The EDHOC Exporter Labels for deriving the OSCORE Master Secret and | The EDHOC Exporter Labels for deriving the OSCORE Master Secret and | |||
the OSCORE Master Salt, are "OSCORE_Master_Secret" and | the OSCORE Master Salt, are the uints 0 and 1, respectively. | |||
"OSCORE_Master_Salt", respectively. | ||||
The context parameter is h'' (0x40), the empty CBOR byte string. | The context parameter is h'' (0x40), the empty CBOR byte string. | |||
By default, key_length is the key length (in bytes) of the | By default, oscore_key_length is the key length (in bytes) of the | |||
application AEAD Algorithm of the selected cipher suite for the EDHOC | application AEAD Algorithm of the selected cipher suite for the EDHOC | |||
session. Also by default, salt_length has value 8. The Initiator | session. Also by default, oscore_salt_length has value 8. The | |||
and Responder MAY agree out-of-band on a longer key_length than the | Initiator and Responder MAY agree out-of-band on a longer | |||
default and on a different salt_length. | oscore_key_length than the default and on a different | |||
oscore_salt_length. | ||||
Master Secret = EDHOC-Exporter("OSCORE_Master_Secret", h'', key_length) | Master Secret = EDHOC-Exporter( 0, h'', oscore_key_length ) | |||
Master Salt = EDHOC-Exporter("OSCORE_Master_Salt", h'', salt_length) | Master Salt = EDHOC-Exporter( 1, h'', oscore_salt_length ) | |||
* The AEAD Algorithm is the application AEAD algorithm of the | * The AEAD Algorithm is the application AEAD algorithm of the | |||
selected cipher suite for the EDHOC session. | selected cipher suite for the EDHOC session. | |||
* The HKDF Algorithm is the one based on the application hash | * The HKDF Algorithm is the one based on the application hash | |||
algorithm of the selected cipher suite for the EDHOC session. For | algorithm of the selected cipher suite for the EDHOC session. For | |||
example, if SHA-256 is the application hash algorithm of the | example, if SHA-256 is the application hash algorithm of the | |||
selected cipher suite, HKDF SHA-256 is used as HKDF Algorithm in | selected cipher suite, HKDF SHA-256 is used as HKDF Algorithm in | |||
the OSCORE Security Context. | the OSCORE Security Context. | |||
* In case the Client is Initiator and the Server is Responder, the | * In case the Client is Initiator and the Server is Responder, the | |||
Client's OSCORE Sender ID and the Server's OSCORE Sender ID are | Client's OSCORE Sender ID and the Server's OSCORE Sender ID are | |||
determined from the EDHOC connection identifiers C_R and C_I for | determined from the EDHOC connection identifiers C_R and C_I for | |||
the EDHOC session, respectively, by applying the conversion in | the EDHOC session, respectively, by applying the conversion in | |||
Appendix A.1. The reverse applies in case the Client is the | Section 3.3.3. The reverse applies in case the Client is the | |||
Responder and the Server is the Initiator. | Responder and the Server is the Initiator. | |||
Client and Server use the parameters above to establish an OSCORE | Client and Server use the parameters above to establish an OSCORE | |||
Security Context, as per Section 3.2.1 of [RFC8613]. | Security Context, as per Section 3.2.1 of [RFC8613]. | |||
From then on, Client and Server retrieve the OSCORE protocol state | From then on, Client and Server retrieve the OSCORE protocol state | |||
using the Recipient ID, and optionally other transport information | using the Recipient ID, and optionally other transport information | |||
such as the 5-tuple. | such as the 5-tuple. | |||
A.3. Transferring EDHOC over CoAP | A.2. Transferring EDHOC over CoAP | |||
This section specifies one instance for how EDHOC can be transferred | This section specifies one instance for how EDHOC can be transferred | |||
as an exchange of CoAP [RFC7252] messages. CoAP provides a reliable | as an exchange of CoAP [RFC7252] messages. CoAP provides a reliable | |||
transport that can preserve packet ordering and handle message | transport that can preserve packet ordering and handle message | |||
duplication. CoAP can also perform fragmentation and protect against | duplication. CoAP can also perform fragmentation and protect against | |||
denial-of-service attacks. The underlying CoAP transport should be | denial-of-service attacks. The underlying CoAP transport should be | |||
used in reliable mode, in particular when fragmentation is used, to | used in reliable mode, in particular when fragmentation is used, to | |||
avoid, e.g., situations with hanging endpoints waiting for each | avoid, e.g., situations with hanging endpoints waiting for each | |||
other. | other. | |||
By default, the CoAP client is the Initiator and the CoAP server is | By default, the CoAP client is the Initiator and the CoAP server is | |||
the Responder, but the roles SHOULD be chosen to protect the most | the Responder, but the roles SHOULD be chosen to protect the most | |||
sensitive identity, see Section 8. According to this specification, | sensitive identity, see Section 8. Client applications can use the | |||
EDHOC is transferred in POST requests and 2.04 (Changed) responses to | resource type "core.edhoc" to discover a server's EDHOC resource, | |||
the Uri-Path: "/.well-known/edhoc". An application may define its | i.e., where to send a request for executing the EDHOC protocol, see | |||
own path that can be discovered, e.g., using resource directory | Section 9.10. According to this specification, EDHOC is transferred | |||
[I-D.ietf-core-resource-directory]. | in POST requests and 2.04 (Changed) responses to the Uri-Path: | |||
"/.well-known/edhoc", see Section 9.7. An application may define its | ||||
own path that can be discovered, e.g., using a resource directory | ||||
[RFC9176]. | ||||
By default, the message flow is as follows: EDHOC message_1 is sent | By default, the message flow is as follows: EDHOC message_1 is sent | |||
in the payload of a POST request from the client to the server's | in the payload of a POST request from the client to the server's | |||
resource for EDHOC. EDHOC message_2 or the EDHOC error message is | resource for EDHOC. EDHOC message_2 or the EDHOC error message is | |||
sent from the server to the client in the payload of a 2.04 (Changed) | sent from the server to the client in the payload of the response, in | |||
response. EDHOC message_3 or the EDHOC error message is sent from | the former case with response code 2.04 (Changed), in the latter with | |||
the client to the server's resource in the payload of a POST request. | response code as specified in Appendix A.2.1. EDHOC message_3 or the | |||
If needed, an EDHOC error message is sent from the server to the | EDHOC error message is sent from the client to the server's resource | |||
client in the payload of a 2.04 (Changed) response. Alternatively, | in the payload of a POST request. If EDHOC message_4 is used, or in | |||
if EDHOC message_4 is used, it is sent from the server to the client | case of an error message, it is sent from the server to the client in | |||
in the payload of a 2.04 (Changed) response analogously to message_2. | the payload of the response, with response codes analogously to | |||
message_2. In case of an error message in response to message_4, it | ||||
is sent analogously to errors in response to message_2. | ||||
In order to correlate a message received from a client to a message | In order for the server to correlate a message received from a client | |||
previously sent by the server, messages sent by the client are | to a message previously sent in the same EDHOC session over CoAP, | |||
prepended with the CBOR serialization of the connection identifier | messages sent by the client are prepended with the CBOR serialization | |||
which the server has chosen. This applies independently of if the | of the connection identifier which the server has chosen. This | |||
CoAP server is Responder or Initiator. For the default case when the | applies independently of if the CoAP server is Responder or | |||
server is Responder, the prepended connection identifier is C_R, and | Initiator. | |||
C_I if the server is Initiator. If message_1 is sent to the server, | ||||
the CBOR simple value "true" (0xf5) is sent in its place (given that | ||||
the server has not selected C_R yet). | ||||
These identifiers are encoded in CBOR and thus self-delimiting. They | * For the default case when the server is Responder, message_3 is | |||
are sent in front of the actual EDHOC message, and only the part of | sent from the client prepended with the identifier C_R. In this | |||
the body following the identifier is used for EDHOC processing. | case message_1 is also sent by the client, and to indicate that | |||
this is a new EDHOC session it is prepended with a dummy | ||||
identifier, the CBOR simple value "true" (0xf5), since the server | ||||
has not selected C_R yet. See Figure 13. | ||||
Consequently, the application/edhoc media type does not apply to | * In the case when the server is Initiator, message_2 (and | |||
these messages; their media type is unnamed. | message_4, if present) is sent from the client prepended with the | |||
identifier C_I. See Figure 14. | ||||
The prepended identifiers are encoded in CBOR and thus self- | ||||
delimiting. The integer representation of identifiers described in | ||||
Section 3.3.2 is used, when applicable. They are sent in front of | ||||
the actual EDHOC message to keep track of messages in an EDHOC | ||||
session, and only the part of the body following the identifier is | ||||
used for EDHOC processing. In particular, the connection identifiers | ||||
within the EDHOC messages are not impacted by the prepended | ||||
identifiers. | ||||
The application/edhoc+cbor-seq media type does not apply to these | ||||
messages; their media type is application/cid-edhoc+cbor-seq. | ||||
An example of a successful EDHOC exchange using CoAP is shown in | An example of a successful EDHOC exchange using CoAP is shown in | |||
Figure 10. In this case the CoAP Token enables correlation on the | Figure 13. In this case the CoAP Token enables correlation on the | |||
Initiator side, and the prepended C_R enables correlation on the | Initiator side, and the prepended C_R enables correlation on the | |||
Responder (server) side. | Responder (server) side. | |||
Client Server | Client Server | |||
| | | | | | |||
+--------->| Header: POST (Code=0.02) | +--------->| Header: POST (Code=0.02) | |||
| POST | Uri-Path: "/.well-known/edhoc" | | POST | Uri-Path: "/.well-known/edhoc" | |||
| | Payload: true, EDHOC message_1 | | | Content-Format: application/cid-edhoc+cbor-seq | |||
| | | | | Payload: true, EDHOC message_1 | |||
|<---------+ Header: 2.04 Changed | | | | |||
| 2.04 | Content-Format: application/edhoc | |<---------+ Header: 2.04 Changed | |||
| | Payload: EDHOC message_2 | | 2.04 | Content-Format: application/edhoc+cbor-seq | |||
| | | | | Payload: EDHOC message_2 | |||
+--------->| Header: POST (Code=0.02) | | | | |||
| POST | Uri-Path: "/.well-known/edhoc" | +--------->| Header: POST (Code=0.02) | |||
| | Payload: C_R, EDHOC message_3 | | POST | Uri-Path: "/.well-known/edhoc" | |||
| | | | | Content-Format: application/cid-edhoc+cbor-seq | |||
|<---------+ Header: 2.04 Changed | | | Payload: C_R, EDHOC message_3 | |||
| 2.04 | | | | | |||
| | | |<---------+ Header: 2.04 Changed | |||
| 2.04 | Content-Format: application/edhoc+cbor-seq | ||||
| | Payload: EDHOC message_4 | ||||
| | | ||||
Figure 10: Transferring EDHOC in CoAP when the Initiator is CoAP | Figure 13: Example of transferring EDHOC in CoAP when the | |||
Client | Initiator is CoAP client. The optional message_4 is included in | |||
this example, without which that message needs no payload. | ||||
The exchange in Figure 10 protects the client identity against active | The exchange in Figure 13 protects the client identity against active | |||
attackers and the server identity against passive attackers. | attackers and the server identity against passive attackers. | |||
An alternative exchange that protects the server identity against | An alternative exchange that protects the server identity against | |||
active attackers and the client identity against passive attackers is | active attackers and the client identity against passive attackers is | |||
shown in Figure 11. In this case the CoAP Token enables the | shown in Figure 14. In this case the CoAP Token enables the | |||
Responder to correlate message_2 and message_3, and the prepended C_I | Responder to correlate message_2 and message_3, and the prepended C_I | |||
enables correlation on the Initiator (server) side. If EDHOC | enables correlation on the Initiator (server) side. If EDHOC | |||
message_4 is used, C_I is prepended, and it is transported with CoAP | message_4 is used, C_I is prepended, and it is transported with CoAP | |||
in the payload of a POST request with a 2.04 (Changed) response. | in the payload of a POST request with a 2.04 (Changed) response. | |||
Client Server | Client Server | |||
| | | | | | |||
+--------->| Header: POST (Code=0.02) | +--------->| Header: POST (Code=0.02) | |||
| POST | Uri-Path: "/.well-known/edhoc" | | POST | Uri-Path: "/.well-known/edhoc" | |||
| | | | | | |||
|<---------+ Header: 2.04 Changed | |<---------+ Header: 2.04 Changed | |||
| 2.04 | Content-Format: application/edhoc | | 2.04 | Content-Format: application/edhoc+cbor-seq | |||
| | Payload: EDHOC message_1 | | | Payload: EDHOC message_1 | |||
| | | | | | |||
+--------->| Header: POST (Code=0.02) | +--------->| Header: POST (Code=0.02) | |||
| POST | Uri-Path: "/.well-known/edhoc" | | POST | Uri-Path: "/.well-known/edhoc" | |||
| | Payload: C_I, EDHOC message_2 | | | Content-Format: application/cid-edhoc+cbor-seq | |||
| | | | | Payload: C_I, EDHOC message_2 | |||
|<---------+ Header: 2.04 Changed | | | | |||
| 2.04 | Content-Format: application/edhoc | |<---------+ Header: 2.04 Changed | |||
| | Payload: EDHOC message_3 | | 2.04 | Content-Format: application/edhoc+cbor-seq | |||
| | | | | Payload: EDHOC message_3 | |||
| | | ||||
Figure 11: Transferring EDHOC in CoAP when the Initiator is CoAP | Figure 14: Example of transferring EDHOC in CoAP when the | |||
Server | Initiator is CoAP server. | |||
To protect against denial-of-service attacks, the CoAP server MAY | To protect against denial-of-service attacks, the CoAP server MAY | |||
respond to the first POST request with a 4.01 (Unauthorized) | respond to the first POST request with a 4.01 (Unauthorized) | |||
containing an Echo option [RFC9175]. This forces the initiator to | containing an Echo option [RFC9175]. This forces the Initiator to | |||
demonstrate its reachability at its apparent network address. If | demonstrate its reachability at its apparent network address. If | |||
message fragmentation is needed, the EDHOC messages may be fragmented | message fragmentation is needed, the EDHOC messages may be fragmented | |||
using the CoAP Block-Wise Transfer mechanism [RFC7959]. | using the CoAP Block-Wise Transfer mechanism [RFC7959]. | |||
EDHOC does not restrict how error messages are transported with CoAP, | EDHOC does not restrict how error messages are transported with CoAP, | |||
as long as the appropriate error message can to be transported in | as long as the appropriate error message can to be transported in | |||
response to a message that failed (see Section 6). EDHOC error | response to a message that failed (see Section 6). EDHOC error | |||
messages transported with CoAP are carried in the payload. | messages transported with CoAP are carried in the payload. | |||
A.3.1. Transferring EDHOC and OSCORE over CoAP | A.2.1. Transferring EDHOC and OSCORE over CoAP | |||
When using EDHOC over CoAP for establishing an OSCORE Security | When using EDHOC over CoAP for establishing an OSCORE Security | |||
Context, EDHOC error messages sent as CoAP responses MUST be sent in | Context, EDHOC error messages sent as CoAP responses MUST be sent in | |||
the payload of error responses, i.e., they MUST specify a CoAP error | the payload of error responses, i.e., they MUST specify a CoAP error | |||
response code. In particular, it is RECOMMENDED that such error | response code. In particular, it is RECOMMENDED that such error | |||
responses have response code either 4.00 (Bad Request) in case of | 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 | 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 | (Internal Server Error) in case of server error (e.g., due to failure | |||
in deriving EDHOC key material). The Content-Format of the error | in deriving EDHOC keying material). The Content-Format of the error | |||
response MUST be set to application/edhoc. | response MUST be set to application/edhoc+cbor-seq, see Section 9.9. | |||
A method for combining EDHOC and OSCORE protocols in two round-trips | A method for combining EDHOC and OSCORE protocols in two round-trips | |||
is specified in [I-D.ietf-core-oscore-edhoc]. | is specified in [I-D.ietf-core-oscore-edhoc]. That specification | |||
also contains conversion from OSCORE Sender/Recipient IDs to EDHOC | ||||
connection identifiers, web-linking and target attributes for | ||||
discovering of EDHOC resources. | ||||
Appendix B. Compact Representation | Appendix B. Compact Representation | |||
As described in Section 4.2 of [RFC6090] the x-coordinate of an | As described in Section 4.2 of [RFC6090] the x-coordinate of an | |||
elliptic curve public key is a suitable representative for the entire | elliptic curve public key is a suitable representative for the entire | |||
point whenever scalar multiplication is used as a one-way function. | point whenever scalar multiplication is used as a one-way function. | |||
One example is ECDH with compact output, where only the x-coordinate | One example is ECDH with compact output, where only the x-coordinate | |||
of the computed value is used as the shared secret. | of the computed value is used as the shared secret. | |||
This section defines a format for compact representation based on the | This section defines a format for compact representation based on the | |||
Elliptic-Curve-Point-to-Octet-String Conversion defined in | Elliptic-Curve-Point-to-Octet-String Conversion defined in | |||
Section 2.3.3 of [SECG]. Using the notation from [SECG], the output | Section 2.3.3 of [SECG]. In EDHOC, compact representation is used | |||
is an octet string of length ceil( (log2 q) / 8 ). See [SECG] for a | for the ephemeral public keys (G_X and G_Y), see Section 3.7. Using | |||
definition of q, M, X, xp, and ~yp. The steps in Section 2.3.3 of | the notation from [SECG], the output is an octet string of length | |||
[SECG] are replaced by: | ceil( (log2 q) / 8 ). See [SECG] for a definition of q, M, X, xp, | |||
and ~yp. The steps in Section 2.3.3 of [SECG] are replaced by: | ||||
1. Convert the field element xp to an octet string X of length ceil( | 1. Convert the field element xp to an octet string X of length ceil( | |||
(log2 q) / 8 ) octets using the conversion routine specified in | (log2 q) / 8 ) octets using the conversion routine specified in | |||
Section 2.3.5 of [SECG]. | Section 2.3.5 of [SECG]. | |||
2. Output M = X | 2. Output M = X | |||
The encoding of the point at infinity is not supported. Compact | The encoding of the point at infinity is not supported. Compact | |||
representation does not change any requirements on validation. If a | representation does not change any requirements on validation. If a | |||
y-coordinate is required for validation or compatibily with APIs the | y-coordinate is required for validation or compatibility with APIs | |||
value ~yp SHALL be set to zero. For such use, the compact | the value ~yp SHALL be set to zero. For such use, the compact | |||
representation can be transformed into the SECG point compressed | representation can be transformed into the SECG point compressed | |||
format by prepending it with the single byte 0x02 (i.e., M = 0x02 || | format by prepending it with the single byte 0x02 (i.e., M = 0x02 || | |||
X). | X). | |||
Using compact representation have some security benefits. An | Using compact representation have some security benefits. An | |||
implementation does not need to check that the point is not the point | implementation does not need to check that the point is not the point | |||
at infinity (the identity element). Similarly, as not even the sign | at infinity (the identity element). Similarly, as not even the sign | |||
of the y-coordinate is encoded, compact representation trivially | of the y-coordinate is encoded, compact representation trivially | |||
avoids so called "benign malleability" attacks where an attacker | avoids so called "benign malleability" attacks where an attacker | |||
changes the sign, see [SECG]. | changes the sign, see [SECG]. | |||
skipping to change at page 68, line 26 ¶ | skipping to change at page 71, line 26 ¶ | |||
CBOR data items are encoded to or decoded from byte strings using a | CBOR data items are encoded to or decoded from byte strings using a | |||
type-length-value encoding scheme, where the three highest order bits | type-length-value encoding scheme, where the three highest order bits | |||
of the initial byte contain information about the major type. CBOR | of the initial byte contain information about the major type. CBOR | |||
supports several different types of data items, in addition to | supports several different types of data items, in addition to | |||
integers (int, uint), simple values, byte strings (bstr), and text | integers (int, uint), simple values, byte strings (bstr), and text | |||
strings (tstr), CBOR also supports arrays [] of data items, maps {} | strings (tstr), CBOR also supports arrays [] of data items, maps {} | |||
of pairs of data items, and sequences [RFC8742] of data items. Some | of pairs of data items, and sequences [RFC8742] of data items. Some | |||
examples are given below. | examples are given below. | |||
The EDHOC specification sometimes use CDDL names in CBOR dignostic | The EDHOC specification sometimes use CDDL names in CBOR diagnostic | |||
notation as in e.g., << ID_CRED_R, ? EAD_2 >>. This means that EAD_2 | notation as in e.g., << ID_CRED_R, ? EAD_2 >>. This means that EAD_2 | |||
is optional and that ID_CRED_R and EAD_2 should be substituted with | is optional and that ID_CRED_R and EAD_2 should be substituted with | |||
their values before evaluation. I.e., if ID_CRED_R = { 4 : h'' } and | their values before evaluation. I.e., if ID_CRED_R = { 4 : h'' } and | |||
EAD_2 is omitted then << ID_CRED_R, ? EAD_2 >> = << { 4 : h'' } >>, | EAD_2 is omitted then << ID_CRED_R, ? EAD_2 >> = << { 4 : h'' } >>, | |||
which encodes to 0x43a10440. | which encodes to 0x43a10440. | |||
For a complete specification and more examples, see [RFC8949] and | For a complete specification and more examples, see [RFC8949] and | |||
[RFC8610]. We recommend implementors to get used to CBOR by using | [RFC8610]. We recommend implementors to get used to CBOR by using | |||
the CBOR playground [CborMe]. | the CBOR playground [CborMe]. | |||
skipping to change at page 70, line 9 ¶ | skipping to change at page 73, line 9 ¶ | |||
------------------------------------------------------------------ | ------------------------------------------------------------------ | |||
C.2. CDDL Definitions | C.2. CDDL Definitions | |||
This sections compiles the CDDL definitions for ease of reference. | This sections compiles the CDDL definitions for ease of reference. | |||
suites = [ 2* int ] / int | suites = [ 2* int ] / int | |||
ead = 1* ( | ead = 1* ( | |||
ead_label : int, | ead_label : int, | |||
ead_value : any, | ead_value : bstr, | |||
) | ) | |||
message_1 = ( | message_1 = ( | |||
METHOD : int, | METHOD : int, | |||
SUITES_I : suites, | SUITES_I : suites, | |||
G_X : bstr, | G_X : bstr, | |||
C_I : bstr / int, | C_I : bstr / -24..23, | |||
? EAD_1 : ead, | ? EAD_1 : ead, | |||
) | ) | |||
message_2 = ( | message_2 = ( | |||
G_Y_CIPHERTEXT_2 : bstr, | G_Y_CIPHERTEXT_2 : bstr, | |||
C_R : bstr / int, | C_R : bstr / -24..23, | |||
) | ) | |||
message_3 = ( | message_3 = ( | |||
CIPHERTEXT_3 : bstr, | CIPHERTEXT_3 : bstr, | |||
) | ) | |||
message_4 = ( | message_4 = ( | |||
CIPHERTEXT_4 : bstr, | CIPHERTEXT_4 : bstr, | |||
) | ) | |||
error = ( | error = ( | |||
ERR_CODE : int, | ERR_CODE : int, | |||
ERR_INFO : any, | ERR_INFO : any, | |||
) | ) | |||
info = ( | info = ( | |||
transcript_hash : bstr, | ||||
label : tstr, | label : tstr, | |||
context : bstr, | context : bstr, | |||
length : uint, | length : uint, | |||
) | ) | |||
C.3. COSE | C.3. COSE | |||
CBOR Object Signing and Encryption (COSE) | CBOR Object Signing and Encryption (COSE) | |||
[I-D.ietf-cose-rfc8152bis-struct] describes how to create and process | [I-D.ietf-cose-rfc8152bis-struct] describes how to create and process | |||
signatures, message authentication codes, and encryption using CBOR. | signatures, message authentication codes, and encryption using CBOR. | |||
skipping to change at page 72, line 19 ¶ | skipping to change at page 75, line 19 ¶ | |||
When ID_CRED_x does not contain the actual credential, it may be very | When ID_CRED_x does not contain the actual credential, it may be very | |||
short, e.g., if the endpoints have agreed to use a key identifier | short, e.g., if the endpoints have agreed to use a key identifier | |||
parameter 'kid': | parameter 'kid': | |||
* ID_CRED_x = { 4 : key_id_x }, where key_id_x : kid, for x = I or | * ID_CRED_x = { 4 : key_id_x }, where key_id_x : kid, for x = I or | |||
R. | R. | |||
Note that a COSE header map can contain several header parameters, | Note that a COSE header map can contain several header parameters, | |||
for example { x5u, x5t } or { kid, kid_context }. | for example { x5u, x5t } or { kid, kid_context }. | |||
ID_CRED_x MAY also identify the authentication credential by value. | ID_CRED_x MAY also identify the credential by value. For example, a | |||
For example, a certificate chain can be transported in ID_CRED_x with | certificate chain can be transported in ID_CRED_x with COSE header | |||
COSE header parameter c5c or x5chain, defined in | parameter c5c or x5chain, defined in | |||
[I-D.ietf-cose-cbor-encoded-cert] and [I-D.ietf-cose-x509] and | [I-D.ietf-cose-cbor-encoded-cert] and [I-D.ietf-cose-x509] and | |||
credentials of type CWT and CCS can be transported with the COSE | credentials of type CWT and CCS can be transported with the COSE | |||
header parameters registered in Section 9.6. | header parameters registered in Section 9.6. | |||
Appendix D. Applicability Template | Appendix D. Authentication Related Verifications | |||
This appendix contains a rudimentary example of an applicability | EDHOC performs certain authentication related operations, see | |||
statement, see Section 3.9. | Section 3.5, but in general it is necessary to make additional | |||
verifications beyond EDHOC message processing. What verifications | ||||
are needed depend on the deployment, in particular the trust model | ||||
and the security policies, but most commonly it can be expressed in | ||||
terms of verifications of credential content. | ||||
For use of EDHOC in the XX protocol, the following assumptions are | EDHOC assumes the existence of mechanisms (certification authority or | |||
other trusted third party, pre-provisioning, etc.) for generating and | ||||
distributing authentication credentials and other credentials, as | ||||
well as the existence of trust anchors (CA certificates, trusted | ||||
public keys, etc.). For example, a public key certificate or CWT may | ||||
rely on a trusted third party whose public key is pre-provisioned, | ||||
whereas a CCS or a self-signed certificate/CWT may be used when trust | ||||
in the public key can be achieved by other means, or in the case of | ||||
trust-on-first-use, see Appendix D.5. | ||||
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 | ||||
The authentication credential may contain, in addition to the | ||||
authentication key, other parameters that needs to be verified. For | ||||
example: | ||||
* In X.509 and C509 certificates, signature keys typically have key | ||||
usage "digitalSignature" 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 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 which | ||||
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 which 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 to 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 | ||||
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. Each endpoint thus 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 "subjectAltName" fields, and | ||||
in the case of CWT or CCS includes the "sub" claim. | ||||
(While the SIGMA paper only focuses on the identity, the same | ||||
principle is true for other information such as policies associated | ||||
to 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 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 trust anchor to 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, 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 8.8. Some use cases may be served by short- | ||||
lived credentials, for example, where the validity of the credential | ||||
is on par with with the interval between revocation checks. But, in | ||||
general, credential life time and revokation checking are | ||||
complementary measures to control credential status. Revocation | ||||
information may be transported as External Authentication Data (EAD), | ||||
see Appendix E. | ||||
D.5. Trust-on-first-use | ||||
TBD | ||||
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 external authorization related 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 [I-D.selander-ace-ake-authz]. | ||||
* Another example is remote attestation, requested in EAD_2, and an | ||||
Entity Attestation Token (EAT, [I-D.ietf-rats-eat]) returned in | ||||
EAD_3. | ||||
* A third example is certificate enrolment, where a Certificate | ||||
Signing Request (CSR, [RFC2986]) is included EAD_3, and the issued | ||||
public key certificate (X.509 [RFC5280], C509 | ||||
[I-D.ietf-cose-cbor-encoded-cert]) 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 enrolment, etc.). The security properties of the EAD | ||||
fields (after EDHOC processing) are discussed in Section 8.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 | ||||
related information like assertions and revocation information, | ||||
transported in EAD fields may provide input about trust anchors or | ||||
validity of credentials relevant to the authentication processing. | ||||
The EAD fields (like ID_CRED fields) are therefore made available to | ||||
the application before the message is verified, see details of | ||||
message processing in Section 5. In the first example above, a | ||||
voucher in EAD_2 made available to the application can enable the | ||||
Initiator to verify the identity or public key of the Responder | ||||
before verifying the signature. An application allowing EAD fields | ||||
containing authentication information thus may need to handle | ||||
authentication related verifications associated with EAD processing. | ||||
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_3 is not started by the Responder | ||||
before EDHOC has successfully verified message_3 and proven the | ||||
possession of the private key of the Initiator. | ||||
The security application may reuse EDHOC protocol fields which | ||||
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_I). The application may use the ephemeral | ||||
public keys G_X and G_Y, as ephemeral keys or as nonces, see | ||||
[I-D.selander-ace-ake-authz]. | ||||
The processing of (ead_label, ead_value) by the security application | ||||
needs to be described in the specification where the ead_label is | ||||
registered, see Section 9.5, including the ead_value for each message | ||||
and actions in case of errors. An application may support multiple | ||||
security applications that make use of EAD, which may result in | ||||
multiple (ead_label, ead_value) pairs in one EAD field, see | ||||
Section 3.8. Any dependencies on security applications with | ||||
previously registered EAD fields needs to be documented, and the | ||||
processing needs to consider their simultaneous use. | ||||
Since data carried in EAD may not be protected, or be 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 which uses this data, see | ||||
Section 8.5. The content in an EAD field may impact the security | ||||
properties provided by EDHOC. Security applications making use of | ||||
the EAD fields 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: | made: | |||
1. Transfer in CoAP as specified in Appendix A.3 with requests | 1. Transfer in CoAP as specified in Appendix A.2 with requests | |||
expected by the CoAP server (= Responder) at /app1-edh, no | expected by the CoAP server (= Responder) at /app1-edh, no | |||
Content-Format needed. | Content-Format needed. | |||
2. METHOD = 1 (I uses signature key, R uses static DH key.) | 2. METHOD = 1 (I uses signature key, R uses static DH key.) | |||
3. CRED_I is an IEEE 802.1AR IDevID encoded as a C509 certificate of | 3. CRED_I is an IEEE 802.1AR IDevID encoded as a C509 certificate of | |||
type 0 [I-D.ietf-cose-cbor-encoded-cert]. | type 0 [I-D.ietf-cose-cbor-encoded-cert]. | |||
* R acquires CRED_I out-of-band, indicated in EAD_1. | * R acquires CRED_I out-of-band, indicated in EAD_1. | |||
* ID_CRED_I = {4: h''} is a 'kid' with value empty CBOR byte | * ID_CRED_I = {4: h''} is a 'kid' with value empty CBOR byte | |||
string. | string. | |||
4. CRED_R is a CCS of type OKP as specified in Section 3.5.3. | 4. CRED_R is a CCS of type OKP as specified in Section 3.5.2. | |||
* The CBOR map has parameters 1 (kty), -1 (crv), and -2 | * The CBOR map has parameters 1 (kty), -1 (crv), and -2 | |||
(x-coordinate). | (x-coordinate). | |||
* ID_CRED_R is {TBD2 : CCS}. Editor's note: TBD2 is the COSE | * ID_CRED_R is {TBD2 : CCS}. Editor's note: TBD2 is the COSE | |||
header parameter value of 'kccs', see Section 9.6 | header parameter value of 'kccs', see Section 9.6 | |||
5. External authorization data is defined and processed as specified | 5. External authorization data is defined and processed as specified | |||
in [I-D.selander-ace-ake-authz]. | in [I-D.selander-ace-ake-authz]. | |||
6. EUI-64 used as identity of endpoint. | 6. EUI-64 is used as the identity of the endpoint (see example in | |||
Section 3.5.2). | ||||
7. No use of message_4: the application sends protected messages | 7. No use of message_4: the application sends protected messages | |||
from R to I. | from R to I. | |||
Appendix E. EDHOC Message Deduplication | Appendix G. EDHOC Message Deduplication | |||
EDHOC by default assumes that message duplication is handled by the | EDHOC by default assumes that message duplication is handled by the | |||
transport, in this section exemplified with CoAP. | transport, in this section exemplified with CoAP. | |||
Deduplication of CoAP messages is described in Section 4.5 of | Deduplication of CoAP messages is described in Section 4.5 of | |||
[RFC7252]. This handles the case when the same Confirmable (CON) | [RFC7252]. This handles the case when the same Confirmable (CON) | |||
message is received multiple times due to missing acknowledgement on | message is received multiple times due to missing acknowledgement on | |||
CoAP messaging layer. The recommended processing in [RFC7252] is | CoAP messaging layer. The recommended processing in [RFC7252] is | |||
that the duplicate message is acknowledged (ACK), but the received | that the duplicate message is acknowledged (ACK), but the received | |||
message is only processed once by the CoAP stack. | message is only processed once by the CoAP stack. | |||
Message deduplication is resource demanding and therefore not | Message deduplication is resource demanding and therefore not | |||
supported in all CoAP implementations. Since EDHOC is targeting | supported in all CoAP implementations. Since EDHOC is targeting | |||
constrained environments, it is desirable that EDHOC can optionally | constrained environments, it is desirable that EDHOC can optionally | |||
support transport layers which does not handle message duplication. | support transport layers which do not handle message duplication. | |||
Special care is needed to avoid issues with duplicate messages, see | Special care is needed to avoid issues with duplicate messages, see | |||
Section 5.1. | Section 5.1. | |||
The guiding principle here is similar to the deduplication processing | The guiding principle here is similar to the deduplication processing | |||
on CoAP messaging layer: a received duplicate EDHOC message SHALL NOT | on CoAP messaging layer: a received duplicate EDHOC message SHALL NOT | |||
result in a response consisting of another instance of the next EDHOC | result in another instance of the next EDHOC message. The result MAY | |||
message. The result MAY be that a duplicate EDHOC response is sent, | be that a duplicate next EDHOC message is sent, provided it is still | |||
provided it is still relevant with respect the current protocol | relevant with respect to the current protocol state. In any case, | |||
state. In any case, the received message MUST NOT be processed more | the received message MUST NOT be processed more than once in the same | |||
than once in the same EDHOC session. This is called "EDHOC message | EDHOC session. This is called "EDHOC message deduplication". | |||
deduplication". | ||||
An EDHOC implementation MAY store the previously sent EDHOC message | An EDHOC implementation MAY store the previously sent EDHOC message | |||
to be able to resend it. An EDHOC implementation MAY keep the | to be able to resend it. | |||
protocol state to be able to recreate the previously sent EDHOC | ||||
message and resend it. 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_LIFETIME (see Section 4.8.2 of [RFC7252]). | ||||
Note that the requirements in Section 5.1 still apply because | In principle, if the EDHOC implementation would deterministically | |||
duplicate messages are not processed by the EDHOC state machine: | regenerate the identical EDHOC message previously sent, it would be | |||
possible to instead store the protocol state to be able to recreate | ||||
and resend the previously sent EDHOC message. However, even if the | ||||
protocol state is fixed, the message generation may introduce | ||||
differences which compromises security. For example, in the | ||||
generation of message_3, if I is performing a (non-deterministic) | ||||
ECDSA signature (say, method 0 or 1, cipher suite 2 or 3) then | ||||
PLAINTEXT_3 is randomized, but K_3 and IV_3 are the same, leading to | ||||
a key and nonce reuse. | ||||
* EDHOC messages SHALL be processed according to the current | The EDHOC implementation MUST NOT store previous protocol state and | |||
protocol state. | regenerate an EDHOC message if there is a risk that the same key and | |||
IV are used for two (or more) distinct messages. | ||||
* Different instances of the same message MUST NOT be processed in | The previous message or protocol state MUST NOT be kept longer than | |||
one session. | what is required for retransmission, for example, in the case of CoAP | |||
transport, no longer than the EXCHANGE_LIFETIME (see Section 4.8.2 of | ||||
[RFC7252]). | ||||
Appendix F. Transports Not Natively Providing Correlation | Appendix H. Transports Not Natively Providing Correlation | |||
Protocols that do not natively provide full correlation between a | Protocols that do not natively provide full correlation between a | |||
series of messages can send the C_I and C_R identifiers along as | series of messages can send the C_I and C_R identifiers along as | |||
needed. | needed. | |||
The transport over CoAP (Appendix A.3) can serve as a blueprint for | The transport over CoAP (Appendix A.2) can serve as a blueprint for | |||
other server-client protocols: The client prepends the C_x which the | other server-client protocols: The client prepends the C_x which the | |||
server selected (or, for message 1, the CBOR simple value 'true' | server selected (or, for message_1, the CBOR simple value 'true' | |||
which is not a valid C_x) to any request message it sends. The | which is not a valid C_x) to any request message it sends. The | |||
server does not send any such indicator, as responses are matched to | server does not send any such indicator, as responses are matched to | |||
request by the client-server protocol design. | request by the client-server protocol design. | |||
Protocols that do not provide any correlation at all can prescribe | Protocols that do not provide any correlation at all can prescribe | |||
prepending of the peer's chosen C_x to all messages. | prepending of the peer's chosen C_x to all messages. | |||
Appendix G. Change Log | Appendix I. Change Log | |||
RFC Editor: Please remove this appendix. | RFC Editor: Please remove this appendix. | |||
* From -13 to -14 | ||||
- Merge of section 1.1 and 1.2 | ||||
- Connection and key identifiers restricted to be byte strings | ||||
- Representation of byte strings as one-byte CBOR ints (-24..23) | ||||
- Simplified mapping between EDHOC and OSCORE identifiers | ||||
- Rewrite of 3.5 | ||||
o Clarification of authentication related operations performed | ||||
by EDHOC | ||||
o Authentication related verifications, including old section | ||||
3.5.1, moved to new appendix D | ||||
- Rewrite of 3.8 | ||||
o Move content about use of EAD to new appendix E | ||||
o ead_value changed to bstr | ||||
- EDHOC-KDF updated | ||||
o transcript_hash argument removed | ||||
o TH included in context argument | ||||
o label argument is now type uint, all labels replaced | ||||
- Key schedule updated | ||||
o New salts derived to avoid reuse of same key with expand and | ||||
extract | ||||
o PRK_4x3m renamed PRK_4e3m | ||||
o K_4 and IV_4 derived from PRK_4e3m | ||||
o New PRK: PRK_out derived from PRK_4e3m and TH_4 | ||||
o Clarified main output of EDHOC is the shared secret PRK_out | ||||
o Exporter defined by EDHOC-KDF and new PRK PRK_exporter | ||||
derived from PRK_out | ||||
o Key update defined by Expand instead of Extract | ||||
- All applications of EDHOC-KDF in one place | ||||
- Update of processing | ||||
o EAD and ID_CRED passed to application when available | ||||
o identity verification and credential retrieval omitted in | ||||
protocol description | ||||
o Transcript hash defined by plaintext messages instead of | ||||
ciphertext | ||||
o Changed order of input to TH_2 | ||||
o Removed general G_X checking against selfie-attacks | ||||
- Support for padding of plaintext | ||||
- Updated compliance requirements | ||||
- Updated security considerations | ||||
o Updated and more clear requirements on MAC length | ||||
o Clarification of key confirmation | ||||
o Forbid use of same key for signature and static DH | ||||
- Updated appendix on message deduplication | ||||
- Clarifications of | ||||
o connection identifiers | ||||
o cipher suites, including negotiation | ||||
o EAD | ||||
o Error messages | ||||
- Updated media types | ||||
- Applicability template renamed application profile | ||||
- Editorials | ||||
* From -12 to -13 | ||||
- no changes | ||||
* From -12: | ||||
- Shortened labels to derive OSCORE key and salt | ||||
- ead_value changed to bstr | ||||
- Removed general G_X checking against selfie-attacks | ||||
- Updated and more clear requirements on MAC length | ||||
- Clarifications from Kathleen, Stephen, Marco, Sean, Stefan, | ||||
- Authentication Related Verifications moved to appendix | ||||
- Updated MTI section and cipher suite | ||||
- Updated security considerations | ||||
* From -11 to -12: | * From -11 to -12: | |||
- Clarified applicability to KEMs | - Clarified applicability to KEMs | |||
- Clarified use of COSE header parameters | - Clarified use of COSE header parameters | |||
- Updates on MTI | - Updates on MTI | |||
- Updated security considerations | - Updated security considerations | |||
- New section on PQC | - New section on PQC | |||
- Removed duplicate definition of cipher suites | - Removed duplicate definition of cipher suites | |||
- Explanations of use of COSE moved to Appendix C.3 | - Explanations of use of COSE moved to Appendix C.3 | |||
skipping to change at page 79, line 40 ¶ | skipping to change at page 90, line 8 ¶ | |||
* From -00 to -01: | * From -00 to -01: | |||
- Removed PSK method | - Removed PSK method | |||
- Removed references to certificate by value | - Removed references to certificate by value | |||
Acknowledgments | Acknowledgments | |||
The authors want to thank Christian Amsuess, Alessandro Bruni, | The authors want to thank Christian Amsuess, Alessandro Bruni, | |||
Karthikeyan Bhargavan, Timothy Claeys, Martin Disch, Loic Ferreira, | Karthikeyan Bhargavan, Carsten Bormann, Timothy Claeys, Martin Disch, | |||
Theis Groenbech Petersen, Dan Harkins, Klaus Hartke, Russ Housley, | Stephen Farrell, Loic Ferreira, Theis Groenbech Petersen, Felix | |||
Stefan Hristozov, Alexandros Krontiris, Ilari Liusvaara, Karl | Guenther, Dan Harkins, Klaus Hartke, Russ Housley, Stefan Hristozov, | |||
Norrman, Salvador Perez, Eric Rescorla, Michael Richardson, Thorvald | Marc Ilunga, Charlie Jacomme, Elise Klein, Steve Kremer, Alexandros | |||
Sahl Joergensen, Jim Schaad, Carsten Schuermann, Ludwig Seitz, | Krontiris, Ilari Liusvaara, Kathleen Moriarty, David Navarro, Karl | |||
Stanislav Smyshlyaev, Valery Smyslov, Peter van der Stok, Rene | Norrman, Salvador Perez, Maiwenn Racouchot, Eric Rescorla, Michael | |||
Struik, Vaishnavi Sundararajan, Erik Thormarker, Marco Tiloca, Michel | Richardson, Thorvald Sahl Joergensen, Jim Schaad, Carsten Schuermann, | |||
Veillette, and Malisa Vucinic for reviewing and commenting on | Ludwig Seitz, Stanislav Smyshlyaev, Valery Smyslov, Peter van der | |||
intermediate versions of the draft. We are especially indebted to | Stok, Rene Struik, Vaishnavi Sundararajan, Erik Thormarker, Marco | |||
Jim Schaad for his continuous reviewing and implementation of | Tiloca, Sean Turner, Michel Veillette, and Malisa Vučinić | |||
different versions of the draft. | for reviewing and commenting on intermediate versions of the draft. | |||
We are especially indebted to Jim Schaad for his continuous reviewing | ||||
and implementation of different versions of the draft. | ||||
Work on this document has in part been supported by the H2020 project | Work on this document has in part been supported by the H2020 project | |||
SIFIS-Home (grant agreement 952652). | SIFIS-Home (grant agreement 952652). | |||
Authors' Addresses | Authors' Addresses | |||
Göran Selander | Göran Selander | |||
Ericsson AB | Ericsson AB | |||
SE-164 80 Stockholm | SE-164 80 Stockholm | |||
Sweden | Sweden | |||
End of changes. 388 change blocks. | ||||
1198 lines changed or deleted | 1728 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |