draft-ietf-lake-edhoc-06.txt | draft-ietf-lake-edhoc-07.txt | |||
---|---|---|---|---|
Network Working Group G. Selander | Network Working Group G. Selander | |||
Internet-Draft J. Mattsson | Internet-Draft J. Mattsson | |||
Intended status: Standards Track F. Palombini | Intended status: Standards Track F. Palombini | |||
Expires: 23 October 2021 Ericsson AB | Expires: 25 November 2021 Ericsson AB | |||
21 April 2021 | 24 May 2021 | |||
Ephemeral Diffie-Hellman Over COSE (EDHOC) | Ephemeral Diffie-Hellman Over COSE (EDHOC) | |||
draft-ietf-lake-edhoc-06 | draft-ietf-lake-edhoc-07 | |||
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, | |||
perfect forward secrecy, and identity protection. EDHOC is intended | perfect forward secrecy, and identity protection. EDHOC is intended | |||
for usage in constrained scenarios and a main use case is to | for usage in constrained scenarios and a main use case is to | |||
establish an OSCORE security context. By reusing COSE for | establish an OSCORE security context. By reusing COSE for | |||
cryptography, CBOR for encoding, and CoAP for transport, the | cryptography, CBOR for encoding, and CoAP for transport, the | |||
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 23 October 2021. | This Internet-Draft will expire on 25 November 2021. | |||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2021 IETF Trust and the persons identified as the | Copyright (c) 2021 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 | |||
skipping to change at page 2, line 25 ¶ | skipping to change at page 2, line 25 ¶ | |||
1.5. Terminology and Requirements Language . . . . . . . . . . 6 | 1.5. Terminology and Requirements Language . . . . . . . . . . 6 | |||
2. EDHOC Outline . . . . . . . . . . . . . . . . . . . . . . . . 7 | 2. EDHOC Outline . . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
3. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 9 | 3. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 9 | |||
3.1. General . . . . . . . . . . . . . . . . . . . . . . . . . 9 | 3.1. General . . . . . . . . . . . . . . . . . . . . . . . . . 9 | |||
3.2. Method and Correlation . . . . . . . . . . . . . . . . . 10 | 3.2. Method and Correlation . . . . . . . . . . . . . . . . . 10 | |||
3.2.1. Method . . . . . . . . . . . . . . . . . . . . . . . 10 | 3.2.1. Method . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
3.2.2. Connection Identifiers . . . . . . . . . . . . . . . 10 | 3.2.2. Connection Identifiers . . . . . . . . . . . . . . . 10 | |||
3.2.3. Transport . . . . . . . . . . . . . . . . . . . . . . 11 | 3.2.3. Transport . . . . . . . . . . . . . . . . . . . . . . 11 | |||
3.2.4. Message Correlation . . . . . . . . . . . . . . . . . 11 | 3.2.4. Message Correlation . . . . . . . . . . . . . . . . . 11 | |||
3.3. Authentication Parameters . . . . . . . . . . . . . . . . 11 | 3.3. Authentication Parameters . . . . . . . . . . . . . . . . 11 | |||
3.3.1. Authentication Keys . . . . . . . . . . . . . . . . . 12 | 3.3.1. Authentication Keys . . . . . . . . . . . . . . . . . 11 | |||
3.3.2. Identities . . . . . . . . . . . . . . . . . . . . . 12 | 3.3.2. Identities . . . . . . . . . . . . . . . . . . . . . 12 | |||
3.3.3. Authentication Credentials . . . . . . . . . . . . . 13 | 3.3.3. Authentication Credentials . . . . . . . . . . . . . 13 | |||
3.3.4. Identification of Credentials . . . . . . . . . . . . 14 | 3.3.4. Identification of Credentials . . . . . . . . . . . . 15 | |||
3.4. Cipher Suites . . . . . . . . . . . . . . . . . . . . . . 16 | 3.4. Cipher Suites . . . . . . . . . . . . . . . . . . . . . . 16 | |||
3.5. Ephemeral Public Keys . . . . . . . . . . . . . . . . . . 17 | 3.5. Ephemeral Public Keys . . . . . . . . . . . . . . . . . . 18 | |||
3.6. Auxiliary Data . . . . . . . . . . . . . . . . . . . . . 18 | 3.6. External Authorization Data . . . . . . . . . . . . . . . 18 | |||
3.7. Applicability Statement . . . . . . . . . . . . . . . . . 18 | 3.7. Applicability Statement . . . . . . . . . . . . . . . . . 19 | |||
4. Key Derivation . . . . . . . . . . . . . . . . . . . . . . . 20 | 4. Key Derivation . . . . . . . . . . . . . . . . . . . . . . . 20 | |||
4.1. EDHOC-Exporter Interface . . . . . . . . . . . . . . . . 22 | 4.1. EDHOC-Exporter Interface . . . . . . . . . . . . . . . . 23 | |||
5. Message Formatting and Processing . . . . . . . . . . . . . . 22 | 5. Message Formatting and Processing . . . . . . . . . . . . . . 23 | |||
5.1. Encoding of bstr_identifier . . . . . . . . . . . . . . . 23 | 5.1. Encoding of bstr_identifier . . . . . . . . . . . . . . . 24 | |||
5.2. Message Processing Outline . . . . . . . . . . . . . . . 23 | 5.2. Message Processing Outline . . . . . . . . . . . . . . . 24 | |||
5.3. EDHOC Message 1 . . . . . . . . . . . . . . . . . . . . . 24 | 5.3. EDHOC Message 1 . . . . . . . . . . . . . . . . . . . . . 25 | |||
5.3.1. Formatting of Message 1 . . . . . . . . . . . . . . . 24 | 5.3.1. Formatting of Message 1 . . . . . . . . . . . . . . . 25 | |||
5.3.2. Initiator Processing of Message 1 . . . . . . . . . . 25 | 5.3.2. Initiator Processing of Message 1 . . . . . . . . . . 26 | |||
5.3.3. Responder Processing of Message 1 . . . . . . . . . . 26 | 5.3.3. Responder Processing of Message 1 . . . . . . . . . . 27 | |||
5.4. EDHOC Message 2 . . . . . . . . . . . . . . . . . . . . . 26 | 5.4. EDHOC Message 2 . . . . . . . . . . . . . . . . . . . . . 28 | |||
5.4.1. Formatting of Message 2 . . . . . . . . . . . . . . . 27 | 5.4.1. Formatting of Message 2 . . . . . . . . . . . . . . . 28 | |||
5.4.2. Responder Processing of Message 2 . . . . . . . . . . 27 | 5.4.2. Responder Processing of Message 2 . . . . . . . . . . 28 | |||
5.4.3. Initiator Processing of Message 2 . . . . . . . . . . 29 | 5.4.3. Initiator Processing of Message 2 . . . . . . . . . . 30 | |||
5.5. EDHOC Message 3 . . . . . . . . . . . . . . . . . . . . . 29 | 5.5. EDHOC Message 3 . . . . . . . . . . . . . . . . . . . . . 31 | |||
5.5.1. Formatting of Message 3 . . . . . . . . . . . . . . . 30 | 5.5.1. Formatting of Message 3 . . . . . . . . . . . . . . . 31 | |||
5.5.2. Initiator Processing of Message 3 . . . . . . . . . . 30 | 5.5.2. Initiator Processing of Message 3 . . . . . . . . . . 31 | |||
5.5.3. Responder Processing of Message 3 . . . . . . . . . . 32 | 5.5.3. Responder Processing of Message 3 . . . . . . . . . . 34 | |||
6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 33 | 6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 34 | |||
6.1. Success . . . . . . . . . . . . . . . . . . . . . . . . . 34 | 6.1. Success . . . . . . . . . . . . . . . . . . . . . . . . . 36 | |||
6.2. Unspecified . . . . . . . . . . . . . . . . . . . . . . . 34 | 6.2. Unspecified . . . . . . . . . . . . . . . . . . . . . . . 36 | |||
6.3. Wrong Selected Cipher Suite . . . . . . . . . . . . . . . 35 | 6.3. Wrong Selected Cipher Suite . . . . . . . . . . . . . . . 36 | |||
6.3.1. Cipher Suite Negotiation . . . . . . . . . . . . . . 35 | 6.3.1. Cipher Suite Negotiation . . . . . . . . . . . . . . 37 | |||
6.3.2. Examples . . . . . . . . . . . . . . . . . . . . . . 35 | 6.3.2. Examples . . . . . . . . . . . . . . . . . . . . . . 37 | |||
7. Transferring EDHOC and Deriving an OSCORE Context . . . . . . 37 | 7. Transferring EDHOC and Deriving an OSCORE Context . . . . . . 38 | |||
7.1. EDHOC Message 4 . . . . . . . . . . . . . . . . . . . . . 37 | 7.1. EDHOC Message 4 . . . . . . . . . . . . . . . . . . . . . 38 | |||
7.1.1. Formatting of Message 4 . . . . . . . . . . . . . . . 37 | 7.1.1. Formatting of Message 4 . . . . . . . . . . . . . . . 39 | |||
7.1.2. Responder Processing of Message 4 . . . . . . . . . . 38 | 7.1.2. Responder Processing of Message 4 . . . . . . . . . . 39 | |||
7.1.3. Initiator Processing of Message 4 . . . . . . . . . . 38 | 7.1.3. Initiator Processing of Message 4 . . . . . . . . . . 40 | |||
7.2. Transferring EDHOC in CoAP . . . . . . . . . . . . . . . 39 | 7.2. Transferring EDHOC in CoAP . . . . . . . . . . . . . . . 40 | |||
7.2.1. Deriving an OSCORE Context from EDHOC . . . . . . . . 41 | ||||
7.2.2. Error Messages with CoAP Transport . . . . . . . . . 42 | ||||
8. Security Considerations . . . . . . . . . . . . . . . . . . . 42 | 8. Security Considerations . . . . . . . . . . . . . . . . . . . 42 | |||
8.1. Security Properties . . . . . . . . . . . . . . . . . . . 42 | 8.1. Security Properties . . . . . . . . . . . . . . . . . . . 42 | |||
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 . . . . . . . 46 | |||
8.4. Unprotected Data . . . . . . . . . . . . . . . . . . . . 46 | 8.4. Unprotected Data . . . . . . . . . . . . . . . . . . . . 46 | |||
8.5. Denial-of-Service . . . . . . . . . . . . . . . . . . . . 46 | 8.5. Denial-of-Service . . . . . . . . . . . . . . . . . . . . 47 | |||
8.6. Implementation Considerations . . . . . . . . . . . . . . 46 | 8.6. Implementation Considerations . . . . . . . . . . . . . . 47 | |||
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 48 | 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 49 | |||
9.1. EDHOC Cipher Suites Registry . . . . . . . . . . . . . . 48 | 9.1. EDHOC Exporter Label . . . . . . . . . . . . . . . . . . 49 | |||
9.2. EDHOC Method Type Registry . . . . . . . . . . . . . . . 49 | 9.2. EDHOC Cipher Suites Registry . . . . . . . . . . . . . . 49 | |||
9.3. EDHOC Error Codes Registry . . . . . . . . . . . . . . . 50 | 9.3. EDHOC Method Type Registry . . . . . . . . . . . . . . . 50 | |||
9.4. The Well-Known URI Registry . . . . . . . . . . . . . . . 50 | 9.4. EDHOC Error Codes Registry . . . . . . . . . . . . . . . 51 | |||
9.5. Media Types Registry . . . . . . . . . . . . . . . . . . 50 | 9.5. The Well-Known URI Registry . . . . . . . . . . . . . . . 51 | |||
9.6. CoAP Content-Formats Registry . . . . . . . . . . . . . . 51 | 9.6. Media Types Registry . . . . . . . . . . . . . . . . . . 51 | |||
9.7. Expert Review Instructions . . . . . . . . . . . . . . . 51 | 9.7. CoAP Content-Formats Registry . . . . . . . . . . . . . . 52 | |||
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 52 | 9.8. Expert Review Instructions . . . . . . . . . . . . . . . 52 | |||
10.1. Normative References . . . . . . . . . . . . . . . . . . 52 | 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 53 | |||
10.2. Informative References . . . . . . . . . . . . . . . . . 54 | 10.1. Normative References . . . . . . . . . . . . . . . . . . 53 | |||
Appendix A. Use of CBOR, CDDL and COSE in EDHOC . . . . . . . . 56 | 10.2. Informative References . . . . . . . . . . . . . . . . . 55 | |||
A.1. CBOR and CDDL . . . . . . . . . . . . . . . . . . . . . . 57 | Appendix A. Compact Representation . . . . . . . . . . . . . . . 58 | |||
A.2. CDDL Definitions . . . . . . . . . . . . . . . . . . . . 57 | Appendix B. Use of CBOR, CDDL and COSE in EDHOC . . . . . . . . 58 | |||
A.3. COSE . . . . . . . . . . . . . . . . . . . . . . . . . . 59 | B.1. CBOR and CDDL . . . . . . . . . . . . . . . . . . . . . . 59 | |||
Appendix B. Test Vectors . . . . . . . . . . . . . . . . . . . . 59 | B.2. CDDL Definitions . . . . . . . . . . . . . . . . . . . . 59 | |||
B.1. Test Vectors for EDHOC Authenticated with Signature Keys | B.3. COSE . . . . . . . . . . . . . . . . . . . . . . . . . . 61 | |||
(x5t) . . . . . . . . . . . . . . . . . . . . . . . . . . 60 | Appendix C. Test Vectors . . . . . . . . . . . . . . . . . . . . 61 | |||
B.1.1. Message_1 . . . . . . . . . . . . . . . . . . . . . . 60 | C.1. Test Vectors for EDHOC Authenticated with Signature Keys | |||
B.1.2. Message_2 . . . . . . . . . . . . . . . . . . . . . . 61 | (x5t) . . . . . . . . . . . . . . . . . . . . . . . . . . 62 | |||
B.1.3. Message_3 . . . . . . . . . . . . . . . . . . . . . . 69 | C.1.1. Message_1 . . . . . . . . . . . . . . . . . . . . . . 62 | |||
B.1.4. OSCORE Security Context Derivation . . . . . . . . . 75 | C.1.2. Message_2 . . . . . . . . . . . . . . . . . . . . . . 63 | |||
B.2. Test Vectors for EDHOC Authenticated with Static | C.1.3. Message_3 . . . . . . . . . . . . . . . . . . . . . . 71 | |||
Diffie-Hellman Keys . . . . . . . . . . . . . . . . . . . 77 | C.1.4. OSCORE Security Context Derivation . . . . . . . . . 77 | |||
B.2.1. Message_1 . . . . . . . . . . . . . . . . . . . . . . 78 | C.2. Test Vectors for EDHOC Authenticated with Static | |||
B.2.2. Message_2 . . . . . . . . . . . . . . . . . . . . . . 79 | Diffie-Hellman Keys . . . . . . . . . . . . . . . . . . . 79 | |||
B.2.3. Message_3 . . . . . . . . . . . . . . . . . . . . . . 85 | C.2.1. Message_1 . . . . . . . . . . . . . . . . . . . . . . 80 | |||
B.2.4. OSCORE Security Context Derivation . . . . . . . . . 90 | C.2.2. Message_2 . . . . . . . . . . . . . . . . . . . . . . 81 | |||
Appendix C. Applicability Template . . . . . . . . . . . . . . . 92 | C.2.3. Message_3 . . . . . . . . . . . . . . . . . . . . . . 87 | |||
Appendix D. EDHOC Message Deduplication . . . . . . . . . . . . 93 | C.2.4. OSCORE Security Context Derivation . . . . . . . . . 92 | |||
Appendix E. Change Log . . . . . . . . . . . . . . . . . . . . . 94 | Appendix D. Applicability Template . . . . . . . . . . . . . . . 94 | |||
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 96 | Appendix E. EDHOC Message Deduplication . . . . . . . . . . . . 95 | |||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 97 | Appendix F. Change Log . . . . . . . . . . . . . . . . . . . . . 96 | |||
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 99 | ||||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 99 | ||||
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 7, line 5 ¶ | skipping to change at page 7, line 5 ¶ | |||
"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 process [I-D.ietf-cose-rfc8152bis-struct], COSE | structures and process [I-D.ietf-cose-rfc8152bis-struct], COSE | |||
algorithms [I-D.ietf-cose-rfc8152bis-algs], and CDDL [RFC8610]. The | algorithms [I-D.ietf-cose-rfc8152bis-algs], and CDDL [RFC8610]. The | |||
Concise Data Definition Language (CDDL) is used to express CBOR data | Concise Data Definition Language (CDDL) is used to express CBOR data | |||
structures [RFC8949]. Examples of CBOR and CDDL are provided in | structures [RFC8949]. Examples of CBOR and CDDL are provided in | |||
Appendix A.1. When referring to CBOR, this specification always | Appendix B.1. When referring to CBOR, this specification always | |||
refer to Deterministically Encoded CBOR as specified in Sections | refer to Deterministically Encoded CBOR as specified in Sections | |||
4.2.1 and 4.2.2 of [RFC8949]. | 4.2.1 and 4.2.2 of [RFC8949]. | |||
The single output from authenticated encryption (including the | 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 Diffie- | |||
Hellman key exchange: digital signatures and static Diffie-Hellman | Hellman key exchange: digital signatures and static Diffie-Hellman | |||
skipping to change at page 8, line 46 ¶ | skipping to change at page 8, line 46 ¶ | |||
- The Initiator lists supported cipher suites in order of | - The Initiator lists supported cipher suites in order of | |||
preference | preference | |||
- The Responder verifies that the selected cipher suite is the | - The Responder verifies that the selected cipher suite is the | |||
first supported cipher suite (or else rejects and states | first supported cipher suite (or else rejects and states | |||
supported cipher suites). | supported cipher suites). | |||
* Method types and error handling. | * Method types and error handling. | |||
* Transport of opaque auxiliary 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 A and test vectors including CBOR diagnostic | summarized in Appendix B and test vectors including CBOR diagnostic | |||
notation are given in Appendix B. | notation are given in Appendix C. | |||
3. Protocol Elements | 3. Protocol Elements | |||
3.1. General | 3.1. General | |||
An EDHOC message flow consists of three mandatory messages | An EDHOC message flow consists of three mandatory messages | |||
(message_1, message_2, message_3) between Initiator and Responder, an | (message_1, message_2, message_3) between Initiator and Responder, an | |||
optional fourth message (message_4), plus an EDHOC error message. | optional fourth message (message_4), plus an EDHOC error message. | |||
EDHOC messages are CBOR Sequences [RFC8742], see Figure 3. The | EDHOC messages are CBOR Sequences [RFC8742], see Figure 3. The | |||
protocol elements in the figure are introduced in the following | protocol elements in the figure are introduced in the following | |||
skipping to change at page 9, line 40 ¶ | skipping to change at page 9, line 40 ¶ | |||
(AEAD, hash) in the selected cipher suite (see Section 3.4) and the | (AEAD, hash) in the selected cipher suite (see Section 3.4) and the | |||
application can make use of the established connection identifiers | application can make use of the established connection identifiers | |||
C_1, C_I, and C_R (see Section 3.2.4). EDHOC may be used with the | C_1, C_I, and C_R (see Section 3.2.4). EDHOC may be used with the | |||
media type application/edhoc defined in Section 9. | media type application/edhoc defined in Section 9. | |||
The Initiator can derive symmetric application keys after creating | The Initiator can derive symmetric application keys after creating | |||
EDHOC message_3, see Section 4.1. Application protected data can | EDHOC message_3, see Section 4.1. Application protected data can | |||
therefore be sent in parallel or together with EDHOC message_3. | therefore be sent in parallel or together with EDHOC message_3. | |||
Initiator Responder | Initiator Responder | |||
| C_1, METHOD_CORR, SUITES_I, G_X, C_I, AD_1 | | | C_1, METHOD_CORR, SUITES_I, G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
| | | | | | |||
| C_I, G_Y, C_R, Enc(ID_CRED_R, Signature_or_MAC_2, AD_2) | | | C_I, G_Y, C_R, Enc(ID_CRED_R, Signature_or_MAC_2, EAD_2) | | |||
|<------------------------------------------------------------------+ | |<------------------------------------------------------------------+ | |||
| message_2 | | | message_2 | | |||
| | | | | | |||
| C_R, AEAD(K_3ae; ID_CRED_I, Signature_or_MAC_3, AD_3) | | | C_R, AEAD(K_3ae; ID_CRED_I, Signature_or_MAC_3, EAD_3) | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_3 | | | message_3 | | |||
Figure 3: EDHOC Message Flow | Figure 3: EDHOC Message Flow | |||
3.2. Method and Correlation | 3.2. Method and Correlation | |||
The data item METHOD_CORR in message_1 (see Section 5.3.1), is an | The data item METHOD_CORR in message_1 (see Section 5.3.1), is an | |||
integer specifying the method and the correlation properties of the | integer specifying the method and the correlation properties of the | |||
transport, which are described in this section. | transport, which are described in this section. | |||
skipping to change at page 11, line 9 ¶ | skipping to change at page 11, line 9 ¶ | |||
connection identifiers SHALL adhere to the requirements for that | connection identifiers SHALL adhere to the requirements for that | |||
protocol. Each party choses a connection identifier it desires the | protocol. Each party choses a connection identifier it desires the | |||
other party to use in outgoing messages. (For OSCORE this results in | other party to use in outgoing messages. (For OSCORE this results in | |||
the endpoint selecting its Recipient ID, see Section 3.1 of | the endpoint selecting its Recipient ID, see Section 3.1 of | |||
[RFC8613]). | [RFC8613]). | |||
3.2.3. Transport | 3.2.3. 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 | |||
be used in environments without IP. The transport is responsible to | be used in environments without IP. The application using EDHOC is | |||
handle message loss, reordering, message duplication, fragmentation, | responsible to handle message loss, reordering, message duplication, | |||
and denial of service protection, where necessary. | fragmentation, demultiplex EDHOC messages from other types of | |||
messages, and denial of service protection, where necessary. | ||||
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.7. It is recommended to transport | be used for EDHOC, see Section 3.7. It is recommended to transport | |||
EDHOC in CoAP payloads, see Section 7. | EDHOC in CoAP payloads, see Section 7. | |||
3.2.4. Message Correlation | 3.2.4. Message Correlation | |||
If the whole transport path provides a mechanism for correlating | If the whole transport path provides a mechanism for correlating | |||
messages received with messages previously sent, then some of the | messages received with messages previously sent, then some of the | |||
connection identifiers may be omitted. There are four cases: | connection identifiers may be omitted. There are four cases: | |||
skipping to change at page 12, line 17 ¶ | skipping to change at page 12, line 5 ¶ | |||
Hellman key. The Initiator and the Responder MAY use different types | Hellman key. The Initiator and the Responder MAY use different types | |||
of authentication keys, e.g. one uses a signature key and the other | of authentication keys, e.g. one uses a signature key and the other | |||
uses a static Diffie-Hellman key. When using a signature key, the | uses a static Diffie-Hellman key. When using a signature key, the | |||
authentication is provided by a signature. When using a static | authentication is provided by a signature. When using a static | |||
Diffie-Hellman key the authentication is provided by a Message | 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 MAC is implemented with an AEAD algorithm. When using static | The MAC is implemented with an AEAD algorithm. When using static | |||
Diffie-Hellman keys the Initiator's and Responder's private | Diffie-Hellman keys the Initiator's and Responder's private | |||
authentication keys are called I and R, respectively, and the public | authentication keys are called I and R, respectively, and the public | |||
authentication keys are called G_I and G_R, respectively. | authentication keys are called G_I and G_R, respectively. The | |||
authentication key algorithm needs to specified with enough | ||||
parameters to make it completely determined. Note that for most | ||||
signature algorithms, the signature is determined by the signature | ||||
algorithm and the authentication key algorithm together. For | ||||
example, the curve used in the signature is typically determined by | ||||
the authentication key parameters. | ||||
* Only the Responder SHALL have access to the Responder's private | * Only the Responder SHALL have access to the Responder's private | |||
authentication key. | authentication key. | |||
* Only the Initiator SHALL have access to the Initiator's private | * Only the Initiator SHALL have access to the Initiator's private | |||
authentication key. | authentication key. | |||
3.3.2. Identities | 3.3.2. Identities | |||
EDHOC assumes the existence of mechanisms (certification authority, | EDHOC assumes the existence of mechanisms (certification authority, | |||
trusted third party, manual distribution, etc.) for specifying and | trusted third party, manual distribution, etc.) for specifying and | |||
distributing authentication keys and identities. Policies are set | distributing authentication keys and identities. Policies are set | |||
based on the identity of the other party, and parties typically only | based on the identity of the other party, and parties typically only | |||
allow connections from a specific identity or a small restricted set | allow connections from a specific identity or a small restricted set | |||
of identities. For example, in the case of a device connecting to a | of identities. For example, in the case of a device connecting to a | |||
network, the network may only allow connections from devices which | network, the network may only allow connections from devices which | |||
authenticate with certificates having a particular range of serial | authenticate with certificates having a particular range of serial | |||
numbers in the subject field and signed by a particular CA. On the | numbers in the subject field and signed by a particular CA. On the | |||
other side, the device may only be allowed to connect to a network | other side, the device may only be allowed to connect to a network | |||
which authenticates with a particular public key (information of | which authenticates with a particular public key (information of | |||
which may be provisioned, e.g., out of band or in the Auxiliary Data, | which may be provisioned, e.g., out of band or in the external | |||
see Section 3.6). | authorization data, see Section 3.6). | |||
The EDHOC implementation must be able to receive and enforce | The EDHOC implementation must be able to receive and enforce | |||
information from the application about what is the intended endpoint, | information from the application about what is the intended endpoint, | |||
and in particular whether it is a specific identity or a set of | and in particular whether it is a specific identity or a set of | |||
identities. | identities. | |||
* When a Public Key Infrastructure (PKI) is used, the trust anchor | * When a Public Key Infrastructure (PKI) is used, the trust anchor | |||
is a Certification Authority (CA) certificate, and the identity is | is a Certification Authority (CA) certificate, and the identity is | |||
the subject whose unique name (e.g. a domain name, NAI, or EUI) is | the subject whose unique name (e.g. a domain name, NAI, or EUI) is | |||
included in the endpoint's certificate. Before running EDHOC each | included in the endpoint's certificate. Before running EDHOC each | |||
skipping to change at page 14, line 44 ¶ | skipping to change at page 15, line 7 ¶ | |||
CRED_x = { | CRED_x = { | |||
1: 1, | 1: 1, | |||
-1: 4, | -1: 4, | |||
-2: h'b1a3e89460e88d3a8d54211dc95f0b90 | -2: h'b1a3e89460e88d3a8d54211dc95f0b90 | |||
3ff205eb71912d6db8f4af980d2db83a', | 3ff205eb71912d6db8f4af980d2db83a', | |||
"subject name" : "42-50-31-FF-EF-37-32-39" | "subject name" : "42-50-31-FF-EF-37-32-39" | |||
} | } | |||
3.3.4. Identification of Credentials | 3.3.4. Identification of Credentials | |||
ID_CRED_I and ID_CRED_R are identifiers of the public authentication | ID_CRED_I and ID_CRED_R are used to identify and optionally transport | |||
keys of the Initiator and the Responder, respectively. ID_CRED_I and | the public authentication keys of the Initiator and the Responder, | |||
ID_CRED_R do not have any cryptographic purpose in EDHOC. | respectively. ID_CRED_I and ID_CRED_R do not have any cryptographic | |||
purpose in EDHOC. | ||||
* 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 public authentication key. | the Responder's public authentication key. | |||
* 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 public authentication key. | the Initiator's public authentication key. | |||
The identifiers ID_CRED_I and ID_CRED_R are COSE header_maps, i.e. | The identifiers ID_CRED_I and ID_CRED_R are COSE header_maps, i.e. | |||
CBOR maps containing Common COSE Header Parameters, see Section 3.1 | CBOR maps containing Common COSE Header Parameters, see Section 3.1 | |||
of [I-D.ietf-cose-rfc8152bis-struct]). In the following we give some | of [I-D.ietf-cose-rfc8152bis-struct]). In the following we give some | |||
examples of COSE header_maps. | examples of COSE header_maps. | |||
Raw public keys are most optimally stored as COSE_Key objects and | Raw public keys are most optimally stored as COSE_Key objects and | |||
identified with a 'kid' parameter: | identified with a 'kid' parameter: | |||
* ID_CRED_x = { 4 : kid_x }, where kid_x : bstr, for x = I or R. | * ID_CRED_x = { 4 : kid_x }, where kid_x : bstr, for x = I or R. | |||
Public key certificates can be identified in different ways. Header | Public key certificates can be identified in different ways. Header | |||
parameters for identifying C509 certificates and X.509 certificates | parameters for identifying C509 certificates and X.509 certificates | |||
are defined in [I-D.mattsson-cose-cbor-cert-compress] and | are defined in [I-D.ietf-cose-cbor-encoded-cert] and | |||
[I-D.ietf-cose-x509], for example: | [I-D.ietf-cose-x509], for example: | |||
* by a hash value with the 'c5t' or 'x5t' parameters; | * by a hash value with the 'c5t' or 'x5t' parameters; | |||
- ID_CRED_x = { 34 : COSE_CertHash }, for x = I or R, | - ID_CRED_x = { 34 : COSE_CertHash }, for x = I or R, | |||
- ID_CRED_x = { TDB3 : COSE_CertHash }, for x = I or R, | - ID_CRED_x = { TDB3 : COSE_CertHash }, for x = I or R, | |||
* by a URI with the 'c5u' or 'x5u' parameters; | * by a URI with the 'c5u' or 'x5u' parameters; | |||
- ID_CRED_x = { 35 : uri }, for x = I or R, | - ID_CRED_x = { 35 : uri }, for x = I or R, | |||
- ID_CRED_x = { TBD4 : uri }, for x = I or R, | - ID_CRED_x = { TBD4 : uri }, for x = I or R, | |||
* ID_CRED_x MAY contain the actual credential used for | * ID_CRED_x MAY contain the actual credential used for | |||
authentication, CRED_x. For example, a certificate chain can be | authentication, CRED_x. For example, a certificate chain can be | |||
transported in ID_CRED_x with COSE header parameter c5c or | transported in ID_CRED_x with COSE header parameter c5c or | |||
x5chain, defined in [I-D.mattsson-cose-cbor-cert-compress] and | x5chain, defined in [I-D.ietf-cose-cbor-encoded-cert] and | |||
[I-D.ietf-cose-x509]. | [I-D.ietf-cose-x509]. | |||
It is RECOMMENDED that ID_CRED_x uniquely identify the public | It is RECOMMENDED that ID_CRED_x uniquely identify the public | |||
authentication key as the recipient may otherwise have to try several | authentication key as the recipient may otherwise have to try several | |||
keys. ID_CRED_I and ID_CRED_R are transported in the 'ciphertext', | keys. ID_CRED_I and ID_CRED_R are transported in the 'ciphertext', | |||
see Section 5.5 and Section 5.4. | see Section 5.5 and Section 5.4. | |||
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. One byte credential identifiers are realistic in many | short. One byte credential identifiers are realistic in many | |||
scenarios as most constrained devices only have a few keys. In cases | scenarios as most constrained devices only have a few keys. In cases | |||
where a node only has one key, the identifier may even be the empty | where a node only has one key, the identifier may even be the empty | |||
byte string. | byte string. | |||
3.4. Cipher Suites | 3.4. Cipher Suites | |||
An EDHOC cipher suite consists of an ordered set of COSE code points | An EDHOC cipher suite consists of an ordered set of algorithms from | |||
from the "COSE Algorithms" and "COSE Elliptic Curves" registries: | the "COSE Algorithms" and "COSE Elliptic Curves" registries. | |||
Algorithms need to be specified with enough parameters to make them | ||||
completely determined. Currently, none of the algorithms require | ||||
parameters. EDHOC is only specified for use with key exchange | ||||
algorithms of type ECDH curves. Use with other types of key exchange | ||||
algorithms would likely require a specification updating EDHOC. Note | ||||
that for most signature algorithms, the signature is determined by | ||||
the signature algorithm and the authentication key algorithm | ||||
together, see Section 3.3.1. | ||||
* EDHOC AEAD algorithm | * EDHOC AEAD algorithm | |||
* EDHOC hash algorithm | * EDHOC hash algorithm | |||
* EDHOC ECDH curve | * EDHOC key exchange algorithm (ECDH curve) | |||
* EDHOC signature algorithm | * EDHOC signature algorithm | |||
* EDHOC signature algorithm curve | ||||
* 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 int 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 one of the pre-defined cipher suites | Implementation can either use one of the pre-defined cipher suites | |||
(Section 9.1) or use any combination of COSE algorithms to define | (Section 9.2) or use any combination of COSE algorithms and | |||
their own private cipher suite. Private cipher suites can be | parameters to define their own private cipher suite. Private cipher | |||
identified with any of the four values -24, -23, -22, -21. | suites can be identified with any of the four values -24, -23, -22, | |||
-21. | ||||
The following cipher suites are for constrained IoT where message | The following cipher suites are for constrained IoT where message | |||
overhead is a very important factor: | overhead is a very important factor: | |||
0. ( 10, -16, 4, -8, 6, 10, -16 ) | 0. ( 10, -16, 4, -8, 10, -16 ) | |||
(AES-CCM-16-64-128, SHA-256, X25519, EdDSA, Ed25519, | (AES-CCM-16-64-128, SHA-256, X25519, EdDSA, | |||
AES-CCM-16-64-128, SHA-256) | AES-CCM-16-64-128, SHA-256) | |||
1. ( 30, -16, 4, -8, 6, 10, -16 ) | 1. ( 30, -16, 4, -8, 10, -16 ) | |||
(AES-CCM-16-128-128, SHA-256, X25519, EdDSA, Ed25519, | (AES-CCM-16-128-128, SHA-256, X25519, EdDSA, | |||
AES-CCM-16-64-128, SHA-256) | AES-CCM-16-64-128, SHA-256) | |||
2. ( 10, -16, 1, -7, 1, 10, -16 ) | 2. ( 10, -16, 1, -7, 10, -16 ) | |||
(AES-CCM-16-64-128, SHA-256, P-256, ES256, P-256, | (AES-CCM-16-64-128, SHA-256, P-256, ES256, | |||
AES-CCM-16-64-128, SHA-256) | AES-CCM-16-64-128, SHA-256) | |||
3. ( 30, -16, 1, -7, 1, 10, -16 ) | 3. ( 30, -16, 1, -7, 10, -16 ) | |||
(AES-CCM-16-128-128, SHA-256, P-256, ES256, P-256, | (AES-CCM-16-128-128, SHA-256, P-256, ES256, | |||
AES-CCM-16-64-128, SHA-256) | AES-CCM-16-64-128, SHA-256) | |||
The following cipher suite is for general non-constrained | The following cipher suite is for general non-constrained | |||
applications. It uses very high performance algorithms that also are | applications. It uses very high performance algorithms that also are | |||
widely supported: | widely supported: | |||
4. ( 1, -16, 4, -7, 1, 1, -16 ) | 4. ( 1, -16, 4, -7, 1, -16 ) | |||
(A128GCM, SHA-256, X25519, ES256, P-256, | (A128GCM, SHA-256, X25519, ES256, | |||
A128GCM, SHA-256) | A128GCM, SHA-256) | |||
The following cipher suite is for high security application such as | The following cipher suite is for high security application such as | |||
government use and financial applications. It is compatible with the | government use and financial applications. It is compatible with the | |||
CNSA suite [CNSA]. | CNSA suite [CNSA]. | |||
5. ( 3, -43, 2, -35, 2, 3, -43 ) | 5. ( 3, -43, 2, -35, 3, -43 ) | |||
(A256GCM, SHA-384, P-384, ES384, P-384, | (A256GCM, SHA-384, P-384, ES384, | |||
A256GCM, SHA-384) | A256GCM, SHA-384) | |||
The different methods use the same cipher suites, but some algorithms | The different methods use the same cipher suites, but some algorithms | |||
are not used in some methods. The EDHOC signature algorithm and the | are not used in some methods. The EDHOC signature algorithm is not | |||
EDHOC signature algorithm curve are not used in methods without | used in methods without signature authentication. | |||
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 is a CBOR array containing cipher | suites it supports. SUITES_I is a CBOR array containing cipher | |||
suites that the Initiator supports. SUITES_I is formatted and | suites that the Initiator supports. SUITES_I is formatted and | |||
processed as detailed in Section 5.3.1 to secure the cipher suite | processed as detailed in Section 5.3.1 to secure the cipher suite | |||
negotiation. Examples of cipher suite negotiation are given in | negotiation. Examples of cipher suite negotiation are given in | |||
Section 6.3.2. | Section 6.3.2. | |||
3.5. Ephemeral Public Keys | 3.5. Ephemeral Public Keys | |||
The ECDH ephemeral public keys are formatted as a COSE_Key of type | EDHOC always uses compact representation of elliptic curve points, | |||
EC2 or OKP according to Sections 7.1 and 7.2 of | see Appendix A. In COSE compact representation is achieved by | |||
[I-D.ietf-cose-rfc8152bis-algs], but only the 'x' parameter is | formatting the ECDH ephemeral public keys as COSE_Keys of type EC2 or | |||
included G_X and G_Y. For Elliptic Curve Keys of type EC2, compact | OKP according to Sections 7.1 and 7.2 of | |||
representation as per [RFC6090] MAY be used also in the COSE_Key. If | [I-D.ietf-cose-rfc8152bis-algs], but only including the 'x' parameter | |||
the COSE implementation requires an 'y' parameter, any of the | in G_X and G_Y. For Elliptic Curve Keys of type EC2, compact | |||
possible values of the y-coordinate can be used, see Appendix C of | representation MAY be used also in the COSE_Key. If the COSE | |||
[RFC6090]. COSE always use compact output for Elliptic Curve Keys of | implementation requires an 'y' parameter, the value y = false SHALL | |||
be used. COSE always use compact output for Elliptic Curve Keys of | ||||
type EC2. | type EC2. | |||
3.6. Auxiliary Data | 3.6. External Authorization Data | |||
In order to reduce round trips and number of messages, and in some | In order to reduce round trips and number of messages or to simplify | |||
cases also streamline processing, certain security applications may | processing, external security applications may be integrated into | |||
be integrated into EDHOC by transporting auxiliary data together with | EDHOC by transporting authorization related data together with the | |||
the messages. One example is the transport of third-party | messages. One example is the transport third-party identity and | |||
authorization information protected outside of EDHOC | authorization information protected out of scope of EDHOC | |||
[I-D.selander-ace-ake-authz]. Another example is the embedding of a | [I-D.selander-ace-ake-authz]. Another example is the embedding of a | |||
certificate enrolment request or a newly issued certificate. | certificate enrolment request or a newly issued certificate. | |||
EDHOC allows opaque auxiliary data (AD) to be sent in the EDHOC | EDHOC allows opaque external authorization data (EAD) to be sent in | |||
messages. Unprotected Auxiliary Data (AD_1, AD_2) may be sent in | the EDHOC messages. External authorization data sent in message_1 | |||
message_1 and message_2, respectively. Protected Auxiliary Data | (EAD_1) or message_2 (EAD_2) must be considered unprotected by EDHOC, | |||
(AD_3) may be sent in message_3. | see Section 8.4. External authorization data sent in message_3 | |||
(EAD_3) or message_4 (EAD_4) is protected between Initiator and | ||||
Responder. | ||||
Since data carried in AD_1 and AD_2 may not be protected, and the | External authorization data is a CBOR sequence (see Appendix B.1) as | |||
content of AD_3 is available to both the Initiator and the Responder, | defined below: | |||
special considerations need to be made such that the availability of | ||||
the data a) does not violate security and privacy requirements of the | EAD = ( | |||
service which uses this data, and b) does not violate the security | type : int, | |||
properties of EDHOC. | 1* ext_authz_data : any, | |||
) | ||||
where type is an int and is followed by one or more ext_authz_data | ||||
depending on type as defined in a separate specification. | ||||
The EAD fields of EDHOC are not intended for generic application | ||||
data. Since data carried in EAD_1 and EAD_2 fields may not be | ||||
protected, special considerations need to be made such that a) it | ||||
does not violate security, privacy etc. requirements of the service | ||||
which uses this data, and b) it does not violate the security | ||||
properties of EDHOC. Security applications making use of the EAD | ||||
fields must perform the necessary security analysis. | ||||
3.7. Applicability Statement | 3.7. Applicability Statement | |||
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 agreed through the protocol | |||
execution (specifically cipher suite negotiation, see Section 3.4) | execution (specifically cipher suite negotiation, see Section 3.4) | |||
but other parameters may need to be known out-of-band (e.g., which | but other parameters may need to be known out-of-band (e.g., which | |||
authentication method is used, see Section 3.2.1). | authentication method is used, see Section 3.2.1). | |||
The purpose of the applicability statement is describe the intended | The purpose of the applicability statement is describe the intended | |||
skipping to change at page 18, line 51 ¶ | skipping to change at page 19, line 29 ¶ | |||
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 Section 7.2. | Format; see Section 7.2. | |||
2. Method and correlation of underlying transport messages | 2. Method and correlation of underlying transport messages | |||
(METHOD_CORR; see Section 3.2.1 and Section 3.2.4). This gives | (METHOD_CORR; see Section 3.2.1 and Section 3.2.4). This gives | |||
information about the optional connection identifier fields. | information about the optional connection identifier fields. | |||
3. How message_1 is identified, in particular if the optional | 3. How message_1 is identified, in particular if the optional | |||
initial C_1 = "null" of message_1 is present; see Section 5.3.1 | initial C_1 = "null" of message_1 is present; see Section 5.3.1 | |||
4. Authentication credentials (CRED_I, CRED_R; see Section 3.3.3). | 4. Profile for authentication credentials (CRED_I, CRED_R; see | |||
Section 3.3.3), e.g., profile for certificate or COSE_key, | ||||
including supported authentication key algorithms (subject public | ||||
key algorithm in X.509 certificate). | ||||
5. Type used to identify authentication credentials (ID_CRED_I, | 5. Type used to identify authentication credentials (ID_CRED_I, | |||
ID_CRED_R; see Section 3.3.4). | ID_CRED_R; see Section 3.3.4). | |||
6. Use and type of Auxiliary Data (AD_1, AD_2, AD_3; see | 6. Use and type of external authorization data (EAD_1, EAD_2, EAD_3, | |||
Section 3.6). | EAD_4; see Section 3.6). | |||
7. Identifier used as identity of endpoint; see Section 3.3.2. | 7. Identifier used as identity of endpoint; see Section 3.3.2. | |||
8. If message_4 shall be sent/expected, and if not, how to ensure a | 8. 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 7.1. | Initiator; see Section 7.1. | |||
The applicability statement may also contain information about | The applicability statement may also contain information about | |||
supported cipher suites. The procedure for selecting and verifying | supported cipher suites. The procedure for selecting and verifying | |||
cipher suite is still performed as specified by the protocol, but it | cipher suite is still performed as specified by the protocol, but it | |||
may become simplified by this knowledge. | may become simplified by this knowledge. | |||
An example of an applicability statement is shown in Appendix C. | An example of an applicability statement is shown in Appendix D. | |||
For some parameters, like METHOD_CORR, ID_CRED_x, type of AD_x, the | For some parameters, like METHOD_CORR, ID_CRED_x, type of EAD, the | |||
receiver is able to verify compliance with applicability statement, | receiver is able to verify compliance with applicability statement, | |||
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 CRED_x in the case that it is not | |||
transported, it may not be possible to verify that incompliance with | transported, it may not be possible to verify that incompliance with | |||
applicability statement was the reason for failure: Integrity | applicability statement was the reason for failure: Integrity | |||
verification in message_2 or message_3 may fail not only because of | verification in message_2 or message_3 may fail not only because of | |||
wrong authentication credential. For example, in case the Initiator | wrong authentication credential. For example, in case the Initiator | |||
uses public key certificate by reference (i.e. not transported within | uses public key certificate by reference (i.e. not transported within | |||
skipping to change at page 20, line 5 ¶ | skipping to change at page 20, line 35 ¶ | |||
other endpoint, but this applies only to the later phases of the | other endpoint, but this applies only to the later phases of the | |||
protocol when identities are known. (Initiator does not know | protocol when identities are known. (Initiator does not know | |||
identity of Responder before having verified message_2, and Responder | identity of Responder before having verified message_2, and Responder | |||
does not know identity of Initiator before having verified | does not know identity of Initiator before having verified | |||
message_3.) | message_3.) | |||
Other conditions may be part of the applicability statement, such as | Other conditions may be part of the applicability statement, 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 applicability statements are used, the receiver needs to be | |||
able to determine which is applicable for a given protocol instance, | able to determine which is applicable for a given session, for | |||
for example based on URI or Auxiliary Data type. | example based on URI or external authorization data type. | |||
4. Key Derivation | 4. Key Derivation | |||
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 EDHOC and in the | |||
application. Extract is used to derive fixed-length uniformly | application. Extract is used to derive fixed-length uniformly | |||
pseudorandom keys (PRK) from ECDH shared secrets. Expand is used to | pseudorandom keys (PRK) from ECDH shared secrets. Expand is used to | |||
derive additional output keying material (OKM) from the PRKs. The | derive additional output keying material (OKM) from the PRKs. The | |||
PRKs are derived using Extract. | PRKs are derived using Extract. | |||
skipping to change at page 21, line 21 ¶ | skipping to change at page 22, line 5 ¶ | |||
then PRK_4x3m = Extract( PRK_3e2m, G_IY ), where G_IY is the ECDH | then PRK_4x3m = Extract( PRK_3e2m, G_IY ), where G_IY is the ECDH | |||
shared secret calculated from G_I and Y, or G_Y and I, else | shared secret calculated from G_I and Y, or G_Y and I, else | |||
PRK_4x3m = PRK_3e2m. | PRK_4x3m = PRK_3e2m. | |||
Example: Assuming the use of curve25519, the ECDH shared secrets | Example: Assuming the use of curve25519, the ECDH shared secrets | |||
G_XY, G_RX, and G_IY are the outputs of the X25519 function | G_XY, G_RX, and G_IY are the outputs of the X25519 function | |||
[RFC7748]: | [RFC7748]: | |||
G_XY = X25519( Y, G_X ) = X25519( X, G_Y ) | G_XY = X25519( Y, G_X ) = X25519( X, G_Y ) | |||
The keys and IVs used in EDHOC are derived from PRK using Expand | The keys and IVs used in EDHOC are derived from PRKs using Expand | |||
[RFC5869] where the EDHOC-KDF is instantiated with the EDHOC AEAD | [RFC5869] where the EDHOC-KDF is instantiated with the EDHOC AEAD | |||
algorithm in the selected cipher suite. | algorithm in the selected cipher suite. | |||
OKM = EDHOC-KDF( PRK, transcript_hash, label, length ) | OKM = EDHOC-KDF( PRK, transcript_hash, label, length ) | |||
= Expand( PRK, info, length ) | = Expand( PRK, info, length ) | |||
where info is the CBOR encoding of | where info is the CBOR encoding of | |||
info = [ | info = [ | |||
edhoc_aead_id : int / tstr, | edhoc_aead_id : int / tstr, | |||
skipping to change at page 22, line 26 ¶ | skipping to change at page 23, line 10 ¶ | |||
IV_3ae are derived using the transcript hash TH_3 and the | IV_3ae are derived using the transcript hash TH_3 and the | |||
pseudorandom key PRK_3e2m. K_3m and IV_3m are derived using the | pseudorandom key PRK_3e2m. K_3m and IV_3m are derived using the | |||
transcript hash TH_3 and the pseudorandom key PRK_4x3m. IVs are only | transcript hash TH_3 and the pseudorandom key PRK_4x3m. IVs are only | |||
used if the EDHOC AEAD algorithm uses IVs. | used if the EDHOC AEAD algorithm uses IVs. | |||
4.1. EDHOC-Exporter Interface | 4.1. EDHOC-Exporter Interface | |||
Application keys and other application specific data can be derived | Application keys and other application specific data can be derived | |||
using the EDHOC-Exporter interface defined as: | using the EDHOC-Exporter interface defined as: | |||
EDHOC-Exporter(label, length) | EDHOC-Exporter(label, context, length) | |||
= EDHOC-KDF(PRK_4x3m, TH_4, label, length) | = EDHOC-KDF(PRK_4x3m, TH_4, label_context, length) | |||
where label is a tstr defined by the application and length is a uint | label_context is a CBOR sequence: | |||
defined by the application. The label SHALL be different for each | ||||
different exporter value. The transcript hash TH_4 is a CBOR encoded | label_context = ( | |||
bstr and the input to the hash function is a CBOR Sequence. | label : tstr, | |||
context : bstr, | ||||
) | ||||
where label is a registered tstr from the EDHOC Exporter Label | ||||
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, | ||||
nonce) pair must not be reused. | ||||
The transcript hash TH_4 is a CBOR encoded bstr and the input to the | ||||
hash function is a CBOR Sequence. | ||||
TH_4 = H( TH_3, CIPHERTEXT_3 ) | TH_4 = H( TH_3, CIPHERTEXT_3 ) | |||
where H() is the hash function in the selected cipher suite. Example | where H() is the hash function in the selected cipher suite. | |||
use of the EDHOC-Exporter is given in Sections 7.2.1. | Examples of use of the EDHOC-Exporter are given in Section 7.1.2 and | |||
[I-D.ietf-core-oscore-edhoc]. | ||||
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_4x3m is deleted and the new | |||
PRk_4x3m is calculated as a "hash" of the old key using the Extract | PRK_4x3m is calculated as a "hash" of the old key using the Extract | |||
function as illustrated by the following pseudocode: | function as illustrated by the following pseudocode: | |||
EDHOC-KeyUpdate( nonce ): | EDHOC-KeyUpdate( nonce ): | |||
PRK_4x3m = Extract( nonce, PRK_4x3m ) | PRK_4x3m = Extract( nonce, PRK_4x3m ) | |||
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. | steps. Error messages are specified in Section 6. | |||
skipping to change at page 23, line 44 ¶ | skipping to change at page 24, line 44 ¶ | |||
bstr_identifier = bstr / int | bstr_identifier = bstr / int | |||
Note that, despite what could be interpreted by the CDDL definition | Note that, despite what could be interpreted by the CDDL definition | |||
only, bstr_identifier once decoded are always byte strings. | only, bstr_identifier once decoded are always byte strings. | |||
5.2. Message Processing Outline | 5.2. Message Processing Outline | |||
This section outlines the message processing of EDHOC. | This section outlines the message processing of EDHOC. | |||
For each protocol instance, the endpoints are assumed to keep an | For each session, the endpoints are assumed to keep an associated | |||
associated protocol state containing connection identifiers, keys, | protocol state containing connection identifiers, keys, etc. used for | |||
etc. used for subsequent processing of protocol related data. The | subsequent processing of protocol related data. The protocol state | |||
protocol state is assumed to be associated to an applicability | is assumed to be associated to an applicability statement | |||
statement (Section 3.7) which provides the context for how messages | (Section 3.7) 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.7). | means of port number, URI, or media type (Section 3.7). | |||
2. Retrieve the protocol state, e.g. using the received connection | 2. Retrieve the protocol state, e.g. using the received connection | |||
identifier (Section 3.2.2) or with the help of message | identifier (Section 3.2.2) or with the help of message | |||
skipping to change at page 24, line 30 ¶ | skipping to change at page 25, line 30 ¶ | |||
3. If the message received is an error message then process | 3. If the message received is an error message then process | |||
according to Section 6, else process as the expected next message | according to Section 6, else process as the expected next message | |||
according to the protocol state. | according to the protocol state. | |||
If the processing fails, then the protocol is discontinued, an error | If the processing fails, then the protocol is discontinued, an error | |||
message sent, and the protocol state erased. Further details are | message sent, and the protocol state erased. Further details are | |||
provided in the following subsections. | provided in the following subsections. | |||
Different instances of the same message MUST NOT be processed in one | Different instances of the same message MUST NOT be processed in one | |||
protocol instance. Note that processing will fail if the same | session. Note that processing will fail if the same message appears | |||
message appears a second time for EDHOC processing because the state | a second time for EDHOC processing because the state of the protocol | |||
of the protocol has moved on and now expects something else. This | has moved on and now expects something else. This assumes that | |||
assumes that message duplication due to re-transmissions is handled | message duplication due to re-transmissions is handled by the | |||
by the transport protocol, see Section 3.2.3. The case when the | transport protocol, see Section 3.2.3. The case when the transport | |||
transport does not support message deduplication is addressed in | does not support message deduplication is addressed in Appendix E. | |||
Appendix D. | ||||
5.3. EDHOC Message 1 | 5.3. EDHOC Message 1 | |||
5.3.1. Formatting of Message 1 | 5.3.1. Formatting of Message 1 | |||
message_1 SHALL be a CBOR Sequence (see Appendix A.1) as defined | message_1 SHALL be a CBOR Sequence (see Appendix B.1) as defined | |||
below | below | |||
message_1 = ( | message_1 = ( | |||
? C_1 : null, | ? C_1 : null, | |||
METHOD_CORR : int, | METHOD_CORR : int, | |||
SUITES_I : [ selected : suite, supported : 2* suite ] / suite, | SUITES_I : [ selected : suite, supported : 2* suite ] / suite, | |||
G_X : bstr, | G_X : bstr, | |||
C_I : bstr_identifier, | C_I : bstr_identifier, | |||
? AD_1 : bstr, | ? EAD ; EAD_1 | |||
) | ) | |||
suite = int | suite = int | |||
where: | where: | |||
* C_1 - an initial CBOR simple value "null" (= 0xf6) MAY be used to | * C_1 - an initial CBOR simple value "null" (= 0xf6) MAY be used to | |||
distinguish message_1 from other messages. | distinguish message_1 from other messages. | |||
* METHOD_CORR = 4 * method + corr, where method = 0, 1, 2, or 3 (see | * METHOD_CORR = 4 * method + corr, where method = 0, 1, 2, or 3 (see | |||
skipping to change at page 25, line 39 ¶ | skipping to change at page 26, line 39 ¶ | |||
selected. The selected suite is the first suite in the SUITES_I | selected. The selected suite is the first suite in the SUITES_I | |||
CBOR array. If a single supported cipher suite is conveyed then | CBOR array. If a single supported cipher suite is conveyed then | |||
that cipher suite is selected and SUITES_I is encoded as an int | that cipher suite is selected and SUITES_I is encoded as an int | |||
instead of an array. | instead of an array. | |||
* G_X - the ephemeral public key of the Initiator | * G_X - the ephemeral public key of the Initiator | |||
* C_I - variable length connection identifier, encoded as a | * C_I - variable length connection identifier, encoded as a | |||
bstr_identifier (see Section 5.1). | bstr_identifier (see Section 5.1). | |||
* AD_1 - bstr containing unprotected opaque auxiliary data | * EAD_1 - unprotected external authorization data, see Section 3.6. | |||
5.3.2. Initiator Processing of Message 1 | 5.3.2. Initiator Processing of Message 1 | |||
The Initiator SHALL compose message_1 as follows: | The Initiator SHALL compose message_1 as follows: | |||
* The supported cipher suites and the order of preference MUST NOT | * The supported cipher suites and the order of preference MUST NOT | |||
be changed based on previous error messages. However, the list | be changed based on previous error messages. However, the list | |||
SUITES_I sent to the Responder MAY be truncated such that cipher | SUITES_I sent to the Responder MAY be truncated such that cipher | |||
suites which are the least preferred are omitted. The amount of | suites which are the least preferred are omitted. The amount of | |||
truncation MAY be changed between sessions, e.g. based on previous | truncation MAY be changed between sessions, e.g. based on previous | |||
error messages (see next bullet), but all cipher suites which are | error messages (see next bullet), but all cipher suites which are | |||
more preferred than the least preferred cipher suite in the list | more preferred than the least preferred cipher suite in the list | |||
MUST be included in the list. | MUST be included in the list. | |||
* 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. If the Initiator previously received from the | Responder. If the Initiator previously received from the | |||
Responder an error message with error code 1 (see Section 6.3) | Responder an error message with error code 2 (see Section 6.3) | |||
indicating cipher suites supported by the Responder which also are | indicating cipher suites supported by the Responder which also are | |||
supported by the Initiator, then the Initiator SHOULD select the | supported by the Initiator, then the Initiator SHOULD select the | |||
most preferred cipher suite of those (note that error messages are | most preferred cipher suite of those (note that error messages are | |||
not authenticated and may be forged). | not authenticated and may be forged). | |||
* Generate an ephemeral ECDH key pair as specified in Section 5 of | * Generate an ephemeral ECDH key pair using the curve in the | |||
[SP-800-56A] using the curve in the selected cipher suite and | selected cipher suite and format it as a COSE_Key. Let G_X be the | |||
format it as a COSE_Key. Let G_X be the 'x' parameter of the | 'x' parameter of the COSE_Key. | |||
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.3.1 | specified in Section 5.3.1 | |||
5.3.3. Responder Processing of Message 1 | 5.3.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 A.1). | * Decode message_1 (see Appendix B.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 AD_1 to the security application. | * Pass EAD_1 to the security application. | |||
If any verification step fails, the Responder MUST send an EDHOC | If any processing step fails, the Responder SHOULD send an EDHOC | |||
error message back, formatted as defined in Section 6, and the | error message back, formatted as defined in Section 6, and the | |||
protocol MUST be discontinued. | session MUST be discontinued. Sending error messages is essential | |||
for debugging but MAY e.g. be skipped due to denial of service | ||||
reasons, see Section 8. | ||||
5.4. EDHOC Message 2 | 5.4. EDHOC Message 2 | |||
5.4.1. Formatting of Message 2 | 5.4.1. Formatting of Message 2 | |||
message_2 and data_2 SHALL be CBOR Sequences (see Appendix A.1) as | message_2 and data_2 SHALL be CBOR Sequences (see Appendix B.1) as | |||
defined below | defined below | |||
message_2 = ( | message_2 = ( | |||
data_2, | data_2, | |||
CIPHERTEXT_2 : bstr, | CIPHERTEXT_2 : bstr, | |||
) | ) | |||
data_2 = ( | data_2 = ( | |||
? C_I : bstr_identifier, | ? C_I : bstr_identifier, | |||
G_Y : bstr, | G_Y : bstr, | |||
skipping to change at page 27, line 34 ¶ | skipping to change at page 28, line 37 ¶ | |||
* C_R - variable length connection identifier, encoded as a | * C_R - variable length connection identifier, encoded as a | |||
bstr_identifier (see Section 5.1). | bstr_identifier (see Section 5.1). | |||
5.4.2. Responder Processing of Message 2 | 5.4.2. Responder Processing of Message 2 | |||
The Responder SHALL compose message_2 as follows: | The Responder SHALL compose message_2 as follows: | |||
* If corr (METHOD_CORR mod 4) equals 1 or 3, C_I is omitted, | * If corr (METHOD_CORR mod 4) equals 1 or 3, C_I is omitted, | |||
otherwise C_I is not omitted. | otherwise C_I is not omitted. | |||
* Generate an ephemeral ECDH key pair as specified in Section 5 of | * Generate an ephemeral ECDH key pair using the curve in the | |||
[SP-800-56A] using the curve in the selected cipher suite and | selected cipher suite and format it as a COSE_Key. Let G_Y be the | |||
format it as a COSE_Key. Let G_Y be the 'x' parameter of the | 'x' parameter of the COSE_Key. | |||
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(message_1, data_2) where H() | * Compute the transcript hash TH_2 = H( H(message_1), data_2 ) where | |||
is the hash function in the selected cipher suite. The transcript | H() is the hash function in the selected cipher suite. The | |||
hash TH_2 is a CBOR encoded bstr and the input to the hash | transcript hash TH_2 is a CBOR encoded bstr and the input to the | |||
function is a CBOR Sequence. | hash function is a CBOR Sequence. Note that H(message_1) can be | |||
computed and cached already in the processing of message_1. | ||||
* Compute an inner COSE_Encrypt0 as defined in Section 5.3 of | * Compute an inner COSE_Encrypt0 as defined in Section 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 | |||
in the selected cipher suite, K_2m, IV_2m, and the following | in the selected cipher suite, K_2m, IV_2m, and the following | |||
parameters: | parameters: | |||
- protected = << ID_CRED_R >> | - protected = << ID_CRED_R >> | |||
o ID_CRED_R - identifier to facilitate retrieval of CRED_R, | o ID_CRED_R - identifier to facilitate retrieval of CRED_R, | |||
see Section 3.3.4 | see Section 3.3.4 | |||
- external_aad = << TH_2, CRED_R, ? AD_2 >> | - external_aad = << TH_2, CRED_R, ? EAD_2 >> | |||
o CRED_R - bstr containing the credential of the Responder, | o CRED_R - bstr containing the credential of the Responder, | |||
see Section 3.3.4. | see Section 3.3.4 | |||
o AD_2 = bstr containing opaque unprotected auxiliary data | o EAD_2 = unprotected external authorization data, see | |||
Section 3.6 | ||||
- plaintext = h'' | - plaintext = h'' | |||
COSE constructs the input to the AEAD [RFC5116] as follows: | COSE constructs the input to the AEAD [RFC5116] as follows: | |||
- Key K = EDHOC-KDF( PRK_3e2m, TH_2, "K_2m", length ) | - Key K = EDHOC-KDF( PRK_3e2m, TH_2, "K_2m", length ) | |||
- Nonce N = EDHOC-KDF( PRK_3e2m, TH_2, "IV_2m", length ) | - Nonce N = EDHOC-KDF( PRK_3e2m, TH_2, "IV_2m", length ) | |||
- Plaintext P = 0x (the empty string) | - Plaintext P = 0x (the empty string) | |||
- Associated data A = | - Associated data A = | |||
[ "Encrypt0", << ID_CRED_R >>, << TH_2, CRED_R, ? AD_2 >> ] | [ "Encrypt0", << ID_CRED_R >>, << TH_2, CRED_R, ? EAD_2 >> ] | |||
MAC_2 is the 'ciphertext' of the inner COSE_Encrypt0. | MAC_2 is the 'ciphertext' of the inner COSE_Encrypt0. | |||
* 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' of a COSE_Sign1 | 2), then Signature_or_MAC_2 is the 'signature' of a COSE_Sign1 | |||
object as defined in Section 4.4 of | object as defined in Section 4.4 of | |||
[I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm in | [I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm in | |||
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: | Responder, and the following parameters: | |||
- protected = << ID_CRED_R >> | - protected = << ID_CRED_R >> | |||
- external_aad = << TH_2, CRED_R, ? AD_2 >> | - external_aad = << TH_2, CRED_R, ? EAD_2 >> | |||
- payload = MAC_2 | - payload = MAC_2 | |||
COSE constructs the input to the Signature Algorithm as: | COSE constructs the input to the Signature Algorithm as: | |||
- The key is the private authentication key of the Responder. | - The key is the private authentication key of the Responder. | |||
- The message M to be signed = | - The message M to be signed = | |||
[ "Signature1", << ID_CRED_R >>, << TH_2, CRED_R, ? AD_2 >>, | [ "Signature1", << ID_CRED_R >>, << TH_2, CRED_R, ? EAD_2 >>, | |||
MAC_2 ] | MAC_2 ] | |||
* CIPHERTEXT_2 is encrypted by using the Expand function as a binary | * CIPHERTEXT_2 is encrypted by using the Expand function as a binary | |||
additive stream cipher. | additive stream cipher. | |||
- plaintext = ( ID_CRED_R / bstr_identifier, Signature_or_MAC_2, | - plaintext = ( ID_CRED_R / bstr_identifier, Signature_or_MAC_2, | |||
? AD_2 ) | ? EAD_2 ) | |||
o Note that if ID_CRED_R contains a single 'kid' parameter, | o Note that if ID_CRED_R contains a single 'kid' parameter, | |||
i.e., ID_CRED_R = { 4 : kid_R }, only the byte string kid_R | i.e., ID_CRED_R = { 4 : kid_R }, only the byte string kid_R | |||
is conveyed in the plaintext encoded as a bstr_identifier, | is conveyed in the plaintext encoded as a bstr_identifier, | |||
see Section 3.3.4 and Section 5.1. | see Section 3.3.4 and Section 5.1. | |||
- CIPHERTEXT_2 = plaintext XOR KEYSTREAM_2 | - CIPHERTEXT_2 = plaintext 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.4.1. | specified in Section 5.4.1. | |||
5.4.3. Initiator Processing of Message 2 | 5.4.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 A.1). | * Decode message_2 (see Appendix B.1). | |||
* Retrieve the protocol state using the connection identifier C_I | * Retrieve the protocol state using the connection identifier C_I | |||
and/or other external information such as the CoAP Token and the | and/or other external information such as the CoAP Token and the | |||
5-tuple. | 5-tuple. | |||
* Decrypt CIPHERTEXT_2, see Section 5.4.2. | * Decrypt CIPHERTEXT_2, see Section 5.4.2. | |||
* Pass EAD_2 to the security application. | ||||
* Verify that the identity of the Responder is an allowed identity | * Verify that the identity of the Responder is an allowed identity | |||
for this connection, see Section 3.3. | for this connection, see Section 3.3. | |||
* 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.4.2. | Section 5.4.2. | |||
* Pass AD_2 to the security application. | If any processing step fails, the Initiator SHOULD send an EDHOC | |||
error message back, formatted as defined in Section 6. Sending error | ||||
If any verification step fails, the Initiator MUST send an EDHOC | messages is essential for debugging but MAY e.g.be skipped if a | |||
error message back, formatted as defined in Section 6, and the | session cannot be found or due to denial of service reasons, see | |||
protocol MUST be discontinued. | Section 8. If an error message is sent, the session MUST be | |||
discontinued. | ||||
5.5. EDHOC Message 3 | 5.5. EDHOC Message 3 | |||
5.5.1. Formatting of Message 3 | 5.5.1. Formatting of Message 3 | |||
message_3 and data_3 SHALL be CBOR Sequences (see Appendix A.1) as | message_3 and data_3 SHALL be CBOR Sequences (see Appendix B.1) as | |||
defined below | defined below | |||
message_3 = ( | message_3 = ( | |||
data_3, | data_3, | |||
CIPHERTEXT_3 : bstr, | CIPHERTEXT_3 : bstr, | |||
) | ) | |||
data_3 = ( | data_3 = ( | |||
? C_R : bstr_identifier, | ? C_R : bstr_identifier, | |||
) | ) | |||
5.5.2. Initiator Processing of Message 3 | 5.5.2. Initiator Processing of Message 3 | |||
The Initiator SHALL compose message_3 as follows: | The Initiator SHALL compose message_3 as follows: | |||
* If corr (METHOD_CORR mod 4) equals 2 or 3, C_R is omitted, | * If corr (METHOD_CORR mod 4) equals 2 or 3, C_R is omitted, | |||
otherwise C_R is not omitted. | otherwise C_R is not omitted. | |||
* Compute the transcript hash TH_3 = H(TH_2 , CIPHERTEXT_2, data_3) | * Compute the transcript hash TH_3 = H( H(TH_2, CIPHERTEXT_2), | |||
where H() is the hash function in the selected cipher suite. The | data_3 ) where H() is the hash function in the selected cipher | |||
transcript hash TH_3 is a CBOR encoded bstr and the input to the | suite. The transcript hash TH_3 is a CBOR encoded bstr and the | |||
hash function is a CBOR Sequence. | input to the hash function is a CBOR Sequence. Note that H(TH_2, | |||
CIPHERTEXT_2) can be computed and cached already in the processing | ||||
of message_2. | ||||
* Compute an inner COSE_Encrypt0 as defined in Section 5.3 of | * Compute an inner COSE_Encrypt0 as defined in Section 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 | |||
in the selected cipher suite, K_3m, IV_3m, and the following | in the selected cipher suite, K_3m, IV_3m, and the following | |||
parameters: | parameters: | |||
- protected = << ID_CRED_I >> | - protected = << ID_CRED_I >> | |||
o ID_CRED_I - identifier to facilitate retrieval of CRED_I, | o ID_CRED_I - identifier to facilitate retrieval of CRED_I, | |||
see Section 3.3.4 | see Section 3.3.4 | |||
- external_aad = << TH_3, CRED_I, ? AD_3 >> | - external_aad = << TH_3, CRED_I, ? EAD_3 >> | |||
o CRED_I - bstr containing the credential of the Initiator, | o CRED_I - bstr containing the credential of the Initiator, | |||
see Section 3.3.4. | see Section 3.3.4. | |||
o AD_3 = bstr containing opaque protected auxiliary data | o EAD_3 = protected external authorization data, see | |||
Section 3.6 | ||||
- plaintext = h'' | - plaintext = h'' | |||
COSE constructs the input to the AEAD [RFC5116] as follows: | COSE constructs the input to the AEAD [RFC5116] as follows: | |||
- Key K = EDHOC-KDF( PRK_4x3m, TH_3, "K_3m", length ) | - Key K = EDHOC-KDF( PRK_4x3m, TH_3, "K_3m", length ) | |||
- Nonce N = EDHOC-KDF( PRK_4x3m, TH_3, "IV_3m", length ) | - Nonce N = EDHOC-KDF( PRK_4x3m, TH_3, "IV_3m", length ) | |||
- Plaintext P = 0x (the empty string) | - Plaintext P = 0x (the empty string) | |||
- Associated data A = | - Associated data A = | |||
[ "Encrypt0", << ID_CRED_I >>, << TH_3, CRED_I, ? AD_3 >> ] | [ "Encrypt0", << ID_CRED_I >>, << TH_3, CRED_I, ? EAD_3 >> ] | |||
MAC_3 is the 'ciphertext' of the inner COSE_Encrypt0. | MAC_3 is the 'ciphertext' of the inner COSE_Encrypt0. | |||
* 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' of a COSE_Sign1 | 1), then Signature_or_MAC_3 is the 'signature' of a COSE_Sign1 | |||
object as defined in Section 4.4 of | object as defined in Section 4.4 of | |||
[I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm in | [I-D.ietf-cose-rfc8152bis-struct] using the signature algorithm in | |||
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: | Initiator, and the following parameters: | |||
- protected = << ID_CRED_I >> | - protected = << ID_CRED_I >> | |||
- external_aad = << TH_3, CRED_I, ? AD_3 >> | - external_aad = << TH_3, CRED_I, ? EAD_3 >> | |||
- payload = MAC_3 | - payload = MAC_3 | |||
COSE constructs the input to the Signature Algorithm as: | COSE constructs the input to the Signature Algorithm as: | |||
- The key is the private authentication key of the Initiator. | - The key is the private authentication key of the Initiator. | |||
- The message M to be signed = | - The message M to be signed = | |||
[ "Signature1", << ID_CRED_I >>, << TH_3, CRED_I, ? AD_3 >>, | [ "Signature1", << ID_CRED_I >>, << TH_3, CRED_I, ? EAD_3 >>, | |||
MAC_3 ] | MAC_3 ] | |||
* Compute an outer COSE_Encrypt0 as defined in Section 5.3 of | * Compute an outer COSE_Encrypt0 as defined in Section 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 | |||
in the selected cipher suite, K_3ae, IV_3ae, and the following | in the selected cipher suite, K_3ae, IV_3ae, and the following | |||
parameters. The protected header SHALL be empty. | parameters. The protected header SHALL be empty. | |||
- external_aad = TH_3 | - external_aad = TH_3 | |||
- plaintext = ( ID_CRED_I / bstr_identifier, Signature_or_MAC_3, | - plaintext = ( ID_CRED_I / bstr_identifier, Signature_or_MAC_3, | |||
? AD_3 ) | ? EAD_3 ) | |||
o Note that if ID_CRED_I contains a single 'kid' parameter, | o Note that if ID_CRED_I contains a single 'kid' parameter, | |||
i.e., ID_CRED_I = { 4 : kid_I }, only the byte string kid_I | i.e., ID_CRED_I = { 4 : kid_I }, only the byte string kid_I | |||
is conveyed in the plaintext encoded as a bstr_identifier, | is conveyed in the plaintext encoded as a bstr_identifier, | |||
see Section 3.3.4 and Section 5.1. | see Section 3.3.4 and Section 5.1. | |||
COSE constructs the input to the AEAD [RFC5116] as follows: | COSE constructs the input to the AEAD [RFC5116] as follows: | |||
- Key K = EDHOC-KDF( PRK_3e2m, TH_3, "K_3ae", length ) | - Key K = EDHOC-KDF( PRK_3e2m, TH_3, "K_3ae", length ) | |||
- Nonce N = EDHOC-KDF( PRK_3e2m, TH_3, "IV_3ae", length ) | - Nonce N = EDHOC-KDF( PRK_3e2m, TH_3, "IV_3ae", length ) | |||
- Plaintext P = ( ID_CRED_I / bstr_identifier, | - Plaintext P = ( ID_CRED_I / bstr_identifier, | |||
Signature_or_MAC_3, ? AD_3 ) | Signature_or_MAC_3, ? EAD_3 ) | |||
- Associated data A = [ "Encrypt0", h'', TH_3 ] | - Associated data A = [ "Encrypt0", h'', TH_3 ] | |||
CIPHERTEXT_3 is the 'ciphertext' of the outer COSE_Encrypt0. | CIPHERTEXT_3 is the 'ciphertext' of the outer COSE_Encrypt0. | |||
* Encode message_3 as a sequence of CBOR encoded data items as | * Encode message_3 as a sequence of CBOR encoded data items as | |||
specified in Section 5.5.1. | specified in Section 5.5.1. | |||
Pass the connection identifiers (C_I, C_R) and the application | Pass 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 to the application. The | |||
application can now derive application keys using the EDHOC-Exporter | application can now derive application keys using the EDHOC-Exporter | |||
interface. | interface. | |||
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_4x3m (implicit key | |||
authentication). The Initiator does however not know that the | authentication). The Initiator can securely derive application keys | |||
Responder has actually computed the key PRK_4x3m. While the | and send protected application data. However, the Initiator does not | |||
Initiator can securely send protected application data, the Initiator | know that the Responder has actually computed the key PRK_4x3m and | |||
SHOULD NOT permanently store the keying material PRK_4x3m and TH_4 | therefore the Initiator SHOULD NOT permanently store the keying | |||
until the Initiator is assured that the Responder has actually | material PRK_4x3m and TH_4, or derived application keys, until the | |||
computed the key PRK_4x3m (explicit key confirmation). Explicit key | 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 | confirmation is e.g. assured when the Initiator has verified an | |||
OSCORE message or message_4 from the Responder. | OSCORE message or message_4 from the Responder. | |||
5.5.3. Responder Processing of Message 3 | 5.5.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 A.1). | * Decode message_3 (see Appendix B.1). | |||
* Retrieve the protocol state using the connection identifier C_R | * Retrieve the protocol state using the connection identifier C_R | |||
and/or other external information such as the CoAP Token and the | and/or other external information such as the CoAP Token and the | |||
5-tuple. | 5-tuple. | |||
* Decrypt and verify the outer COSE_Encrypt0 as defined in | * Decrypt and verify the outer COSE_Encrypt0 as defined in | |||
Section 5.3 of [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC | Section 5.3 of [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC | |||
AEAD algorithm in the selected cipher suite, K_3ae, and IV_3ae. | AEAD algorithm in the selected cipher suite, K_3ae, and IV_3ae. | |||
* Pass EAD_3 to the security application. | ||||
* Verify that the identity of the Initiator is an allowed identity | * Verify that the identity of the Initiator is an allowed identity | |||
for this connection, see Section 3.3. | for this connection, see Section 3.3. | |||
* 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.5.2. | Section 5.5.2. | |||
* Pass AD_3, the connection identifiers (C_I, C_R), and the | * Pass the connection identifiers (C_I, C_R), and the application | |||
application algorithms in the selected cipher suite to the | algorithms in the selected cipher suite to the security | |||
security application. The application can now derive application | application. The application can now derive application keys | |||
keys using the EDHOC-Exporter interface. | using the EDHOC-Exporter interface. | |||
If any verification step fails, the Responder MUST send an EDHOC | If any processing step fails, the Responder SHOULD send an EDHOC | |||
error message back, formatted as defined in Section 6, and the | error message back, formatted as defined in Section 6. Sending error | |||
protocol MUST be discontinued. | messages is essential for debugging but MAY e.g.be skipped if a | |||
session cannot be found or due to denial of service reasons, see | ||||
Section 8. If an error message is sent, the session MUST be | ||||
discontinued. | ||||
After verifying message_3, the Responder is assured that the | After verifying message_3, the Responder is assured that the | |||
Initiator has calculated the key PRK_4x3m (explicit key confirmation) | Initiator has calculated the key PRK_4x3m (explicit key confirmation) | |||
and that no other party than the Responder can compute the key. The | and that no other party than the Responder can compute the key. The | |||
Responder can securely send protected application data and store the | Responder can securely send protected application data and store the | |||
keying material PRK_4x3m and TH_4. | keying material PRK_4x3m and TH_4. | |||
6. Error Handling | 6. Error Handling | |||
This section defines the format for error messages. | This section defines the format for error messages. | |||
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. | |||
All error messages in EDHOC are fatal. After sending an error | Errors in EDHOC are fatal. After sending an error message, the | |||
message, the sender MUST discontinue the protocol. The receiver | sender MUST discontinue the protocol. The receiver SHOULD treat an | |||
SHOULD treat an error message as an indication that the other party | error message as an indication that the other party likely has | |||
likely has discontinued the protocol. But as the error message is | discontinued the protocol. But as the error message is not | |||
not authenticated, a received error messages might also have been | authenticated, a received error message might also have been sent by | |||
sent by an attacker and the receiver MAY therefore try to continue | an attacker and the receiver MAY therefore try to continue the | |||
the protocol. | protocol. | |||
error SHALL be a CBOR Sequence (see Appendix A.1) as defined below | error SHALL be a CBOR Sequence (see Appendix B.1) as defined below | |||
error = ( | error = ( | |||
? C_x : bstr_identifier, | ? C_x : bstr_identifier, | |||
ERR_CODE : int, | ERR_CODE : int, | |||
ERR_INFO : any | ERR_INFO : any | |||
) | ) | |||
Figure 5: EDHOC Error Message | Figure 5: EDHOC Error Message | |||
where: | where: | |||
* C_x - (optional) variable length connection identifier, encoded as | * C_x - (optional) variable length connection identifier, encoded as | |||
a bstr_identifier (see Section 5.1). If error is sent by the | a bstr_identifier (see Section 5.1). If error is sent by the | |||
Responder and corr (METHOD_CORR mod 4) equals 0 or 2 then C_x is | Responder and corr (METHOD_CORR mod 4) equals 0 or 2 then C_x is | |||
set to C_I, else if error is sent by the Initiator and corr | set to C_I, else if error is sent by the Initiator and corr | |||
(METHOD_CORR mod 4) equals 0 or 1 then C_x is set to C_R, else C_x | (METHOD_CORR mod 4) equals 0 or 1 then C_x is set to C_R, else C_x | |||
is omitted. | is omitted. | |||
* ERR_CODE - error code encoded as an integer. | * ERR_CODE - error code encoded as an integer. The value 0 is used | |||
for success, all other values (negative or positive) indicate | ||||
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 6. Error codes 1, 0 and -1 MUST be supported. | codes, see Figure 6. Error codes 1 and 2 MUST be supported. | |||
Additional error codes and corresponding error information may be | Additional error codes and corresponding error information may be | |||
specified. | specified. | |||
+----------+---------------+----------------------------------------+ | +----------+---------------+----------------------------------------+ | |||
| ERR_CODE | ERR_INFO Type | Description | | | ERR_CODE | ERR_INFO Type | Description | | |||
+==========+===============+========================================+ | +==========+===============+========================================+ | |||
| -1 | TBD | Success | | | 0 | any | Success | | |||
+----------+---------------+----------------------------------------+ | +----------+---------------+----------------------------------------+ | |||
| 0 | tstr | Unspecified | | | 1 | tstr | Unspecified | | |||
+----------+---------------+----------------------------------------+ | +----------+---------------+----------------------------------------+ | |||
| 1 | SUITES_R | Wrong selected cipher suite | | | 2 | SUITES_R | Wrong selected cipher suite | | |||
+----------+---------------+----------------------------------------+ | +----------+---------------+----------------------------------------+ | |||
Figure 6: Error Codes and Error Information | Figure 6: Error Codes and Error Information | |||
6.1. Success | 6.1. Success | |||
TBD | 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 | ||||
item. Error code 0 MUST NOT be used as part of the EDHOC message | ||||
exchange flow. | ||||
6.2. Unspecified | 6.2. Unspecified | |||
Error code 0 is used for unspecified errors and contain a diagnostic | Error code 1 is used for errors that do not have a specific error | |||
message. | code defined. ERR_INFO MUST be a text string containing a human- | |||
readable diagnostic message written in English. The diagnostic text | ||||
For error messages with ERR_CODE == 0, ERR_INFO MUST be a text string | message is mainly intended for software engineers that during | |||
containing a human-readable diagnostic message written in English. | debugging need to interpret it in the context of the EDHOC | |||
The diagnostic text message is mainly intended for software engineers | specification. The diagnostic message SHOULD be provided to the | |||
that during debugging need to interpret it in the context of the | calling application where it SHOULD be logged. | |||
EDHOC specification. The diagnostic message SHOULD be provided to | ||||
the calling application where it SHOULD be logged. | ||||
6.3. Wrong Selected Cipher Suite | 6.3. Wrong Selected Cipher Suite | |||
Error code 1 MUST only be used in a response to message_1 in case the | Error code 2 MUST only be used in a response 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.3.3. | by the Initiator than the selected cipher suite, see Section 5.3.3. | |||
ERR_INFO is of type SUITES_R: | ERR_INFO is of type SUITES_R: | |||
SUITES_R : [ supported : 2* suite ] / suite | SUITES_R : [ supported : 2* suite ] / suite | |||
If the Responder does not support the selected cipher suite, then | If the Responder does not support the selected cipher suite, then | |||
SUITES_R MUST include one or more supported cipher suites. If the | SUITES_R MUST include one or more supported cipher suites. If the | |||
Responder does not support the selected cipher suite, but supports | Responder does not support the selected cipher suite, but supports | |||
another cipher suite in SUITES_I, then SUITES_R MUST include the | another cipher suite in SUITES_I, then SUITES_R MUST include the | |||
first supported cipher suite in SUITES_I. | first supported cipher suite in SUITES_I. | |||
skipping to change at page 36, line 6 ¶ | skipping to change at page 37, line 31 ¶ | |||
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 7 and 8 show | and 9 in decreasing order of preference. Figures 7 and 8 show | |||
examples of how the Initiator can truncate SUITES_I and how SUITES_R | examples of how the Initiator can truncate SUITES_I and how SUITES_R | |||
is used by Responders to give the Initiator information about the | is used by Responders to give the Initiator information about the | |||
cipher suites that the Responder supports. | cipher suites that the Responder supports. | |||
In the first example (Figure 7), the Responder supports cipher suite | In the first example (Figure 7), 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_CORR, SUITES_I = 5, G_X, C_I, AD_1 | | | METHOD_CORR, SUITES_I = 5, G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
| | | | | | |||
| C_I, DIAG_MSG, SUITES_R = 6 | | | C_I, DIAG_MSG, SUITES_R = 6 | | |||
|<------------------------------------------------------------------+ | |<------------------------------------------------------------------+ | |||
| error | | | error | | |||
| | | | | | |||
| METHOD_CORR, SUITES_I = [6, 5, 6], G_X, C_I, AD_1 | | | METHOD_CORR, SUITES_I = [6, 5, 6], G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
Figure 7: Example of Responder supporting suite 6 but not suite 5. | Figure 7: Example of Responder supporting suite 6 but not suite 5. | |||
In the second example (Figure 8), the Responder supports cipher | In the second example (Figure 8), 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 an error and SUITES_R, after which the Initiator | responds with an error and SUITES_R, after which the Initiator | |||
selects its most preferred supported suite. The order of cipher | selects its most preferred supported suite. The order of cipher | |||
suites in SUITES_R does not matter. (If the Responder had supported | suites in SUITES_R does not matter. (If the Responder had supported | |||
suite 5, it would include it in SUITES_R of the response, and it | suite 5, it would include it in SUITES_R of the response, and it | |||
would in that case have become the selected suite in the second | would in that case have become the selected suite in the second | |||
message_1.) | message_1.) | |||
Initiator Responder | Initiator Responder | |||
| METHOD_CORR, SUITES_I = [6, 5, 6], G_X, C_I, AD_1 | | | METHOD_CORR, SUITES_I = [6, 5, 6], G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
| | | | | | |||
| C_I, DIAG_MSG, SUITES_R = [9, 8] | | | C_I, DIAG_MSG, SUITES_R = [9, 8] | | |||
|<------------------------------------------------------------------+ | |<------------------------------------------------------------------+ | |||
| error | | | error | | |||
| | | | | | |||
| METHOD_CORR, SUITES_I = [8, 5, 6, 7, 8], G_X, C_I, AD_1 | | | METHOD_CORR, SUITES_I = [8, 5, 6, 7, 8], G_X, C_I, EAD_1 | | |||
+------------------------------------------------------------------>| | +------------------------------------------------------------------>| | |||
| message_1 | | | message_1 | | |||
Figure 8: Example of Responder supporting suites 8 and 9 but not | Figure 8: Example of Responder supporting suites 8 and 9 but not | |||
5, 6 or 7. | 5, 6 or 7. | |||
Note that the Initiator's list of supported cipher suites and order | Note that the Initiator's list of supported cipher suites and order | |||
of preference is fixed (see Section 5.3.1 and Section 5.3.2). | of preference is fixed (see Section 5.3.1 and Section 5.3.2). | |||
Furthermore, the Responder shall only accept message_1 if the | Furthermore, the Responder shall only accept message_1 if the | |||
selected cipher suite is the first cipher suite in SUITES_I that the | selected cipher suite is the first cipher suite in SUITES_I that the | |||
Responder supports (see Section 5.3.3). Following this procedure | Responder supports (see Section 5.3.3). Following this procedure | |||
ensures that the selected cipher suite is the most preferred (by the | ensures that the selected cipher suite is the most preferred (by the | |||
Initiator) cipher suite supported by both parties. | Initiator) cipher suite supported by both parties. | |||
If the selected cipher suite is not the first cipher suite which the | If the selected cipher suite is not the first cipher suite which the | |||
Responder supports in SUITES_I received in message_1, then Responder | Responder supports in SUITES_I received in message_1, then Responder | |||
MUST discontinue the protocol, see Section 5.3.3. If SUITES_I in | MUST discontinue the protocol, see Section 5.3.3. If SUITES_I in | |||
message_1 is manipulated then the integrity verification of message_2 | message_1 is manipulated then the integrity verification of message_2 | |||
containing the transcript hash TH_2 = H( message_1, data_2 ) will | containing the transcript hash TH_2 will fail and the Initiator will | |||
fail and the Initiator will discontinue the protocol. | discontinue the protocol. | |||
7. Transferring EDHOC and Deriving an OSCORE Context | 7. Transferring EDHOC and Deriving an OSCORE Context | |||
7.1. EDHOC Message 4 | 7.1. 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 Section 7.2.1). In | the EDHOC-Exporter, e.g., using OSCORE (see | |||
deployments where no protected application message is sent from the | [I-D.ietf-core-oscore-edhoc]). In deployments where no protected | |||
Responder to the Initiator, the Responder MUST send message_4. Two | application message is sent from the Responder to the Initiator, the | |||
examples of such deployments: | Responder MUST send message_4. 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 are provided in Section 3.7. | Further considerations are provided in Section 3.7. | |||
7.1.1. Formatting of Message 4 | 7.1.1. Formatting of Message 4 | |||
message_4 and data_4 SHALL be CBOR Sequences (see Appendix A.1) as | message_4 and data_4 SHALL be CBOR Sequences (see Appendix B.1) as | |||
defined below | defined below | |||
message_4 = ( | message_4 = ( | |||
data_4, | data_4, | |||
MAC_4 : bstr, | CIPHERTEXT_4 : bstr, | |||
) | ) | |||
data_4 = ( | data_4 = ( | |||
? C_I : bstr_identifier, | ? C_I : bstr_identifier, | |||
) | ) | |||
7.1.2. Responder Processing of Message 4 | 7.1.2. Responder Processing of Message 4 | |||
The Responder SHALL compose message_4 as follows: | The Responder SHALL compose message_4 as follows: | |||
* If corr (METHOD_CORR mod 4) equals 1 or 3, C_I is omitted, | * If corr (METHOD_CORR mod 4) equals 1 or 3, C_I is omitted, | |||
otherwise C_I is not omitted. | otherwise C_I is not omitted. | |||
* Compute an inner COSE_Encrypt0 as defined in Section 5.3 of | * Compute a COSE_Encrypt0 as defined in Section 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 | |||
in the selected cipher suite, and the following parameters: | in the selected cipher suite, and the following parameters. The | |||
protected header SHALL be empty. | ||||
- protected = h'' | - protected = h'' | |||
- external_aad = << TH_4 >> | - external_aad = TH_4 | |||
- plaintext = h'' | - plaintext = ( ? EAD_4 ) | |||
COSE constructs the input to the AEAD [RFC5116] as follows: | where EAD_4 is protected external authorization data, see | |||
Section 3.6. COSE constructs the input to the AEAD [RFC5116] as | ||||
follows: | ||||
- Key K = EDHOC-Exporter( "EDHOC_message_4_Key", length ) | - Key K = EDHOC-Exporter( "EDHOC_message_4_Key", length ) | |||
- Nonce N = EDHOC-Exporter( "EDHOC_message_4_Nonce", length ) | - Nonce N = EDHOC-Exporter( "EDHOC_message_4_Nonce", length ) | |||
- Plaintext P = ( ? EAD_4 ) | ||||
- Plaintext P = 0x (the empty string) | - Associated data A = [ "Encrypt0", h'', TH_4 ] | |||
- Associated data A = | ||||
[ "Encrypt0", h'', << TH_4 >> ] | ||||
MAC_4 is the 'ciphertext' of the COSE_Encrypt0. | CIPHERTEXT_4 is the 'ciphertext' of the COSE_Encrypt0. | |||
* Encode message_4 as a sequence of CBOR encoded data items as | * Encode message_4 as a sequence of CBOR encoded data items as | |||
specified in Section 7.1.1. | specified in Section 7.1.1. | |||
7.1.3. Initiator Processing of Message 4 | 7.1.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 A.1). | * Decode message_4 (see Appendix B.1). | |||
* Retrieve the protocol state using the connection identifier C_I | * Retrieve the protocol state using the connection identifier C_I | |||
and/or other external information such as the CoAP Token and the | and/or other external information such as the CoAP Token and the | |||
5-tuple. | 5-tuple. | |||
* Verify MAC_4 as defined in Section 5.3 of | * Decrypt and verify the outer COSE_Encrypt0 as defined in | |||
[I-D.ietf-cose-rfc8152bis-struct], with the EDHOC AEAD algorithm | Section 5.3 of [I-D.ietf-cose-rfc8152bis-struct], with the EDHOC | |||
in the selected cipher suite, and the parameters defined in | AEAD algorithm in the selected cipher suite, and the parameters | |||
Section 7.1.2. | defined in Section 7.1.2. | |||
* Pass EAD_4 to the security application. | ||||
If any verification step fails the Initiator MUST send an EDHOC error | If any verification step fails the Initiator MUST send an EDHOC error | |||
message back, formatted as defined in Section 6, and the protocol | message back, formatted as defined in Section 6, and the session MUST | |||
MUST be discontinued. | be discontinued. | |||
7.2. Transferring EDHOC in CoAP | 7.2. Transferring EDHOC in CoAP | |||
It is recommended to transport EDHOC as an exchange of CoAP [RFC7252] | It is recommended to transport EDHOC as an exchange of CoAP [RFC7252] | |||
messages. CoAP is a reliable transport that can preserve packet | messages. CoAP is a reliable transport that can preserve packet | |||
ordering and handle message duplication. CoAP can also perform | ordering and handle message duplication. CoAP can also perform | |||
fragmentation and protect against denial of service attacks. It is | fragmentation and protect against denial of service attacks. It is | |||
recommended to carry the EDHOC messages in Confirmable messages, | recommended to carry the EDHOC messages in Confirmable messages, | |||
especially if fragmentation is used. | especially if fragmentation is used. | |||
skipping to change at page 41, line 33 ¶ | skipping to change at page 42, line 33 ¶ | |||
Figure 10: Transferring EDHOC in CoAP when the Initiator is CoAP | Figure 10: Transferring EDHOC in CoAP when the Initiator is CoAP | |||
Server | 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 [I-D.ietf-core-echo-request-tag]. This | containing an Echo option [I-D.ietf-core-echo-request-tag]. This | |||
forces the initiator to demonstrate its reachability at its apparent | forces the initiator to demonstrate its reachability at its apparent | |||
network address. If message fragmentation is needed, the EDHOC | network address. If message fragmentation is needed, the EDHOC | |||
messages may be fragmented using the CoAP Block-Wise Transfer | messages may be fragmented using the CoAP Block-Wise Transfer | |||
mechanism [RFC7959]. | mechanism [RFC7959]. EDHOC does not restrict how error messages are | |||
transported with CoAP, as long as the appropriate error message can | ||||
7.2.1. Deriving an OSCORE Context from EDHOC | to be transported in response to a message that failed (see | |||
Section 6). The use of EDHOC with OSCORE is specified in | ||||
When EDHOC is used to derive parameters for OSCORE [RFC8613], the | [I-D.ietf-core-oscore-edhoc]. | |||
parties make sure that the EDHOC connection identifiers are unique, | ||||
i.e. C_R MUST NOT be equal to C_I. The CoAP client and server MUST | ||||
be able to retrieve the OSCORE protocol state using its chosen | ||||
connection identifier and optionally other information such as the | ||||
5-tuple. In case that the CoAP client is the Initiator and the CoAP | ||||
server is the Responder: | ||||
* The client's OSCORE Sender ID is C_R and the server's OSCORE | ||||
Sender ID is C_I, as defined in this document | ||||
* The AEAD Algorithm and the hash algorithm are the application AEAD | ||||
and hash algorithms in the selected cipher suite. | ||||
* The Master Secret and Master Salt are derived as follows. By | ||||
default key_length is the key length (in bytes) of the application | ||||
AEAD Algorithm and salt_length is 8 bytes. The Initiator and | ||||
Responder MAY agree out-of-band on a longer key_length than the | ||||
default and a different salt_length. | ||||
Master Secret = EDHOC-Exporter( "OSCORE Master Secret", key_length ) | ||||
Master Salt = EDHOC-Exporter( "OSCORE Master Salt", salt_length ) | ||||
7.2.2. Error Messages with CoAP Transport | ||||
EDHOC does not restrict how error messages are transported with CoAP, | ||||
as long as the appropriate error message can to be transported in | ||||
response to a message that failed (see Section 6). In case of | ||||
combining EDHOC and OSCORE as specified in | ||||
[I-D.ietf-core-oscore-edhoc], an error message following a combined | ||||
EDHOC message_3/OSCORE request MUST be sent with a CoAP error code | ||||
and SHALL contain the ERR_INFO as payload (see Section 6). | ||||
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 | |||
perfect forward secrecy, mutual authentication with aliveness, | perfect forward secrecy, mutual authentication with aliveness, | |||
consistency, and peer awareness. As described in [SIGMA], peer | consistency, and peer awareness. As described in [SIGMA], peer | |||
awareness is provided to the Responder, but not to the Initiator. | awareness is provided to the Responder, but not to the Initiator. | |||
EDHOC protects the credential identifier of the Initiator against | EDHOC protects the credential identifier of the Initiator against | |||
active attacks and the credential identifier of the Responder against | active attacks and the credential identifier of the Responder against | |||
passive attacks. The roles should be assigned to protect the most | passive attacks. The roles should be assigned to protect the most | |||
sensitive identity/identifier, typically that which is not possible | sensitive identity/identifier, typically that which is not possible | |||
to infer from routing information in the lower layers. | 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, auxiliary data, and previous messages. This protects | algorithms, external authorization data, and previous messages. This | |||
against an attacker replaying messages or injecting messages from | protects against an attacker replaying messages or injecting messages | |||
another session. | from another session. | |||
EDHOC also adds negotiation of connection identifiers and downgrade | EDHOC also adds negotiation 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 | |||
does not include negotiation of cipher suites, but it enables the | does not include negotiation of cipher suites, but it enables the | |||
Responder to verify that the selected cipher suite is the most | Responder to verify that the selected cipher suite is the most | |||
preferred cipher suite by the Initiator which is supported by both | preferred cipher suite by the Initiator which is supported by both | |||
the Initiator and the Responder. | the Initiator and the Responder. | |||
As required by [RFC7258], IETF protocols need to mitigate pervasive | As required by [RFC7258], IETF protocols need to mitigate pervasive | |||
skipping to change at page 45, line 25 ¶ | skipping to change at page 45, line 42 ¶ | |||
method). | method). | |||
The data rates in many IoT deployments are very limited. Given that | The data rates in many IoT deployments are very limited. Given that | |||
the application keys are protected as well as the long-term | the application keys are protected as well as the long-term | |||
authentication keys they can often be used for years or even decades | authentication keys they can often be used for years or even decades | |||
before the cryptographic limits are reached. If the application keys | before the cryptographic limits are reached. If the application keys | |||
established through EDHOC need to be renewed, the communicating | established through EDHOC need to be renewed, the communicating | |||
parties can derive application keys with other labels or run EDHOC | parties can derive application keys with other labels or run EDHOC | |||
again. | again. | |||
Requirement for how to securely generate, validate, and process the | ||||
ephermeral public keys depend on the elliptic curve. For X25519 and | ||||
X448, the requirements are defined in [RFC7748]. For secp256r1, | ||||
secp384r1, and secp521r1, the requirements are defined in Section 5 | ||||
of [SP-800-56A]. For secp256r1, secp384r1, and secp521r1, at least | ||||
partial public-key validation MUST be done. | ||||
8.3. Cipher Suites and Cryptographic Algorithms | 8.3. Cipher Suites and Cryptographic Algorithms | |||
For many constrained IoT devices it is problematic to support more | For many constrained IoT devices it is problematic to support more | |||
than one cipher suite. Existing devices can be expected to support | than one cipher suite. Existing devices can be expected to support | |||
either ECDSA or EdDSA. To enable as much interoperability as we can | either ECDSA or EdDSA. To enable as much interoperability as we can | |||
reasonably achieve, less constrained devices SHOULD implement both | reasonably achieve, less constrained devices SHOULD implement both | |||
cipher suite 0 (AES-CCM-16-64-128, SHA-256, X25519, EdDSA, Ed25519, | cipher suite 0 (AES-CCM-16-64-128, SHA-256, X25519, EdDSA, AES-CCM- | |||
AES-CCM-16-64-128, SHA-256) and cipher suite 2 (AES-CCM-16-64-128, | 16-64-128, SHA-256) and cipher suite 2 (AES-CCM-16-64-128, SHA-256, | |||
SHA-256, P-256, ES256, P-256, AES-CCM-16-64-128, SHA-256). | P-256, ES256, AES-CCM-16-64-128, SHA-256). Constrained endpoints | |||
Constrained endpoints SHOULD implement cipher suite 0 or cipher suite | SHOULD implement cipher suite 0 or cipher suite 2. Implementations | |||
2. Implementations only need to implement the algorithms needed for | only need to implement the algorithms needed for their supported | |||
their supported methods. | methods. | |||
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 (256-bit Hash truncated to | The hash algorithms SHA-1 and SHA-256/64 (256-bit Hash truncated to | |||
64-bits) SHALL NOT be supported for use in EDHOC except for | 64-bits) SHALL NOT be supported for use in EDHOC except for | |||
certificate identification with x5u and c5u. Note that secp256k1 is | certificate identification with x5u and c5u. Note that secp256k1 is | |||
only defined for use with ECDSA and not for ECDH. | only defined for use with ECDSA and not for ECDH. | |||
8.4. Unprotected Data | 8.4. Unprotected Data | |||
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 AD_1, ID_CRED_R, AD_2, and ERR_MSG. Using | particular, it applies to EAD_1, ID_CRED_R, EAD_2, and error | |||
the same AD_1 in several EDHOC sessions allows passive eavesdroppers | messages. Using the same EAD_1 in several EDHOC sessions allows | |||
to correlate the different sessions. Another consideration is that | passive eavesdroppers to correlate the different sessions. Another | |||
the list of supported cipher suites may potentially be used to | consideration is that the list of supported cipher suites may | |||
identify the application. | potentially be used to identify the application. | |||
The Initiator and the Responder must also make sure that | The Initiator and the Responder must also make sure that | |||
unauthenticated data does not trigger any harmful actions. In | unauthenticated data does not trigger any harmful actions. In | |||
particular, this applies to AD_1 and ERR_MSG. | particular, this applies to EAD_1 and error messages. | |||
8.5. Denial-of-Service | 8.5. Denial-of-Service | |||
EDHOC itself does not provide countermeasures against Denial-of- | EDHOC itself does not provide countermeasures against Denial-of- | |||
Service attacks. By sending a number of new or replayed message_1 an | Service attacks. By sending a number of new or replayed message_1 an | |||
attacker may cause the Responder to allocate state, perform | attacker may cause the Responder to allocate state, perform | |||
cryptographic operations, and amplify messages. To mitigate such | cryptographic operations, and amplify messages. To mitigate such | |||
attacks, an implementation SHOULD rely on lower layer mechanisms such | attacks, an implementation SHOULD rely on lower layer mechanisms such | |||
as the Echo option in CoAP [I-D.ietf-core-echo-request-tag] that | as the Echo option in CoAP [I-D.ietf-core-echo-request-tag] that | |||
forces the initiator to demonstrate reachability at its apparent | forces the initiator to demonstrate reachability at its apparent | |||
network address. | network address. | |||
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 | ||||
message and discontinue the session. EDHOC implementations MAY | ||||
evaluate if a received message is likely to have be forged by and | ||||
attacker and ignore it without sending an error message or | ||||
discontinuing the session. | ||||
8.6. Implementation Considerations | 8.6. 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 truly random seed MUST be provided from an external | |||
source and used with a cryptographically secure pseudorandom number | source and used with a cryptographically secure pseudorandom number | |||
generator. As each pseudorandom number must only be used once, an | generator. As each pseudorandom number must only be used once, an | |||
implementation need to get a new truly random seed after reboot, or | implementation need to get a new truly random seed after reboot, or | |||
continuously store state in nonvolatile memory, see ([RFC8613], | continuously store state in nonvolatile memory, see ([RFC8613], | |||
Appendix B.1.1) for issues and solution approaches for writing to | Appendix B.1.1) for issues and solution approaches for writing to | |||
skipping to change at page 47, line 13 ¶ | skipping to change at page 48, line 4 ¶ | |||
unaugmented random numbers on the wire. | unaugmented random numbers on the wire. | |||
If ECDSA is supported, "deterministic ECDSA" as specified in | If ECDSA is supported, "deterministic ECDSA" as specified in | |||
[RFC6979] MAY be used. Pure deterministic elliptic-curve signatures | [RFC6979] MAY be used. Pure deterministic elliptic-curve signatures | |||
such as deterministic ECDSA and EdDSA have gained popularity over | such as deterministic ECDSA and EdDSA have gained popularity over | |||
randomized ECDSA as their security do not depend on a source of high- | randomized ECDSA as their security do not depend on a source of high- | |||
quality randomness. Recent research has however found that | quality randomness. Recent research has however found that | |||
implementations of these signature algorithms may be vulnerable to | implementations of these signature algorithms may be vulnerable to | |||
certain side-channel and fault injection attacks due to their | certain side-channel and fault injection attacks due to their | |||
determinism. See e.g. Section 1 of | 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 6.1.2 of [I-D.ietf-cose-rfc8152bis-algs] this | |||
can be addressed by combining randomness and determinism. | can be addressed by combining randomness and determinism. | |||
The referenced processing instructions in [SP-800-56A] must be | All private keys, symmetric keys, and IVs MUST be secret. | |||
complied with, including deleting the intermediate computed values | ||||
along with any ephemeral ECDH secrets after the key derivation is | ||||
completed. The ECDH shared secrets, 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. Depending on the selected curve, the | attacks such as timing attacks. Intermediate computed values such as | |||
parties should perform various validations of each other's public | ephemeral ECDH keys and ECDH shared secrets MUST be deleted after key | |||
keys, see e.g. Section 5 of [SP-800-56A]. | 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 of certificates. The selection of trusted CAs should be | |||
done very carefully and certificate revocation should be supported. | done very carefully and certificate revocation should be supported. | |||
The private authentication keys MUST be kept secret. | The private authentication keys MUST be kept secret. | |||
The Initiator and the Responder are allowed to select the connection | The Initiator and the Responder are allowed to select the 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). | |||
The Responder MUST finish the verification step of message_3 before | ||||
passing AD_3 to the application. | ||||
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. If the two G_X values are equal, the | |||
received message_1 MUST be discarded to mitigate reflection attacks. | received message_1 MUST be discarded to mitigate reflection attacks. | |||
Note that in the case of two simultaneous EDHOC exchanges where the | Note that in the case of two simultaneous EDHOC exchanges where the | |||
nodes only complete one and where the nodes have different preferred | nodes only complete one and where the nodes have different preferred | |||
cipher suites, an attacker can affect which of the two nodes' | cipher suites, an attacker can affect which of the two nodes' | |||
preferred cipher suites will be used by blocking the other exchange. | 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 is 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 in | |||
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 pseudorandom keys | |||
done inside the TEE. The TEE can also be used to protect the EDHOC | (PRK) can be done inside the TEE. The use of a TEE enforces that | |||
and application protocol (e.g. OSCORE) implementation using some | code within that environment cannot be tampered with, and that any | |||
form of "secure boot", memory protection etc. The use of a TEE | data used by such code cannot be read or tampered with by code | |||
enforces that code within that environment cannot be tampered with, | outside that environment. Note that non-EDHOC code inside the TEE | |||
and that any data used by such code cannot be read or tampered with | might still be able to read EDHOC data and tamper with EDHOC code, to | |||
by code outside that environment. | protect against such attacks EDHOC needs to be in its own zone. To | |||
provide better protection against some forms of physical attacks, | ||||
sensitive EDHOC data should be stored inside the SoC or encrypted and | ||||
integrity protected when sent on a data bus (e.g. between the CPU and | ||||
RAM or Flash). Secure boot can be used to increase the security of | ||||
code and data in the Rich Execution Environment (REE) by validating | ||||
the REE image. | ||||
9. IANA Considerations | 9. IANA Considerations | |||
9.1. EDHOC Cipher Suites Registry | 9.1. EDHOC Exporter Label | |||
IANA has created a new registry titled "EDHOC Exporter Label" under | ||||
the new heading "EDHOC". The registration procedure is "Expert | ||||
Review". The columns of the registry are Label, Description, and | ||||
Reference. All columns are text strings. The initial contents of | ||||
the registry are: | ||||
Label: EDHOC_message_4_Key | ||||
Description: Key used to protect EDHOC message_4 | ||||
Reference: [[this document]] | ||||
Label: EDHOC_message_4_Nonce | ||||
Description: Nonce used to protect EDHOC message_4 | ||||
Reference: [[this document]] | ||||
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 heading "EDHOC". The registration procedure is "Expert | the new heading "EDHOC". The registration procedure is "Expert | |||
Review". The columns of the registry are Value, Array, Description, | Review". The columns of the registry are Value, Array, Description, | |||
and Reference, where Value is an integer and the other columns are | and Reference, where Value is an integer and the other columns are | |||
text strings. The initial contents of the registry are: | text strings. The initial contents of the registry are: | |||
Value: -24 | Value: -24 | |||
Algorithms: N/A | Algorithms: N/A | |||
Desc: Reserved for Private Use | Desc: Reserved for Private Use | |||
skipping to change at page 49, line 10 ¶ | skipping to change at page 50, line 10 ¶ | |||
Value: -22 | Value: -22 | |||
Algorithms: N/A | Algorithms: N/A | |||
Desc: Reserved for Private Use | Desc: Reserved for Private Use | |||
Reference: [[this document]] | 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]] | Reference: [[this document]] | |||
Value: 0 | Value: 0 | |||
Array: 10, 5, 4, -8, 6, 10, 5 | Array: 10, -16, 4, -8, 10, -16 | |||
Desc: AES-CCM-16-64-128, SHA-256, X25519, EdDSA, Ed25519, | Desc: AES-CCM-16-64-128, SHA-256, X25519, EdDSA, | |||
AES-CCM-16-64-128, SHA-256 | AES-CCM-16-64-128, SHA-256 | |||
Reference: [[this document]] | Reference: [[this document]] | |||
Value: 1 | Value: 1 | |||
Array: 30, 5, 4, -8, 6, 10, 5 | Array: 30, -16, 4, -8, 10, -16 | |||
Desc: AES-CCM-16-128-128, SHA-256, X25519, EdDSA, Ed25519, | Desc: AES-CCM-16-128-128, SHA-256, X25519, EdDSA, | |||
AES-CCM-16-64-128, SHA-256 | AES-CCM-16-64-128, SHA-256 | |||
Reference: [[this document]] | Reference: [[this document]] | |||
Value: 2 | Value: 2 | |||
Array: 10, 5, 1, -7, 1, 10, 5 | Array: 10, -16, 1, -7, 10, -16 | |||
Desc: AES-CCM-16-64-128, SHA-256, P-256, ES256, P-256, | Desc: AES-CCM-16-64-128, SHA-256, P-256, ES256, | |||
AES-CCM-16-64-128, SHA-256 | AES-CCM-16-64-128, SHA-256 | |||
Reference: [[this document]] | Reference: [[this document]] | |||
Value: 3 | Value: 3 | |||
Array: 30, 5, 1, -7, 1, 10, 5 | Array: 30, -16, 1, -7, 10, -16 | |||
Desc: AES-CCM-16-128-128, SHA-256, P-256, ES256, P-256, | Desc: AES-CCM-16-128-128, SHA-256, P-256, ES256, | |||
AES-CCM-16-64-128, SHA-256 | AES-CCM-16-64-128, SHA-256 | |||
Reference: [[this document]] | Reference: [[this document]] | |||
Value: 4 | Value: 4 | |||
Array: 1, -16, 4, -7, 1, 1, -16 | Array: 1, -16, 4, -7, 1, -16 | |||
Desc: A128GCM, SHA-256, X25519, ES256, P-256, | Desc: A128GCM, SHA-256, X25519, ES256, | |||
A128GCM, SHA-256 | A128GCM, SHA-256 | |||
Reference: [[this document]] | Reference: [[this document]] | |||
Value: 5 | Value: 5 | |||
Array: 3, -43, 2, -35, 2, 3, -43 | Array: 3, -43, 2, -35, 3, -43 | |||
Desc: A256GCM, SHA-384, P-384, ES384, P-384, | Desc: A256GCM, SHA-384, P-384, ES384, | |||
A256GCM, SHA-384 | A256GCM, SHA-384 | |||
Reference: [[this document]] | Reference: [[this document]] | |||
9.2. 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 heading "EDHOC". The registration procedure is "Expert | the new heading "EDHOC". The registration procedure is "Expert | |||
Review". The columns of the registry are Value, Description, and | Review". The columns of the registry are Value, Description, and | |||
Reference, where Value is an integer and the other columns are text | Reference, where Value is an integer and the other columns are text | |||
strings. The initial contents of the registry is shown in Figure 4. | strings. The initial contents of the registry is shown in Figure 4. | |||
9.3. 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 heading "EDHOC". The registration procedure is | the new heading "EDHOC". The registration procedure is | |||
"Specification Required". The columns of the registry are ERR_CODE, | "Specification Required". The columns of the registry are ERR_CODE, | |||
ERR_INFO Type and Description, where ERR_CODE is an integer, ERR_INFO | ERR_INFO Type and Description, where ERR_CODE is an integer, ERR_INFO | |||
is a CDDL defined type, and Description is a text string. The | is a CDDL defined type, and Description is a text string. The | |||
initial contents of the registry is shown in Figure 6. | initial contents of the registry is shown in Figure 6. | |||
9.4. The Well-Known URI Registry | 9.5. The Well-Known URI Registry | |||
IANA has added the well-known URI 'edhoc' to the Well-Known URIs | IANA has added the well-known URI 'edhoc' to the Well-Known URIs | |||
registry. | registry. | |||
* URI suffix: edhoc | * URI suffix: edhoc | |||
* Change controller: IETF | * Change controller: IETF | |||
* Specification document(s): [[this document]] | * Specification document(s): [[this document]] | |||
* Related information: None | * Related information: None | |||
9.5. Media Types Registry | 9.6. Media Types Registry | |||
IANA has added the media type 'application/edhoc' to the Media Types | IANA has added the media type 'application/edhoc' to the Media Types | |||
registry. | registry. | |||
* Type name: application | * Type name: application | |||
* Subtype name: edhoc | * Subtype name: edhoc | |||
* Required parameters: N/A | * Required parameters: N/A | |||
skipping to change at page 51, line 22 ¶ | skipping to change at page 52, line 22 ¶ | |||
"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.6. CoAP Content-Formats Registry | 9.7. CoAP Content-Formats Registry | |||
IANA has added the media type 'application/edhoc' to the CoAP | IANA has added the media type 'application/edhoc' to the CoAP | |||
Content-Formats registry. | Content-Formats registry. | |||
* Media Type: application/edhoc | * Media Type: application/edhoc | |||
* Encoding: | * Encoding: | |||
* ID: TBD42 | * ID: TBD42 | |||
* Reference: [[this document]] | * Reference: [[this document]] | |||
9.7. Expert Review Instructions | 9.8. Expert Review Instructions | |||
The IANA Registries established in this document is defined as | The IANA Registries established in this document is 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. | |||
skipping to change at page 53, line 47 ¶ | skipping to change at page 54, line 47 ¶ | |||
DOI 10.17487/RFC8724, April 2020, | DOI 10.17487/RFC8724, April 2020, | |||
<https://www.rfc-editor.org/info/rfc8724>. | <https://www.rfc-editor.org/info/rfc8724>. | |||
[RFC8742] Bormann, C., "Concise Binary Object Representation (CBOR) | [RFC8742] Bormann, C., "Concise Binary Object Representation (CBOR) | |||
Sequences", RFC 8742, DOI 10.17487/RFC8742, February 2020, | Sequences", RFC 8742, DOI 10.17487/RFC8742, February 2020, | |||
<https://www.rfc-editor.org/info/rfc8742>. | <https://www.rfc-editor.org/info/rfc8742>. | |||
[I-D.ietf-cose-rfc8152bis-struct] | [I-D.ietf-cose-rfc8152bis-struct] | |||
Schaad, J., "CBOR Object Signing and Encryption (COSE): | Schaad, J., "CBOR Object Signing and Encryption (COSE): | |||
Structures and Process", Work in Progress, Internet-Draft, | Structures and Process", Work in Progress, Internet-Draft, | |||
draft-ietf-cose-rfc8152bis-struct-14, 24 September 2020, | draft-ietf-cose-rfc8152bis-struct-15, 1 February 2021, | |||
<http://www.ietf.org/internet-drafts/draft-ietf-cose- | <https://www.ietf.org/archive/id/draft-ietf-cose- | |||
rfc8152bis-struct-14.txt>. | rfc8152bis-struct-15.txt>. | |||
[I-D.ietf-cose-rfc8152bis-algs] | [I-D.ietf-cose-rfc8152bis-algs] | |||
Schaad, J., "CBOR Object Signing and Encryption (COSE): | Schaad, J., "CBOR Object Signing and Encryption (COSE): | |||
Initial Algorithms", Work in Progress, Internet-Draft, | Initial Algorithms", Work in Progress, Internet-Draft, | |||
draft-ietf-cose-rfc8152bis-algs-12, 24 September 2020, | draft-ietf-cose-rfc8152bis-algs-12, 24 September 2020, | |||
<http://www.ietf.org/internet-drafts/draft-ietf-cose- | <https://www.ietf.org/archive/id/draft-ietf-cose- | |||
rfc8152bis-algs-12.txt>. | rfc8152bis-algs-12.txt>. | |||
[I-D.ietf-cose-x509] | [I-D.ietf-cose-x509] | |||
Schaad, J., "CBOR Object Signing and Encryption (COSE): | Schaad, J., "CBOR Object Signing and Encryption (COSE): | |||
Header parameters for carrying and referencing X.509 | Header parameters for carrying and referencing X.509 | |||
certificates", Work in Progress, Internet-Draft, draft- | certificates", Work in Progress, Internet-Draft, draft- | |||
ietf-cose-x509-08, 14 December 2020, <http://www.ietf.org/ | ietf-cose-x509-08, 14 December 2020, | |||
internet-drafts/draft-ietf-cose-x509-08.txt>. | <https://www.ietf.org/internet-drafts/draft-ietf-cose- | |||
x509-08.txt>. | ||||
[I-D.ietf-core-echo-request-tag] | [I-D.ietf-core-echo-request-tag] | |||
Amsuess, C., Mattsson, J., and G. Selander, "CoAP: Echo, | Amsüss, C., Mattsson, J. P., and G. Selander, "CoAP: Echo, | |||
Request-Tag, and Token Processing", Work in Progress, | Request-Tag, and Token Processing", Work in Progress, | |||
Internet-Draft, draft-ietf-core-echo-request-tag-11, 2 | Internet-Draft, draft-ietf-core-echo-request-tag-12, 1 | |||
November 2020, <http://www.ietf.org/internet-drafts/draft- | February 2021, <https://www.ietf.org/archive/id/draft- | |||
ietf-core-echo-request-tag-11.txt>. | ietf-core-echo-request-tag-12.txt>. | |||
[I-D.ietf-lake-reqs] | [I-D.ietf-lake-reqs] | |||
Vucinic, M., Selander, G., Mattsson, J., and D. Garcia- | Vucinic, M., Selander, G., Mattsson, J. P., and D. Garcia- | |||
Carillo, "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, <http://www.ietf.org/internet-drafts/draft- | 8 June 2020, <https://www.ietf.org/archive/id/draft-ietf- | |||
ietf-lake-reqs-04.txt>. | lake-reqs-04.txt>. | |||
10.2. Informative References | 10.2. Informative References | |||
[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 | |||
skipping to change at page 55, line 11 ¶ | skipping to change at page 56, line 11 ¶ | |||
[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>. | |||
[I-D.ietf-core-resource-directory] | [I-D.ietf-core-resource-directory] | |||
Amsuess, C., Shelby, Z., Koster, M., Bormann, C., and P. | Amsüss, C., Shelby, Z., Koster, M., Bormann, C., and P. V. | |||
Stok, "CoRE Resource Directory", Work in Progress, | D. Stok, "CoRE Resource Directory", Work in Progress, | |||
Internet-Draft, draft-ietf-core-resource-directory-26, 2 | Internet-Draft, draft-ietf-core-resource-directory-28, 7 | |||
November 2020, <http://www.ietf.org/internet-drafts/draft- | March 2021, <https://www.ietf.org/archive/id/draft-ietf- | |||
ietf-core-resource-directory-26.txt>. | core-resource-directory-28.txt>. | |||
[I-D.ietf-lwig-security-protocol-comparison] | [I-D.ietf-lwig-security-protocol-comparison] | |||
Mattsson, J., Palombini, F., and M. Vucinic, "Comparison | Mattsson, J. P., Palombini, F., and M. Vucinic, | |||
of CoAP Security Protocols", Work in Progress, Internet- | "Comparison of CoAP Security Protocols", Work in Progress, | |||
Draft, draft-ietf-lwig-security-protocol-comparison-05, 2 | Internet-Draft, draft-ietf-lwig-security-protocol- | |||
November 2020, <http://www.ietf.org/internet-drafts/draft- | comparison-05, 2 November 2020, | |||
ietf-lwig-security-protocol-comparison-05.txt>. | <https://www.ietf.org/archive/id/draft-ietf-lwig-security- | |||
protocol-comparison-05.txt>. | ||||
[I-D.ietf-tls-dtls13] | [I-D.ietf-tls-dtls13] | |||
Rescorla, E., Tschofenig, H., and N. Modadugu, "The | Rescorla, E., Tschofenig, H., and N. Modadugu, "The | |||
Datagram Transport Layer Security (DTLS) Protocol Version | Datagram Transport Layer Security (DTLS) Protocol Version | |||
1.3", Work in Progress, Internet-Draft, draft-ietf-tls- | 1.3", Work in Progress, Internet-Draft, draft-ietf-tls- | |||
dtls13-40, 20 January 2021, <http://www.ietf.org/internet- | dtls13-43, 30 April 2021, <https://www.ietf.org/internet- | |||
drafts/draft-ietf-tls-dtls13-40.txt>. | drafts/draft-ietf-tls-dtls13-43.txt>. | |||
[I-D.selander-ace-ake-authz] | [I-D.selander-ace-ake-authz] | |||
Selander, G., Mattsson, J., Vucinic, M., Richardson, M., | Selander, G., Mattsson, J. P., Vucinic, M., Richardson, | |||
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-02, 2 November 2020, | Draft, draft-selander-ace-ake-authz-02, 2 November 2020, | |||
<http://www.ietf.org/internet-drafts/draft-selander-ace- | <https://www.ietf.org/archive/id/draft-selander-ace-ake- | |||
ake-authz-02.txt>. | authz-02.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, "Combining EDHOC and OSCORE", Work in | and G. Selander, "Combining EDHOC and OSCORE", Work in | |||
Progress, Internet-Draft, draft-ietf-core-oscore-edhoc-00, | Progress, Internet-Draft, draft-ietf-core-oscore-edhoc-00, | |||
1 April 2021, <https://www.ietf.org/internet-drafts/draft- | 1 April 2021, <https://www.ietf.org/internet-drafts/draft- | |||
ietf-core-oscore-edhoc-00.txt>. | ietf-core-oscore-edhoc-00.txt>. | |||
[I-D.mattsson-cose-cbor-cert-compress] | [I-D.ietf-cose-cbor-encoded-cert] | |||
Raza, S., Hoglund, J., Selander, G., Mattsson, J., and M. | Raza, S., Höglund, J., Selander, G., Mattsson, J. P., and | |||
Furuhed, "CBOR Encoding of X.509 Certificates (CBOR | M. Furuhed, "CBOR Encoded X.509 Certificates (C509 | |||
Certificates)", Work in Progress, Internet-Draft, draft- | Certificates)", Work in Progress, Internet-Draft, draft- | |||
mattsson-cose-cbor-cert-compress-06, 19 January 2021, | ietf-cose-cbor-encoded-cert-00, 28 April 2021, | |||
<http://www.ietf.org/internet-drafts/draft-mattsson-cose- | <https://www.ietf.org/archive/id/draft-ietf-cose-cbor- | |||
cbor-cert-compress-06.txt>. | encoded-cert-00.txt>. | |||
[I-D.mattsson-cfrg-det-sigs-with-noise] | [I-D.mattsson-cfrg-det-sigs-with-noise] | |||
Mattsson, J., 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-02, 11 March 2020, | mattsson-cfrg-det-sigs-with-noise-02, 11 March 2020, | |||
<http://www.ietf.org/internet-drafts/draft-mattsson-cfrg- | <https://www.ietf.org/archive/id/draft-mattsson-cfrg-det- | |||
det-sigs-with-noise-02.txt>. | sigs-with-noise-02.txt>. | |||
[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>. | |||
[SECG] "Standards for Efficient Cryptography 1 (SEC 1)", May | ||||
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>. | <http://webee.technion.ac.il/~hugo/sigma-pdf.pdf>. | |||
[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>. | |||
skipping to change at page 56, line 46 ¶ | skipping to change at page 58, line 8 ¶ | |||
[Bruni18] Bruni, A., Sahl Jørgensen, T., Grønbech Petersen, T., and | [Bruni18] Bruni, A., Sahl Jørgensen, T., Grønbech Petersen, T., and | |||
C. Schürmann, "Formal Verification of Ephemeral Diffie- | C. Schürmann, "Formal Verification of Ephemeral Diffie- | |||
Hellman Over COSE (EDHOC)", November 2018, | Hellman Over COSE (EDHOC)", November 2018, | |||
<https://www.springerprofessional.de/en/formal- | <https://www.springerprofessional.de/en/formal- | |||
verification-of-ephemeral-diffie-hellman-over-cose- | verification-of-ephemeral-diffie-hellman-over-cose- | |||
edhoc/16284348>. | edhoc/16284348>. | |||
[CborMe] Bormann, C., "CBOR Playground", May 2018, | [CborMe] Bormann, C., "CBOR Playground", May 2018, | |||
<http://cbor.me/>. | <http://cbor.me/>. | |||
Appendix A. Use of CBOR, CDDL and COSE in EDHOC | Appendix A. Compact Representation | |||
As described in Section 4.2 of [RFC6090] the x-coordinate of an | ||||
elliptic curve public key is a suitable representative for the entire | ||||
point whenever scalar multiplication is used as a one-way function. | ||||
One example is ECDH with compact output, where only the x-coordinate | ||||
of the computed value is used as the shared secret. | ||||
This section defines a format for compact representation based on the | ||||
Elliptic-Curve-Point-to-Octet-String Conversion defined in | ||||
Section 2.3.3 of [SECG]. Using the notation from [SECG], the output | ||||
is an octet string of length 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( | ||||
(log2 q) / 8 ) octets using the conversion routine specified in | ||||
Section 2.3.5 of [SECG]. | ||||
2. Output M = X | ||||
The encoding of the point at infinity is not supported. Compact | ||||
representation does not change any requirements on validation. If a | ||||
y-coordinate is required for validation or compatibily with APIs the | ||||
value ~yp SHALL be set to zero. For such use, the compact | ||||
representation can be transformed into the SECG point compressed | ||||
format by prepending it with the single byte 0x02 (i.e. M = 0x02 || | ||||
X). | ||||
Using compact representation have some security benefits. An | ||||
implementation does not need to check that the point is not the point | ||||
at infinity (the identity element). Similarly, as not even the sign | ||||
of the y-coordinate is encoded, compact representation trivially | ||||
avoids so called "benign malleability" attacks where an attacker | ||||
changes the sign, see [SECG]. | ||||
Appendix B. Use of CBOR, CDDL and COSE in EDHOC | ||||
This Appendix is intended to simplify for implementors not familiar | This Appendix is intended to simplify for implementors not familiar | |||
with CBOR [RFC8949], CDDL [RFC8610], COSE | with CBOR [RFC8949], CDDL [RFC8610], COSE | |||
[I-D.ietf-cose-rfc8152bis-struct], and HKDF [RFC5869]. | [I-D.ietf-cose-rfc8152bis-struct], and HKDF [RFC5869]. | |||
A.1. CBOR and CDDL | B.1. CBOR and CDDL | |||
The Concise Binary Object Representation (CBOR) [RFC8949] is a data | The Concise Binary Object Representation (CBOR) [RFC8949] is a data | |||
format designed for small code size and small message size. CBOR | format designed for small code size and small message size. CBOR | |||
builds on the JSON data model but extends it by e.g. encoding binary | builds on the JSON data model but extends it by e.g. encoding binary | |||
data directly without base64 conversion. In addition to the binary | data directly without base64 conversion. In addition to the binary | |||
CBOR encoding, CBOR also has a diagnostic notation that is readable | CBOR encoding, CBOR also has a diagnostic notation that is readable | |||
and editable by humans. The Concise Data Definition Language (CDDL) | and editable by humans. The Concise Data Definition Language (CDDL) | |||
[RFC8610] provides a way to express structures for protocol messages | [RFC8610] provides a way to express structures for protocol messages | |||
and APIs that use CBOR. [RFC8610] also extends the diagnostic | and APIs that use CBOR. [RFC8610] also extends the diagnostic | |||
notation. | notation. | |||
skipping to change at page 57, line 46 ¶ | skipping to change at page 59, line 46 ¶ | |||
h'12cd' 0x4212cd byte string | h'12cd' 0x4212cd byte string | |||
'12cd' 0x4431326364 byte string | '12cd' 0x4431326364 byte string | |||
"12cd" 0x6431326364 text string | "12cd" 0x6431326364 text string | |||
{ 4 : h'cd' } 0xa10441cd map | { 4 : h'cd' } 0xa10441cd map | |||
<< 1, 2, null >> 0x430102f6 byte string | << 1, 2, null >> 0x430102f6 byte string | |||
[ 1, 2, null ] 0x830102f6 array | [ 1, 2, null ] 0x830102f6 array | |||
( 1, 2, null ) 0x0102f6 sequence | ( 1, 2, null ) 0x0102f6 sequence | |||
1, 2, null 0x0102f6 sequence | 1, 2, null 0x0102f6 sequence | |||
------------------------------------------------------------------ | ------------------------------------------------------------------ | |||
A.2. CDDL Definitions | B.2. CDDL Definitions | |||
This sections compiles the CDDL definitions for ease of reference. | This sections compiles the CDDL definitions for ease of reference. | |||
bstr_identifier = bstr / int | bstr_identifier = bstr / int | |||
suite = int | suite = int | |||
SUITES_R : [ supported : 2* suite ] / suite | SUITES_R : [ supported : 2* suite ] / suite | |||
message_1 = ( | message_1 = ( | |||
? C_1 : null, | ? C_1 : null, | |||
METHOD_CORR : int, | METHOD_CORR : int, | |||
SUITES_I : [ selected : suite, supported : 2* suite ] / suite, | SUITES_I : [ selected : suite, supported : 2* suite ] / suite, | |||
G_X : bstr, | G_X : bstr, | |||
C_I : bstr_identifier, | C_I : bstr_identifier, | |||
? AD_1 : bstr, | ? EAD ; EAD_1 | |||
) | ) | |||
message_2 = ( | message_2 = ( | |||
data_2, | data_2, | |||
CIPHERTEXT_2 : bstr, | CIPHERTEXT_2 : bstr, | |||
) | ) | |||
data_2 = ( | data_2 = ( | |||
? C_I : bstr_identifier, | ? C_I : bstr_identifier, | |||
G_Y : bstr, | G_Y : bstr, | |||
skipping to change at page 58, line 42 ¶ | skipping to change at page 60, line 42 ¶ | |||
data_3, | data_3, | |||
CIPHERTEXT_3 : bstr, | CIPHERTEXT_3 : bstr, | |||
) | ) | |||
data_3 = ( | data_3 = ( | |||
? C_R : bstr_identifier, | ? C_R : bstr_identifier, | |||
) | ) | |||
message_4 = ( | message_4 = ( | |||
data_4, | data_4, | |||
MAC_4 : bstr, | CIPHERTEXT_4 : bstr, | |||
) | ) | |||
data_4 = ( | data_4 = ( | |||
? C_I : bstr_identifier, | ? C_I : bstr_identifier, | |||
) | ) | |||
error = ( | error = ( | |||
? C_x : bstr_identifier, | ? C_x : bstr_identifier, | |||
ERR_CODE : int, | ERR_CODE : int, | |||
ERR_INFO : any | ERR_INFO : any | |||
) | ) | |||
info = [ | info = [ | |||
edhoc_aead_id : int / tstr, | edhoc_aead_id : int / tstr, | |||
transcript_hash : bstr, | transcript_hash : bstr, | |||
label : tstr, | label : tstr, | |||
length : uint | length : uint | |||
] | ] | |||
A.3. COSE | B.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. | |||
COSE builds on JOSE, but is adapted to allow more efficient | COSE builds on JOSE, but is adapted to allow more efficient | |||
processing in constrained devices. EDHOC makes use of COSE_Key, | processing in constrained devices. EDHOC makes use of COSE_Key, | |||
COSE_Encrypt0, and COSE_Sign1 objects. | COSE_Encrypt0, and COSE_Sign1 objects. | |||
Appendix B. Test Vectors | Appendix C. Test Vectors | |||
This appendix provides detailed test vectors compatible with versions | Note: The test vectors are not updated to version -07 of the draft. | |||
-05 and -06 of this specification, to ease implementation and ensure | More changes affecting the test vectors are anticipated for -08. | |||
interoperability. In addition to hexadecimal, all CBOR data items | ||||
and sequences are given in CBOR diagnostic notation. The test | This appendix provides detailed test vectors to ease implementation | |||
vectors use the default mapping to CoAP where the Initiator acts as | and ensure interoperability. The test vectors in this version are | |||
CoAP client (this means that corr = 1). | compatible with versions -05 and -06 of the specification. In | |||
addition to hexadecimal, all CBOR data items and sequences are given | ||||
in CBOR diagnostic notation. The test vectors use the default | ||||
mapping to CoAP where the Initiator acts as CoAP client (this means | ||||
that corr = 1). | ||||
A more extensive test vector suite covering more combinations of | A more extensive test vector suite covering more combinations of | |||
authentication method used between Initiator and Responder and | authentication method used between Initiator and Responder and | |||
related code to generate them can be found at https://github.com/ | related code to generate them can be found at https://github.com/ | |||
lake-wg/edhoc/tree/master/test-vectors-05. | lake-wg/edhoc/tree/master/test-vectors-05. | |||
NOTE 1. In the previous and current test vectors the same name is | NOTE 1. In the previous and current test vectors the same name is | |||
used for certain byte strings and their CBOR bstr encodings. For | used for certain byte strings and their CBOR bstr encodings. For | |||
example the transcript hash TH_2 is used to denote both the output of | example the transcript hash TH_2 is used to denote both the output of | |||
the hash function and the input into the key derivation function, | the hash function and the input into the key derivation function, | |||
whereas the latter is a CBOR bstr encoding of the former. Some | whereas the latter is a CBOR bstr encoding of the former. Some | |||
attempts are made to clarify that in this Appendix (e.g. using "CBOR | attempts are made to clarify that in this Appendix (e.g. using "CBOR | |||
encoded"/"CBOR unencoded"). | encoded"/"CBOR unencoded"). | |||
NOTE 2. If not clear from the context, remember that CBOR sequences | NOTE 2. If not clear from the context, remember that CBOR sequences | |||
and CBOR arrays assume CBOR encoded data items as elements. | and CBOR arrays assume CBOR encoded data items as elements. | |||
B.1. Test Vectors for EDHOC Authenticated with Signature Keys (x5t) | C.1. Test Vectors for EDHOC Authenticated with Signature Keys (x5t) | |||
EDHOC with signature authentication and X.509 certificates is used. | EDHOC with signature authentication and X.509 certificates is used. | |||
In this test vector, the hash value 'x5t' is used to identify the | In this test vector, the hash value 'x5t' is used to identify the | |||
certificate. The optional C_1 in message_1 is omitted. No auxiliary | certificate. The optional C_1 in message_1 is omitted. No external | |||
data is sent in the message exchange. | authorization data is sent in the message exchange. | |||
method (Signature Authentication) | method (Signature Authentication) | |||
0 | 0 | |||
CoAP is used as transport and the Initiator acts as CoAP client: | CoAP is used as transport and the Initiator acts as CoAP client: | |||
corr (the Initiator can correlate message_1 and message_2) | corr (the Initiator can correlate message_1 and message_2) | |||
1 | 1 | |||
From there, METHOD_CORR has the following value: | From there, METHOD_CORR has the following value: | |||
skipping to change at page 60, line 39 ¶ | skipping to change at page 62, line 39 ¶ | |||
00 | 00 | |||
The Initiator selected the indicated cipher suite. | The Initiator selected the indicated cipher suite. | |||
Selected Cipher Suite (int) | Selected Cipher Suite (int) | |||
0 | 0 | |||
Cipher suite 0 is supported by both the Initiator and the Responder, | Cipher suite 0 is supported by both the Initiator and the Responder, | |||
see Section 3.4. | see Section 3.4. | |||
B.1.1. Message_1 | C.1.1. Message_1 | |||
The Initiator generates its ephemeral key pair. | The Initiator generates its ephemeral key pair. | |||
X (Initiator's ephemeral private key) (32 bytes) | X (Initiator's ephemeral private key) (32 bytes) | |||
8f 78 1a 09 53 72 f8 5b 6d 9f 61 09 ae 42 26 11 73 4d 7d bf a0 06 9a 2d | 8f 78 1a 09 53 72 f8 5b 6d 9f 61 09 ae 42 26 11 73 4d 7d bf a0 06 9a 2d | |||
f2 93 5b b2 e0 53 bf 35 | f2 93 5b b2 e0 53 bf 35 | |||
G_X (Initiator's ephemeral public key, CBOR unencoded) (32 bytes) | G_X (Initiator's ephemeral public key, CBOR unencoded) (32 bytes) | |||
89 8f f7 9a 02 06 7a 16 ea 1e cc b9 0f a5 22 46 f5 aa 4d d6 ec 07 6b ba | 89 8f f7 9a 02 06 7a 16 ea 1e cc b9 0f a5 22 46 f5 aa 4d d6 ec 07 6b ba | |||
02 59 d9 04 b7 ec 8b 0c | 02 59 d9 04 b7 ec 8b 0c | |||
skipping to change at page 61, line 16 ¶ | skipping to change at page 63, line 16 ¶ | |||
09 | 09 | |||
Note that since C_I is a byte string in the interval h'00' to h'2f', | Note that since C_I is a byte string in the interval h'00' to h'2f', | |||
it is encoded as the corresponding integer subtracted by 24 (see | it is encoded as the corresponding integer subtracted by 24 (see | |||
bstr_identifier in Section 5.1). Thus 0x09 = 09, 9 - 24 = -15, and | bstr_identifier in Section 5.1). Thus 0x09 = 09, 9 - 24 = -15, and | |||
-15 in CBOR encoding is equal to 0x2e. | -15 in CBOR encoding is equal to 0x2e. | |||
C_I (1 byte) | C_I (1 byte) | |||
2e | 2e | |||
Since no auxiliary data is sent: | Since no external authorization data is sent: | |||
AD_1 (0 bytes) | EAD_1 (0 bytes) | |||
The list of supported cipher suites needs to contain the selected | The list of supported cipher suites needs to contain the selected | |||
cipher suite. The initiator truncates the list of supported cipher | cipher suite. The initiator truncates the list of supported cipher | |||
suites to one cipher suite only. In this case there is only one | suites to one cipher suite only. In this case there is only one | |||
supported cipher suite indicated, 00. | supported cipher suite indicated, 00. | |||
Because one single selected cipher suite is conveyed, it is encoded | Because one single selected cipher suite is conveyed, it is encoded | |||
as an int instead of an array: | as an int instead of an array: | |||
SUITES_I (int) | SUITES_I (int) | |||
skipping to change at page 61, line 48 ¶ | skipping to change at page 63, line 48 ¶ | |||
h'898FF79A02067A16EA1ECCB90FA52246F5AA4DD6EC076BBA0259D904B7EC8B0C', | h'898FF79A02067A16EA1ECCB90FA52246F5AA4DD6EC076BBA0259D904B7EC8B0C', | |||
-15 | -15 | |||
) | ) | |||
Which as a CBOR encoded data item is: | Which as a CBOR encoded data item is: | |||
message_1 (CBOR Sequence) (37 bytes) | message_1 (CBOR Sequence) (37 bytes) | |||
01 00 58 20 89 8f f7 9a 02 06 7a 16 ea 1e cc b9 0f a5 22 46 f5 aa 4d d6 | 01 00 58 20 89 8f f7 9a 02 06 7a 16 ea 1e cc b9 0f a5 22 46 f5 aa 4d d6 | |||
ec 07 6b ba 02 59 d9 04 b7 ec 8b 0c 2e | ec 07 6b ba 02 59 d9 04 b7 ec 8b 0c 2e | |||
B.1.2. Message_2 | C.1.2. Message_2 | |||
Since METHOD_CORR mod 4 equals 1, C_I is omitted from data_2. | Since METHOD_CORR mod 4 equals 1, C_I is omitted from data_2. | |||
The Responder generates the following ephemeral key pair. | The Responder generates the following ephemeral key pair. | |||
Y (Responder's ephemeral private key) (32 bytes) | Y (Responder's ephemeral private key) (32 bytes) | |||
fd 8c d8 77 c9 ea 38 6e 6a f3 4f f7 e6 06 c4 b6 4c a8 31 c8 ba 33 13 4f | fd 8c d8 77 c9 ea 38 6e 6a f3 4f f7 e6 06 c4 b6 4c a8 31 c8 ba 33 13 4f | |||
d4 cd 71 67 ca ba ec da | d4 cd 71 67 ca ba ec da | |||
G_Y (Responder's ephemeral public key, CBOR unencoded) (32 bytes) | G_Y (Responder's ephemeral public key, CBOR unencoded) (32 bytes) | |||
skipping to change at page 63, line 33 ¶ | skipping to change at page 65, line 33 ¶ | |||
-24 | -24 | |||
) | ) | |||
Which as a CBOR encoded data item is: | Which as a CBOR encoded data item is: | |||
data_2 (CBOR Sequence) (35 bytes) | data_2 (CBOR Sequence) (35 bytes) | |||
58 20 71 a3 d5 99 c2 1d a1 89 02 a1 ae a8 10 b2 b6 38 2c cd 8d 5f 9b f0 | 58 20 71 a3 d5 99 c2 1d a1 89 02 a1 ae a8 10 b2 b6 38 2c cd 8d 5f 9b f0 | |||
19 52 81 75 4c 5e bc af 30 1e 37 | 19 52 81 75 4c 5e bc af 30 1e 37 | |||
From data_2 and message_1, compute the input to the transcript hash | From data_2 and message_1, compute the input to the transcript hash | |||
TH_2 = H( message_1, data_2 ), as a CBOR Sequence of these 2 data | TH_2 = H( H(message_1), data_2 ), as a CBOR Sequence of these 2 data | |||
items. | items. | |||
Input to calculate TH_2 (CBOR Sequence) (72 bytes) | Input to calculate TH_2 (CBOR Sequence) (72 bytes) | |||
01 00 58 20 89 8f f7 9a 02 06 7a 16 ea 1e cc b9 0f a5 22 46 f5 aa 4d d6 | 01 00 58 20 89 8f f7 9a 02 06 7a 16 ea 1e cc b9 0f a5 22 46 f5 aa 4d d6 | |||
ec 07 6b ba 02 59 d9 04 b7 ec 8b 0c 2e 58 20 71 a3 d5 99 c2 1d a1 89 02 | ec 07 6b ba 02 59 d9 04 b7 ec 8b 0c 2e 58 20 71 a3 d5 99 c2 1d a1 89 02 | |||
a1 ae a8 10 b2 b6 38 2c cd 8d 5f 9b f0 19 52 81 75 4c 5e bc af 30 1e 37 | a1 ae a8 10 b2 b6 38 2c cd 8d 5f 9b f0 19 52 81 75 4c 5e bc af 30 1e 37 | |||
And from there, compute the transcript hash TH_2 = SHA-256( | And from there, compute the transcript hash TH_2 = SHA-256( | |||
message_1, data_2 ) | H(message_1), data_2 ) | |||
TH_2 (CBOR unencoded) (32 bytes) | TH_2 (CBOR unencoded) (32 bytes) | |||
86 4e 32 b3 6a 7b 5f 21 f1 9e 99 f0 c6 6d 91 1e 0a ce 99 72 d3 76 d2 c2 | 86 4e 32 b3 6a 7b 5f 21 f1 9e 99 f0 c6 6d 91 1e 0a ce 99 72 d3 76 d2 c2 | |||
c1 53 c1 7f 8e 96 29 ff | c1 53 c1 7f 8e 96 29 ff | |||
The Responder's subject name is the empty string: | The Responder's subject name is the empty string: | |||
Responder's subject name (text string) | Responder's subject name (text string) | |||
"" | "" | |||
In this version of the test vectors CRED_R is not a DER encoded X.509 | In this version of the test vectors CRED_R is not a DER encoded X.509 | |||
skipping to change at page 64, line 42 ¶ | skipping to change at page 66, line 42 ¶ | |||
ID_CRED_R = | ID_CRED_R = | |||
{ | { | |||
34: [-15, h'6844078A53F312F5'] | 34: [-15, h'6844078A53F312F5'] | |||
} | } | |||
which when encoded as a CBOR map becomes: | which when encoded as a CBOR map becomes: | |||
ID_CRED_R (14 bytes) | ID_CRED_R (14 bytes) | |||
a1 18 22 82 2e 48 68 44 07 8a 53 f3 12 f5 | a1 18 22 82 2e 48 68 44 07 8a 53 f3 12 f5 | |||
Since no auxiliary data is sent: | Since no external authorization data is sent: | |||
AD_2 (0 bytes) | EAD_2 (0 bytes) | |||
The plaintext is defined as the empty string: | The plaintext is defined as the empty string: | |||
P_2m (0 bytes) | P_2m (0 bytes) | |||
The Enc_structure is defined as follows: [ "Encrypt0", | The Enc_structure is defined as follows: [ "Encrypt0", | |||
<< ID_CRED_R >>, << TH_2, CRED_R >> ], indicating that ID_CRED_R is | << ID_CRED_R >>, << TH_2, CRED_R >> ], indicating that ID_CRED_R is | |||
encoded as a CBOR byte string, and that the concatenation of the CBOR | encoded as a CBOR byte string, and that the concatenation of the CBOR | |||
byte strings TH_2 and CRED_R is wrapped as a CBOR bstr. The CBOR | byte strings TH_2 and CRED_R is wrapped as a CBOR bstr. The CBOR | |||
diagnostic notation is the following: | diagnostic notation is the following: | |||
skipping to change at page 66, line 46 ¶ | skipping to change at page 68, line 46 ¶ | |||
* external_aad = A_2m | * external_aad = A_2m | |||
* empty plaintext = P_2m | * empty plaintext = P_2m | |||
MAC_2 (CBOR unencoded) (8 bytes) | MAC_2 (CBOR unencoded) (8 bytes) | |||
fa bb a4 7e 56 71 a1 82 | fa bb a4 7e 56 71 a1 82 | |||
To compute the Signature_or_MAC_2, the key is the private | To compute the Signature_or_MAC_2, the key is the private | |||
authentication key of the Responder and the message M_2 to be signed | authentication key of the Responder and the message M_2 to be signed | |||
= [ "Signature1", << ID_CRED_R >>, << TH_2, CRED_R, ? AD_2 >>, MAC_2 | = [ "Signature1", << ID_CRED_R >>, << TH_2, CRED_R, ? EAD_2 >>, MAC_2 | |||
]. ID_CRED_R is encoded as a CBOR byte string, the concatenation of | ]. ID_CRED_R is encoded as a CBOR byte string, the concatenation of | |||
the CBOR byte strings TH_2 and CRED_R is wrapped as a CBOR bstr, and | the CBOR byte strings TH_2 and CRED_R is wrapped as a CBOR bstr, and | |||
MAC_2 is encoded as a CBOR bstr. | MAC_2 is encoded as a CBOR bstr. | |||
M_2 = | M_2 = | |||
[ | [ | |||
"Signature1", | "Signature1", | |||
h'A11822822E486844078A53F312F5', | h'A11822822E486844078A53F312F5', | |||
h'5820864E32B36A7B5F21F19E99F0C66D911E0ACE9972D376D2C2C153C17F8E9629F | h'5820864E32B36A7B5F21F19E99F0C66D911E0ACE9972D376D2C2C153C17F8E9629F | |||
F5864C788370016B8965BDB2074BFF82E5A20E09BEC21F8406E86442B87EC3FF245B7 | F5864C788370016B8965BDB2074BFF82E5A20E09BEC21F8406E86442B87EC3FF245B7 | |||
skipping to change at page 67, line 43 ¶ | skipping to change at page 69, line 43 ¶ | |||
1f 17 00 6a 98 48 c9 77 cb bd ca a7 57 b6 fd 46 82 c8 17 39 e1 5c 99 37 | 1f 17 00 6a 98 48 c9 77 cb bd ca a7 57 b6 fd 46 82 c8 17 39 e1 5c 99 37 | |||
c2 1c f5 e9 a0 e6 03 9f 54 fd 2a 6c 3a 11 18 f2 b9 d8 eb cd 48 23 48 b9 | c2 1c f5 e9 a0 e6 03 9f 54 fd 2a 6c 3a 11 18 f2 b9 d8 eb cd 48 23 48 b9 | |||
9c 3e d7 ed 1b d9 80 6c 93 c8 90 68 e8 36 b4 0f | 9c 3e d7 ed 1b d9 80 6c 93 c8 90 68 e8 36 b4 0f | |||
CIPHERTEXT_2 is the ciphertext resulting from XOR between plaintext | CIPHERTEXT_2 is the ciphertext resulting from XOR between plaintext | |||
and KEYSTREAM_2 which is derived from TH_2 and the pseudorandom key | and KEYSTREAM_2 which is derived from TH_2 and the pseudorandom key | |||
PRK_2e. | PRK_2e. | |||
* plaintext = CBOR Sequence of the items ID_CRED_R and | * plaintext = CBOR Sequence of the items ID_CRED_R and | |||
Signature_or_MAC_2 encoded as CBOR byte strings, in this order | Signature_or_MAC_2 encoded as CBOR byte strings, in this order | |||
(AD_2 is empty). | (EAD_2 is empty). | |||
The plaintext is the following: | The plaintext is the following: | |||
P_2e (CBOR Sequence) (80 bytes) | P_2e (CBOR Sequence) (80 bytes) | |||
a1 18 22 82 2e 48 68 44 07 8a 53 f3 12 f5 58 40 1f 17 00 6a 98 48 c9 77 | a1 18 22 82 2e 48 68 44 07 8a 53 f3 12 f5 58 40 1f 17 00 6a 98 48 c9 77 | |||
cb bd ca a7 57 b6 fd 46 82 c8 17 39 e1 5c 99 37 c2 1c f5 e9 a0 e6 03 9f | cb bd ca a7 57 b6 fd 46 82 c8 17 39 e1 5c 99 37 c2 1c f5 e9 a0 e6 03 9f | |||
54 fd 2a 6c 3a 11 18 f2 b9 d8 eb cd 48 23 48 b9 9c 3e d7 ed 1b d9 80 6c | 54 fd 2a 6c 3a 11 18 f2 b9 d8 eb cd 48 23 48 b9 9c 3e d7 ed 1b d9 80 6c | |||
93 c8 90 68 e8 36 b4 0f | 93 c8 90 68 e8 36 b4 0f | |||
KEYSTREAM_2 = HKDF-Expand( PRK_2e, info, length ), where length is | KEYSTREAM_2 = HKDF-Expand( PRK_2e, info, length ), where length is | |||
the length of the plaintext, so 80. | the length of the plaintext, so 80. | |||
skipping to change at page 69, line 12 ¶ | skipping to change at page 71, line 12 ¶ | |||
Which as a CBOR encoded data item is: | Which as a CBOR encoded data item is: | |||
message_2 (CBOR Sequence) (117 bytes) | message_2 (CBOR Sequence) (117 bytes) | |||
58 20 71 a3 d5 99 c2 1d a1 89 02 a1 ae a8 10 b2 b6 38 2c cd 8d 5f 9b f0 | 58 20 71 a3 d5 99 c2 1d a1 89 02 a1 ae a8 10 b2 b6 38 2c cd 8d 5f 9b f0 | |||
19 52 81 75 4c 5e bc af 30 1e 37 58 50 0f f2 ac 2d 7e 87 ae 34 0e 50 bb | 19 52 81 75 4c 5e bc af 30 1e 37 58 50 0f f2 ac 2d 7e 87 ae 34 0e 50 bb | |||
de 9f 70 e8 a7 7f 86 bf 65 9f 43 b0 24 a7 3e e9 7b 6a 2b 9c 55 92 fd 83 | de 9f 70 e8 a7 7f 86 bf 65 9f 43 b0 24 a7 3e e9 7b 6a 2b 9c 55 92 fd 83 | |||
5a 15 17 8b 7c 28 af 54 74 a9 75 81 48 64 7d 3d 98 a8 73 1e 16 4c 9c 70 | 5a 15 17 8b 7c 28 af 54 74 a9 75 81 48 64 7d 3d 98 a8 73 1e 16 4c 9c 70 | |||
52 81 07 f4 0f 21 46 3b a8 11 bf 03 97 19 e7 cf fa a7 f2 f4 40 | 52 81 07 f4 0f 21 46 3b a8 11 bf 03 97 19 e7 cf fa a7 f2 f4 40 | |||
B.1.3. Message_3 | C.1.3. Message_3 | |||
Since corr equals 1, C_R is not omitted from data_3. | Since corr equals 1, C_R is not omitted from data_3. | |||
The Initiator's sign/verify key pair is the following: | The Initiator's sign/verify key pair is the following: | |||
SK_I (Initiator's private authentication key) (32 bytes) | SK_I (Initiator's private authentication key) (32 bytes) | |||
2f fc e7 a0 b2 b8 25 d3 97 d0 cb 54 f7 46 e3 da 3f 27 59 6e e0 6b 53 71 | 2f fc e7 a0 b2 b8 25 d3 97 d0 cb 54 f7 46 e3 da 3f 27 59 6e e0 6b 53 71 | |||
48 1d c0 e0 12 bc 34 d7 | 48 1d c0 e0 12 bc 34 d7 | |||
PK_I (Responder's public authentication key) (32 bytes) | PK_I (Responder's public authentication key) (32 bytes) | |||
skipping to change at page 69, line 40 ¶ | skipping to change at page 71, line 40 ¶ | |||
PRK_4x3m (32 bytes) | PRK_4x3m (32 bytes) | |||
ec 62 92 a0 67 f1 37 fc 7f 59 62 9d 22 6f bf c4 e0 68 89 49 f6 62 a9 7f | ec 62 92 a0 67 f1 37 fc 7f 59 62 9d 22 6f bf c4 e0 68 89 49 f6 62 a9 7f | |||
d8 2f be b7 99 71 39 4a | d8 2f be b7 99 71 39 4a | |||
data 3 is equal to C_R. | data 3 is equal to C_R. | |||
data_3 (CBOR Sequence) (1 byte) | data_3 (CBOR Sequence) (1 byte) | |||
37 | 37 | |||
From data_3, CIPHERTEXT_2, and TH_2, compute the input to the | From data_3, CIPHERTEXT_2, and TH_2, compute the input to the | |||
transcript hash TH_3 = H(TH_2 , CIPHERTEXT_2, data_3), as a CBOR | transcript hash TH_3 = H( H(TH_2 , CIPHERTEXT_2), data_3), as a CBOR | |||
Sequence of these 3 data items. | Sequence of 2 data items. | |||
Input to calculate TH_3 (CBOR Sequence) (117 bytes) | Input to calculate TH_3 (CBOR Sequence) (117 bytes) | |||
58 20 86 4e 32 b3 6a 7b 5f 21 f1 9e 99 f0 c6 6d 91 1e 0a ce 99 72 d3 76 | 58 20 86 4e 32 b3 6a 7b 5f 21 f1 9e 99 f0 c6 6d 91 1e 0a ce 99 72 d3 76 | |||
d2 c2 c1 53 c1 7f 8e 96 29 ff 58 50 0f f2 ac 2d 7e 87 ae 34 0e 50 bb de | d2 c2 c1 53 c1 7f 8e 96 29 ff 58 50 0f f2 ac 2d 7e 87 ae 34 0e 50 bb de | |||
9f 70 e8 a7 7f 86 bf 65 9f 43 b0 24 a7 3e e9 7b 6a 2b 9c 55 92 fd 83 5a | 9f 70 e8 a7 7f 86 bf 65 9f 43 b0 24 a7 3e e9 7b 6a 2b 9c 55 92 fd 83 5a | |||
15 17 8b 7c 28 af 54 74 a9 75 81 48 64 7d 3d 98 a8 73 1e 16 4c 9c 70 52 | 15 17 8b 7c 28 af 54 74 a9 75 81 48 64 7d 3d 98 a8 73 1e 16 4c 9c 70 52 | |||
81 07 f4 0f 21 46 3b a8 11 bf 03 97 19 e7 cf fa a7 f2 f4 40 37 | 81 07 f4 0f 21 46 3b a8 11 bf 03 97 19 e7 cf fa a7 f2 f4 40 37 | |||
And from there, compute the transcript hash TH_3 = SHA-256(TH_2 , | And from there, compute the transcript hash TH_3 = SHA-256( H(TH_2 , | |||
CIPHERTEXT_2, data_3) | CIPHERTEXT_2), data_3) | |||
TH_3 (CBOR unencoded) (32 bytes) | TH_3 (CBOR unencoded) (32 bytes) | |||
f2 4d 18 ca fc e3 74 d4 e3 73 63 29 c1 52 ab 3a ea 9c 7c 0f 65 0c 30 70 | f2 4d 18 ca fc e3 74 d4 e3 73 63 29 c1 52 ab 3a ea 9c 7c 0f 65 0c 30 70 | |||
b6 f5 1e 68 e2 ae bb 60 | b6 f5 1e 68 e2 ae bb 60 | |||
The Initiator's subject name is the empty string: | The Initiator's subject name is the empty string: | |||
Initiator's subject name (text string) | Initiator's subject name (text string) | |||
"" | "" | |||
skipping to change at page 70, line 51 ¶ | skipping to change at page 72, line 51 ¶ | |||
ID_CRED_I = | ID_CRED_I = | |||
{ | { | |||
34: [-15, h'705D5845F36FC6A6'] | 34: [-15, h'705D5845F36FC6A6'] | |||
} | } | |||
which when encoded as a CBOR map becomes: | which when encoded as a CBOR map becomes: | |||
ID_CRED_I (14 bytes) | ID_CRED_I (14 bytes) | |||
a1 18 22 82 2e 48 70 5d 58 45 f3 6f c6 a6 | a1 18 22 82 2e 48 70 5d 58 45 f3 6f c6 a6 | |||
Since no auxiliary data is exchanged: | Since no external authorization data is exchanged: | |||
AD_3 (0 bytes) | EAD_3 (0 bytes) | |||
The plaintext of the COSE_Encrypt is the empty string: | The plaintext of the COSE_Encrypt is the empty string: | |||
P_3m (0 bytes) | P_3m (0 bytes) | |||
The associated data is the following: [ "Encrypt0", << ID_CRED_I >>, | The associated data is the following: [ "Encrypt0", << ID_CRED_I >>, | |||
<< TH_3, CRED_I, ? AD_3 >> ]. | << TH_3, CRED_I, ? EAD_3 >> ]. | |||
A_3m (CBOR-encoded) (164 bytes) | A_3m (CBOR-encoded) (164 bytes) | |||
83 68 45 6e 63 72 79 70 74 30 4e a1 18 22 82 2e 48 70 5d 58 45 f3 6f c6 | 83 68 45 6e 63 72 79 70 74 30 4e a1 18 22 82 2e 48 70 5d 58 45 f3 6f c6 | |||
a6 58 89 58 20 f2 4d 18 ca fc e3 74 d4 e3 73 63 29 c1 52 ab 3a ea 9c 7c | a6 58 89 58 20 f2 4d 18 ca fc e3 74 d4 e3 73 63 29 c1 52 ab 3a ea 9c 7c | |||
0f 65 0c 30 70 b6 f5 1e 68 e2 ae bb 60 58 65 54 13 20 4c 3e bc 34 28 a6 | 0f 65 0c 30 70 b6 f5 1e 68 e2 ae bb 60 58 65 54 13 20 4c 3e bc 34 28 a6 | |||
cf 57 e2 4c 9d ef 59 65 17 70 44 9b ce 7e c6 56 1e 52 43 3a a5 5e 71 f1 | cf 57 e2 4c 9d ef 59 65 17 70 44 9b ce 7e c6 56 1e 52 43 3a a5 5e 71 f1 | |||
fa 34 b2 2a 9c a4 a1 e1 29 24 ea e1 d1 76 60 88 09 84 49 cb 84 8f fc 79 | fa 34 b2 2a 9c a4 a1 e1 29 24 ea e1 d1 76 60 88 09 84 49 cb 84 8f fc 79 | |||
5f 88 af c4 9c be 8a fd d1 ba 00 9f 21 67 5e 8f 6c 77 a4 a2 c3 01 95 60 | 5f 88 af c4 9c be 8a fd d1 ba 00 9f 21 67 5e 8f 6c 77 a4 a2 c3 01 95 60 | |||
1f 6f 0a 08 52 97 8b d4 3d 28 20 7d 44 48 65 02 ff 7b dd a6 | 1f 6f 0a 08 52 97 8b d4 3d 28 20 7d 44 48 65 02 ff 7b dd a6 | |||
skipping to change at page 73, line 25 ¶ | skipping to change at page 75, line 25 ¶ | |||
From there, the 64 byte signature can be computed: | From there, the 64 byte signature can be computed: | |||
Signature_or_MAC_3 (CBOR unencoded) (64 bytes) | Signature_or_MAC_3 (CBOR unencoded) (64 bytes) | |||
ab 9f 7b bd eb c4 eb f8 a3 d3 04 17 9b cc a3 9d 9c 8a 76 73 65 76 fb 3c | ab 9f 7b bd eb c4 eb f8 a3 d3 04 17 9b cc a3 9d 9c 8a 76 73 65 76 fb 3c | |||
32 d2 fa c7 e2 59 34 e5 33 dc c7 02 2e 4d 68 61 c8 f5 fe cb e9 2d 17 4e | 32 d2 fa c7 e2 59 34 e5 33 dc c7 02 2e 4d 68 61 c8 f5 fe cb e9 2d 17 4e | |||
b2 be af 0a 59 a4 15 84 37 2f 43 2e 6b f4 7b 04 | b2 be af 0a 59 a4 15 84 37 2f 43 2e 6b f4 7b 04 | |||
Finally, the outer COSE_Encrypt0 is computed. | Finally, the outer COSE_Encrypt0 is computed. | |||
The plaintext is the CBOR Sequence of the items ID_CRED_I and the | The plaintext is the CBOR Sequence of the items ID_CRED_I and the | |||
CBOR encoded Signature_or_MAC_3, in this order (AD_3 is empty). | CBOR encoded Signature_or_MAC_3, in this order (EAD_3 is empty). | |||
P_3ae (CBOR Sequence) (80 bytes) | P_3ae (CBOR Sequence) (80 bytes) | |||
a1 18 22 82 2e 48 70 5d 58 45 f3 6f c6 a6 58 40 ab 9f 7b bd eb c4 eb f8 | a1 18 22 82 2e 48 70 5d 58 45 f3 6f c6 a6 58 40 ab 9f 7b bd eb c4 eb f8 | |||
a3 d3 04 17 9b cc a3 9d 9c 8a 76 73 65 76 fb 3c 32 d2 fa c7 e2 59 34 e5 | a3 d3 04 17 9b cc a3 9d 9c 8a 76 73 65 76 fb 3c 32 d2 fa c7 e2 59 34 e5 | |||
33 dc c7 02 2e 4d 68 61 c8 f5 fe cb e9 2d 17 4e b2 be af 0a 59 a4 15 84 | 33 dc c7 02 2e 4d 68 61 c8 f5 fe cb e9 2d 17 4e b2 be af 0a 59 a4 15 84 | |||
37 2f 43 2e 6b f4 7b 04 | 37 2f 43 2e 6b f4 7b 04 | |||
The Associated data A is the following: Associated data A = [ | The Associated data A is the following: Associated data A = [ | |||
"Encrypt0", h'', TH_3 ] | "Encrypt0", h'', TH_3 ] | |||
skipping to change at page 75, line 21 ¶ | skipping to change at page 77, line 21 ¶ | |||
) | ) | |||
Which encodes to the following byte string: | Which encodes to the following byte string: | |||
message_3 (CBOR Sequence) (91 bytes) | message_3 (CBOR Sequence) (91 bytes) | |||
37 58 58 f5 f6 de bd 82 14 05 1c d5 83 c8 40 96 c4 80 1d eb f3 5b 15 36 | 37 58 58 f5 f6 de bd 82 14 05 1c d5 83 c8 40 96 c4 80 1d eb f3 5b 15 36 | |||
3d d1 6e bd 85 30 df dc fb 34 fc d2 eb 6c ad 1d ac 66 a4 79 fb 38 de aa | 3d d1 6e bd 85 30 df dc fb 34 fc d2 eb 6c ad 1d ac 66 a4 79 fb 38 de aa | |||
f1 d3 0a 7e 68 17 a2 2a b0 4f 3d 5b 1e 97 2a 0d 13 ea 86 c6 6b 60 51 4c | f1 d3 0a 7e 68 17 a2 2a b0 4f 3d 5b 1e 97 2a 0d 13 ea 86 c6 6b 60 51 4c | |||
96 57 ea 89 c5 7b 04 01 ed c5 aa 8b bc ab 81 3c c5 d6 e7 | 96 57 ea 89 c5 7b 04 01 ed c5 aa 8b bc ab 81 3c c5 d6 e7 | |||
B.1.4. OSCORE Security Context Derivation | C.1.4. OSCORE Security Context Derivation | |||
From here, the Initiator and the Responder can derive an OSCORE | From here, the Initiator and the Responder can derive an OSCORE | |||
Security Context, using the EDHOC-Exporter interface. | Security Context, using the EDHOC-Exporter interface. | |||
From TH_3 and CIPHERTEXT_3, compute the input to the transcript hash | From TH_3 and CIPHERTEXT_3, compute the input to the transcript hash | |||
TH_4 = H( TH_3, CIPHERTEXT_3 ), as a CBOR Sequence of these 2 data | TH_4 = H( TH_3, CIPHERTEXT_3 ), as a CBOR Sequence of these 2 data | |||
items. | items. | |||
Input to calculate TH_4 (CBOR Sequence) (124 bytes) | Input to calculate TH_4 (CBOR Sequence) (124 bytes) | |||
58 20 f2 4d 18 ca fc e3 74 d4 e3 73 63 29 c1 52 ab 3a ea 9c 7c 0f 65 0c | 58 20 f2 4d 18 ca fc e3 74 d4 e3 73 63 29 c1 52 ab 3a ea 9c 7c 0f 65 0c | |||
skipping to change at page 77, line 20 ¶ | skipping to change at page 79, line 20 ¶ | |||
The AEAD Algorithm and the hash algorithm are the application AEAD | The AEAD Algorithm and the hash algorithm are the application AEAD | |||
and hash algorithms in the selected cipher suite. | and hash algorithms in the selected cipher suite. | |||
OSCORE AEAD Algorithm (int) | OSCORE AEAD Algorithm (int) | |||
10 | 10 | |||
OSCORE Hash Algorithm (int) | OSCORE Hash Algorithm (int) | |||
-16 | -16 | |||
B.2. Test Vectors for EDHOC Authenticated with Static Diffie-Hellman | C.2. Test Vectors for EDHOC Authenticated with Static Diffie-Hellman | |||
Keys | Keys | |||
EDHOC with static Diffie-Hellman keys and raw public keys is used. | EDHOC with static Diffie-Hellman keys and raw public keys is used. | |||
In this test vector, a key identifier is used to identify the raw | In this test vector, a key identifier is used to identify the raw | |||
public key. The optional C_1 in message_1 is omitted. No auxiliary | public key. The optional C_1 in message_1 is omitted. No external | |||
data is sent in the message exchange. | authorization data is sent in the message exchange. | |||
method (Static DH Based Authentication) | method (Static DH Based Authentication) | |||
3 | 3 | |||
CoAP is used as transport and the Initiator acts as CoAP client: | CoAP is used as transport and the Initiator acts as CoAP client: | |||
corr (the Initiator can correlate message_1 and message_2) | corr (the Initiator can correlate message_1 and message_2) | |||
1 | 1 | |||
From there, METHOD_CORR has the following value: | From there, METHOD_CORR has the following value: | |||
skipping to change at page 78, line 7 ¶ | skipping to change at page 80, line 7 ¶ | |||
Supported Cipher Suites (1 byte) | Supported Cipher Suites (1 byte) | |||
00 | 00 | |||
The Initiator selected the indicated cipher suite. | The Initiator selected the indicated cipher suite. | |||
Selected Cipher Suite (int) | Selected Cipher Suite (int) | |||
0 | 0 | |||
Cipher suite 0 is supported by both the Initiator and the Responder, | Cipher suite 0 is supported by both the Initiator and the Responder, | |||
see Section 3.4. | see Section 3.4. | |||
B.2.1. Message_1 | C.2.1. Message_1 | |||
The Initiator generates its ephemeral key pair. | The Initiator generates its ephemeral key pair. | |||
X (Initiator's ephemeral private key) (32 bytes) | X (Initiator's ephemeral private key) (32 bytes) | |||
ae 11 a0 db 86 3c 02 27 e5 39 92 fe b8 f5 92 4c 50 d0 a7 ba 6e ea b4 ad | ae 11 a0 db 86 3c 02 27 e5 39 92 fe b8 f5 92 4c 50 d0 a7 ba 6e ea b4 ad | |||
1f f2 45 72 f4 f5 7c fa | 1f f2 45 72 f4 f5 7c fa | |||
G_X (Initiator's ephemeral public key, CBOR unencoded) (32 bytes) | G_X (Initiator's ephemeral public key, CBOR unencoded) (32 bytes) | |||
8d 3e f5 6d 1b 75 0a 43 51 d6 8a c2 50 a0 e8 83 79 0e fc 80 a5 38 a4 44 | 8d 3e f5 6d 1b 75 0a 43 51 d6 8a c2 50 a0 e8 83 79 0e fc 80 a5 38 a4 44 | |||
ee 9e 2b 57 e2 44 1a 7c | ee 9e 2b 57 e2 44 1a 7c | |||
skipping to change at page 78, line 32 ¶ | skipping to change at page 80, line 32 ¶ | |||
16 | 16 | |||
Note that since C_I is a byte string in the interval h'00' to h'2f', | Note that since C_I is a byte string in the interval h'00' to h'2f', | |||
it is encoded as the corresponding integer - 24 (see bstr_identifier | it is encoded as the corresponding integer - 24 (see bstr_identifier | |||
in Section 5.1), i.e. 0x16 = 22, 22 - 24 = -2, and -2 in CBOR | in Section 5.1), i.e. 0x16 = 22, 22 - 24 = -2, and -2 in CBOR | |||
encoding is equal to 0x21. | encoding is equal to 0x21. | |||
C_I (1 byte) | C_I (1 byte) | |||
21 | 21 | |||
Since no auxiliary data is sent: | Since no external authorization data is sent: | |||
AD_1 (0 bytes) | EAD_1 (0 bytes) | |||
Since the list of supported cipher suites needs to contain the | Since the list of supported cipher suites needs to contain the | |||
selected cipher suite, the initiator truncates the list of supported | selected cipher suite, the initiator truncates the list of supported | |||
cipher suites to one cipher suite only, 00. | cipher suites to one cipher suite only, 00. | |||
Because one single selected cipher suite is conveyed, it is encoded | Because one single selected cipher suite is conveyed, it is encoded | |||
as an int instead of an array: | as an int instead of an array: | |||
SUITES_I (int) | SUITES_I (int) | |||
0 | 0 | |||
skipping to change at page 79, line 19 ¶ | skipping to change at page 81, line 19 ¶ | |||
h'8D3EF56D1B750A4351D68AC250A0E883790EFC80A538A444EE9E2B57E2441A7C', | h'8D3EF56D1B750A4351D68AC250A0E883790EFC80A538A444EE9E2B57E2441A7C', | |||
-2 | -2 | |||
) | ) | |||
Which as a CBOR encoded data item is: | Which as a CBOR encoded data item is: | |||
message_1 (CBOR Sequence) (37 bytes) | message_1 (CBOR Sequence) (37 bytes) | |||
0d 00 58 20 8d 3e f5 6d 1b 75 0a 43 51 d6 8a c2 50 a0 e8 83 79 0e fc 80 | 0d 00 58 20 8d 3e f5 6d 1b 75 0a 43 51 d6 8a c2 50 a0 e8 83 79 0e fc 80 | |||
a5 38 a4 44 ee 9e 2b 57 e2 44 1a 7c 21 | a5 38 a4 44 ee 9e 2b 57 e2 44 1a 7c 21 | |||
B.2.2. Message_2 | C.2.2. Message_2 | |||
Since METHOD_CORR mod 4 equals 1, C_I is omitted from data_2. | Since METHOD_CORR mod 4 equals 1, C_I is omitted from data_2. | |||
The Responder generates the following ephemeral key pair. | The Responder generates the following ephemeral key pair. | |||
Y (Responder's ephemeral private key) (32 bytes) | Y (Responder's ephemeral private key) (32 bytes) | |||
c6 46 cd dc 58 12 6e 18 10 5f 01 ce 35 05 6e 5e bc 35 f4 d4 cc 51 07 49 | c6 46 cd dc 58 12 6e 18 10 5f 01 ce 35 05 6e 5e bc 35 f4 d4 cc 51 07 49 | |||
a3 a5 e0 69 c1 16 16 9a | a3 a5 e0 69 c1 16 16 9a | |||
G_Y (Responder's ephemeral public key, CBOR unencoded) (32 bytes) | G_Y (Responder's ephemeral public key, CBOR unencoded) (32 bytes) | |||
skipping to change at page 80, line 24 ¶ | skipping to change at page 82, line 24 ¶ | |||
G_R (Responder's public authentication key) (32 bytes) | G_R (Responder's public authentication key) (32 bytes) | |||
a3 ff 26 35 95 be b3 77 d1 a0 ce 1d 04 da d2 d4 09 66 ac 6b cb 62 20 51 | a3 ff 26 35 95 be b3 77 d1 a0 ce 1d 04 da d2 d4 09 66 ac 6b cb 62 20 51 | |||
b8 46 59 18 4d 5d 9a 32 | b8 46 59 18 4d 5d 9a 32 | |||
Since the Responder authenticates with a static Diffie-Hellman key, | Since the Responder authenticates with a static Diffie-Hellman key, | |||
PRK_3e2m = HKDF-Extract( PRK_2e, G_RX ), where G_RX is the ECDH | PRK_3e2m = HKDF-Extract( PRK_2e, G_RX ), where G_RX is the ECDH | |||
shared secret calculated from G_R and X, or G_X and R. | shared secret calculated from G_R and X, or G_X and R. | |||
From the Responder's authentication key and the Initiator's ephemeral | From the Responder's authentication key and the Initiator's ephemeral | |||
key (see Appendix B.2.1), the ECDH shared secret G_RX is calculated. | key (see Appendix C.2.1), the ECDH shared secret G_RX is calculated. | |||
G_RX (ECDH shared secret) (32 bytes) | G_RX (ECDH shared secret) (32 bytes) | |||
21 c7 ef f4 fb 69 fa 4b 67 97 d0 58 84 31 5d 84 11 a3 fd a5 4f 6d ad a6 | 21 c7 ef f4 fb 69 fa 4b 67 97 d0 58 84 31 5d 84 11 a3 fd a5 4f 6d ad a6 | |||
1d 4f cd 85 e7 90 66 68 | 1d 4f cd 85 e7 90 66 68 | |||
PRK_3e2m (32 bytes) | PRK_3e2m (32 bytes) | |||
75 07 7c 69 1e 35 01 2d 48 bc 24 c8 4f 2b ab 89 f5 2f ac 03 fe dd 81 3e | 75 07 7c 69 1e 35 01 2d 48 bc 24 c8 4f 2b ab 89 f5 2f ac 03 fe dd 81 3e | |||
43 8c 93 b1 0b 39 93 07 | 43 8c 93 b1 0b 39 93 07 | |||
The Responder chooses a connection identifier C_R. | The Responder chooses a connection identifier C_R. | |||
skipping to change at page 81, line 18 ¶ | skipping to change at page 83, line 18 ¶ | |||
-24 | -24 | |||
) | ) | |||
Which as a CBOR encoded data item is: | Which as a CBOR encoded data item is: | |||
data_2 (CBOR Sequence) (35 bytes) | data_2 (CBOR Sequence) (35 bytes) | |||
58 20 52 fb a0 bd c8 d9 53 dd 86 ce 1a b2 fd 7c 05 a4 65 8c 7c 30 af db | 58 20 52 fb a0 bd c8 d9 53 dd 86 ce 1a b2 fd 7c 05 a4 65 8c 7c 30 af db | |||
fc 33 01 04 70 69 45 1b af 35 37 | fc 33 01 04 70 69 45 1b af 35 37 | |||
From data_2 and message_1, compute the input to the transcript hash | From data_2 and message_1, compute the input to the transcript hash | |||
TH_2 = H( message_1, data_2 ), as a CBOR Sequence of these 2 data | TH_2 = H( H(message_1), data_2 ), as a CBOR Sequence of these 2 data | |||
items. | items. | |||
Input to calculate TH_2 (CBOR Sequence) (72 bytes) | Input to calculate TH_2 (CBOR Sequence) (72 bytes) | |||
0d 00 58 20 8d 3e f5 6d 1b 75 0a 43 51 d6 8a c2 50 a0 e8 83 79 0e fc 80 | 0d 00 58 20 8d 3e f5 6d 1b 75 0a 43 51 d6 8a c2 50 a0 e8 83 79 0e fc 80 | |||
a5 38 a4 44 ee 9e 2b 57 e2 44 1a 7c 21 58 20 52 fb a0 bd c8 d9 53 dd 86 | a5 38 a4 44 ee 9e 2b 57 e2 44 1a 7c 21 58 20 52 fb a0 bd c8 d9 53 dd 86 | |||
ce 1a b2 fd 7c 05 a4 65 8c 7c 30 af db fc 33 01 04 70 69 45 1b af 35 37 | ce 1a b2 fd 7c 05 a4 65 8c 7c 30 af db fc 33 01 04 70 69 45 1b af 35 37 | |||
And from there, compute the transcript hash TH_2 = SHA-256( | And from there, compute the transcript hash TH_2 = SHA-256( | |||
message_1, data_2 ) | H(message_1), data_2 ) | |||
TH_2 (CBOR unencoded) (32 bytes) | TH_2 (CBOR unencoded) (32 bytes) | |||
de cf d6 4a 36 67 64 0a 02 33 b0 4a a8 aa 91 f6 89 56 b8 a5 36 d0 cf 8c | de cf d6 4a 36 67 64 0a 02 33 b0 4a a8 aa 91 f6 89 56 b8 a5 36 d0 cf 8c | |||
73 a6 e8 a7 c3 62 1e 26 | 73 a6 e8 a7 c3 62 1e 26 | |||
The Responder's subject name is the empty string: | The Responder's subject name is the empty string: | |||
Responder's subject name (text string) | Responder's subject name (text string) | |||
"" | "" | |||
skipping to change at page 82, line 19 ¶ | skipping to change at page 84, line 19 ¶ | |||
"subject name": "" | "subject name": "" | |||
} | } | |||
Which encodes to the following byte string: | Which encodes to the following byte string: | |||
CRED_R (54 bytes) | CRED_R (54 bytes) | |||
a4 01 01 20 04 21 58 20 a3 ff 26 35 95 be b3 77 d1 a0 ce 1d 04 da d2 d4 | a4 01 01 20 04 21 58 20 a3 ff 26 35 95 be b3 77 d1 a0 ce 1d 04 da d2 d4 | |||
09 66 ac 6b cb 62 20 51 b8 46 59 18 4d 5d 9a 32 6c 73 75 62 6a 65 63 74 | 09 66 ac 6b cb 62 20 51 b8 46 59 18 4d 5d 9a 32 6c 73 75 62 6a 65 63 74 | |||
20 6e 61 6d 65 60 | 20 6e 61 6d 65 60 | |||
Since no auxiliary data is sent: | Since no external authorization data is sent: | |||
AD_2 (0 bytes) | EAD_2 (0 bytes) | |||
The plaintext is defined as the empty string: | The plaintext is defined as the empty string: | |||
P_2m (0 bytes) | P_2m (0 bytes) | |||
The Enc_structure is defined as follows: [ "Encrypt0", | The Enc_structure is defined as follows: [ "Encrypt0", | |||
<< ID_CRED_R >>, << TH_2, CRED_R >> ], so ID_CRED_R is encoded as a | << ID_CRED_R >>, << TH_2, CRED_R >> ], so ID_CRED_R is encoded as a | |||
CBOR bstr, and the concatenation of the CBOR byte strings TH_2 and | CBOR bstr, and the concatenation of the CBOR byte strings TH_2 and | |||
CRED_R is wrapped in a CBOR bstr. | CRED_R is wrapped in a CBOR bstr. | |||
skipping to change at page 84, line 24 ¶ | skipping to change at page 86, line 24 ¶ | |||
Since method = 2, Signature_or_MAC_2 is MAC_2: | Since method = 2, Signature_or_MAC_2 is MAC_2: | |||
Signature_or_MAC_2 (CBOR unencoded) (8 bytes) | Signature_or_MAC_2 (CBOR unencoded) (8 bytes) | |||
42 e7 99 78 43 1e 6b 8f | 42 e7 99 78 43 1e 6b 8f | |||
CIPHERTEXT_2 is the ciphertext resulting from XOR between plaintext | CIPHERTEXT_2 is the ciphertext resulting from XOR between plaintext | |||
and KEYSTREAM_2 which is derived from TH_2 and the pseudorandom key | and KEYSTREAM_2 which is derived from TH_2 and the pseudorandom key | |||
PRK_2e. | PRK_2e. | |||
The plaintext is the CBOR Sequence of the items ID_CRED_R and the | The plaintext is the CBOR Sequence of the items ID_CRED_R and the | |||
CBOR encoded Signature_or_MAC_2, in this order (AD_2 is empty). | CBOR encoded Signature_or_MAC_2, in this order (EAD_2 is empty). | |||
Note that since ID_CRED_R contains a single 'kid' parameter, i.e., | Note that since ID_CRED_R contains a single 'kid' parameter, i.e., | |||
ID_CRED_R = { 4 : kid_R }, only the byte string kid_R is conveyed in | ID_CRED_R = { 4 : kid_R }, only the byte string kid_R is conveyed in | |||
the plaintext encoded as a bstr_identifier. kid_R is encoded as the | the plaintext encoded as a bstr_identifier. kid_R is encoded as the | |||
corresponding integer - 24 (see bstr_identifier in Section 5.1), i.e. | corresponding integer - 24 (see bstr_identifier in Section 5.1), i.e. | |||
0x05 = 5, 5 - 24 = -19, and -19 in CBOR encoding is equal to 0x32. | 0x05 = 5, 5 - 24 = -19, and -19 in CBOR encoding is equal to 0x32. | |||
The plaintext is the following: | The plaintext is the following: | |||
P_2e (CBOR Sequence) (10 bytes) | P_2e (CBOR Sequence) (10 bytes) | |||
skipping to change at page 85, line 36 ¶ | skipping to change at page 87, line 36 ¶ | |||
data_2, | data_2, | |||
h'A3F1BD5D028D19CF3C99' | h'A3F1BD5D028D19CF3C99' | |||
) | ) | |||
Which as a CBOR encoded data item is: | Which as a CBOR encoded data item is: | |||
message_2 (CBOR Sequence) (46 bytes) | message_2 (CBOR Sequence) (46 bytes) | |||
58 20 52 fb a0 bd c8 d9 53 dd 86 ce 1a b2 fd 7c 05 a4 65 8c 7c 30 af db | 58 20 52 fb a0 bd c8 d9 53 dd 86 ce 1a b2 fd 7c 05 a4 65 8c 7c 30 af db | |||
fc 33 01 04 70 69 45 1b af 35 37 4a a3 f1 bd 5d 02 8d 19 cf 3c 99 | fc 33 01 04 70 69 45 1b af 35 37 4a a3 f1 bd 5d 02 8d 19 cf 3c 99 | |||
B.2.3. Message_3 | C.2.3. Message_3 | |||
Since corr equals 1, C_R is not omitted from data_3. | Since corr equals 1, C_R is not omitted from data_3. | |||
The Initiator's static Diffie-Hellman key pair is the following: | The Initiator's static Diffie-Hellman key pair is the following: | |||
I (Initiator's private authentication key) (32 bytes) | I (Initiator's private authentication key) (32 bytes) | |||
2b be a6 55 c2 33 71 c3 29 cf bd 3b 1f 02 c6 c0 62 03 38 37 b8 b5 90 99 | 2b be a6 55 c2 33 71 c3 29 cf bd 3b 1f 02 c6 c0 62 03 38 37 b8 b5 90 99 | |||
a4 43 6f 66 60 81 b0 8e | a4 43 6f 66 60 81 b0 8e | |||
G_I (Initiator's public authentication key, CBOR unencoded) (32 bytes) | G_I (Initiator's public authentication key, CBOR unencoded) (32 bytes) | |||
2c 44 0c c1 21 f8 d7 f2 4c 3b 0e 41 ae da fe 9c aa 4f 4e 7a bb 83 5e c3 | 2c 44 0c c1 21 f8 d7 f2 4c 3b 0e 41 ae da fe 9c aa 4f 4e 7a bb 83 5e c3 | |||
0f 1d e8 8a db 96 ff 71 | 0f 1d e8 8a db 96 ff 71 | |||
HKDF SHA-256 is the HKDF used (as defined by cipher suite 0). | HKDF SHA-256 is the HKDF used (as defined by cipher suite 0). | |||
From the Initiator's authentication key and the Responder's ephemeral | From the Initiator's authentication key and the Responder's ephemeral | |||
key (see Appendix B.2.2), the ECDH shared secret G_IY is calculated. | key (see Appendix C.2.2), the ECDH shared secret G_IY is calculated. | |||
G_IY (ECDH shared secret) (32 bytes) | G_IY (ECDH shared secret) (32 bytes) | |||
cb ff 8c d3 4a 81 df ec 4c b6 5d 9a 57 2e bd 09 64 45 0c 78 56 3d a4 98 | cb ff 8c d3 4a 81 df ec 4c b6 5d 9a 57 2e bd 09 64 45 0c 78 56 3d a4 98 | |||
1d 80 d3 6c 8b 1a 75 2a | 1d 80 d3 6c 8b 1a 75 2a | |||
PRK_4x3m = HMAC-SHA-256 (PRK_3e2m, G_IY). | PRK_4x3m = HMAC-SHA-256 (PRK_3e2m, G_IY). | |||
PRK_4x3m (32 bytes) | PRK_4x3m (32 bytes) | |||
02 56 2f 1f 01 78 5c 0a a5 f5 94 64 0c 49 cb f6 9f 72 2e 9e 6c 57 83 7d | 02 56 2f 1f 01 78 5c 0a a5 f5 94 64 0c 49 cb f6 9f 72 2e 9e 6c 57 83 7d | |||
8e 15 79 ec 45 fe 64 7a | 8e 15 79 ec 45 fe 64 7a | |||
data 3 is equal to C_R. | data 3 is equal to C_R. | |||
data_3 (CBOR Sequence) (1 byte) | data_3 (CBOR Sequence) (1 byte) | |||
37 | 37 | |||
From data_3, CIPHERTEXT_2, and TH_2, compute the input to the | From data_3, CIPHERTEXT_2, and TH_2, compute the input to the | |||
transcript hash TH_3 = H(TH_2 , CIPHERTEXT_2, data_3), as a CBOR | transcript hash TH_3 = H( H(TH_2 , CIPHERTEXT_2), data_3), as a CBOR | |||
Sequence of these 3 data items. | Sequence of these 2 data items. | |||
Input to calculate TH_3 (CBOR Sequence) (46 bytes) | Input to calculate TH_3 (CBOR Sequence) (46 bytes) | |||
58 20 de cf d6 4a 36 67 64 0a 02 33 b0 4a a8 aa 91 f6 89 56 b8 a5 36 d0 | 58 20 de cf d6 4a 36 67 64 0a 02 33 b0 4a a8 aa 91 f6 89 56 b8 a5 36 d0 | |||
cf 8c 73 a6 e8 a7 c3 62 1e 26 4a a3 f1 bd 5d 02 8d 19 cf 3c 99 37 | cf 8c 73 a6 e8 a7 c3 62 1e 26 4a a3 f1 bd 5d 02 8d 19 cf 3c 99 37 | |||
And from there, compute the transcript hash TH_3 = SHA-256(TH_2 , | And from there, compute the transcript hash TH_3 = SHA-256( H(TH_2 , | |||
CIPHERTEXT_2, data_3) | CIPHERTEXT_2), data_3) | |||
TH_3 (CBOR unencoded) (32 bytes) | TH_3 (CBOR unencoded) (32 bytes) | |||
b6 cd 80 4f c4 b9 d7 ca c5 02 ab d7 7c da 74 e4 1c b0 11 82 d7 cb 8b 84 | b6 cd 80 4f c4 b9 d7 ca c5 02 ab d7 7c da 74 e4 1c b0 11 82 d7 cb 8b 84 | |||
db 03 ff a5 83 a3 5f cb | db 03 ff a5 83 a3 5f cb | |||
The initiator's subject name is the empty string: | The initiator's subject name is the empty string: | |||
Initiator's subject name (text string) | Initiator's subject name (text string) | |||
"" | "" | |||
skipping to change at page 87, line 20 ¶ | skipping to change at page 89, line 20 ¶ | |||
"subject name": "" | "subject name": "" | |||
} | } | |||
Which encodes to the following byte string: | Which encodes to the following byte string: | |||
CRED_I (54 bytes) | CRED_I (54 bytes) | |||
a4 01 01 20 04 21 58 20 2c 44 0c c1 21 f8 d7 f2 4c 3b 0e 41 ae da fe 9c | a4 01 01 20 04 21 58 20 2c 44 0c c1 21 f8 d7 f2 4c 3b 0e 41 ae da fe 9c | |||
aa 4f 4e 7a bb 83 5e c3 0f 1d e8 8a db 96 ff 71 6c 73 75 62 6a 65 63 74 | aa 4f 4e 7a bb 83 5e c3 0f 1d e8 8a db 96 ff 71 6c 73 75 62 6a 65 63 74 | |||
20 6e 61 6d 65 60 | 20 6e 61 6d 65 60 | |||
Since no auxiliary data is exchanged: | Since no external authorization data is exchanged: | |||
AD_3 (0 bytes) | EAD_3 (0 bytes) | |||
The plaintext of the COSE_Encrypt is the empty string: | The plaintext of the COSE_Encrypt is the empty string: | |||
P_3m (0 bytes) | P_3m (0 bytes) | |||
The associated data is the following: [ "Encrypt0", << ID_CRED_I >>, | The associated data is the following: [ "Encrypt0", << ID_CRED_I >>, | |||
<< TH_3, CRED_I, ? AD_3 >> ]. | << TH_3, CRED_I, ? EAD_3 >> ]. | |||
A_3m (CBOR-encoded) (105 bytes) | A_3m (CBOR-encoded) (105 bytes) | |||
83 68 45 6e 63 72 79 70 74 30 44 a1 04 41 23 58 58 58 20 b6 cd 80 4f c4 | 83 68 45 6e 63 72 79 70 74 30 44 a1 04 41 23 58 58 58 20 b6 cd 80 4f c4 | |||
b9 d7 ca c5 02 ab d7 7c da 74 e4 1c b0 11 82 d7 cb 8b 84 db 03 ff a5 83 | b9 d7 ca c5 02 ab d7 7c da 74 e4 1c b0 11 82 d7 cb 8b 84 db 03 ff a5 83 | |||
a3 5f cb a4 01 01 20 04 21 58 20 2c 44 0c c1 21 f8 d7 f2 4c 3b 0e 41 ae | a3 5f cb a4 01 01 20 04 21 58 20 2c 44 0c c1 21 f8 d7 f2 4c 3b 0e 41 ae | |||
da fe 9c aa 4f 4e 7a bb 83 5e c3 0f 1d e8 8a db 96 ff 71 6c 73 75 62 6a | da fe 9c aa 4f 4e 7a bb 83 5e c3 0f 1d e8 8a db 96 ff 71 6c 73 75 62 6a | |||
65 63 74 20 6e 61 6d 65 60 | 65 63 74 20 6e 61 6d 65 60 | |||
Info for K_3m is computed as follows: | Info for K_3m is computed as follows: | |||
skipping to change at page 89, line 6 ¶ | skipping to change at page 91, line 6 ¶ | |||
ee 59 8e a6 61 17 dc c3 | ee 59 8e a6 61 17 dc c3 | |||
Since method = 3, Signature_or_MAC_3 is MAC_3: | Since method = 3, Signature_or_MAC_3 is MAC_3: | |||
Signature_or_MAC_3 (CBOR unencoded) (8 bytes) | Signature_or_MAC_3 (CBOR unencoded) (8 bytes) | |||
ee 59 8e a6 61 17 dc c3 | ee 59 8e a6 61 17 dc c3 | |||
Finally, the outer COSE_Encrypt0 is computed. | Finally, the outer COSE_Encrypt0 is computed. | |||
The plaintext is the CBOR Sequence of the items ID_CRED_I and the | The plaintext is the CBOR Sequence of the items ID_CRED_I and the | |||
CBOR encoded Signature_or_MAC_3, in this order (AD_3 is empty). | CBOR encoded Signature_or_MAC_3, in this order (EAD_3 is empty). | |||
Note that since ID_CRED_I contains a single 'kid' parameter, i.e., | Note that since ID_CRED_I contains a single 'kid' parameter, i.e., | |||
ID_CRED_I = { 4 : kid_I }, only the byte string kid_I is conveyed in | ID_CRED_I = { 4 : kid_I }, only the byte string kid_I is conveyed in | |||
the plaintext encoded as a bstr_identifier. kid_I is encoded as the | the plaintext encoded as a bstr_identifier. kid_I is encoded as the | |||
corresponding integer - 24 (see bstr_identifier in Section 5.1), i.e. | corresponding integer - 24 (see bstr_identifier in Section 5.1), i.e. | |||
0x23 = 35, 35 - 24 = 11, and 11 in CBOR encoding is equal to 0x0b. | 0x23 = 35, 35 - 24 = 11, and 11 in CBOR encoding is equal to 0x0b. | |||
P_3ae (CBOR Sequence) (10 bytes) | P_3ae (CBOR Sequence) (10 bytes) | |||
0b 48 ee 59 8e a6 61 17 dc c3 | 0b 48 ee 59 8e a6 61 17 dc c3 | |||
skipping to change at page 90, line 46 ¶ | skipping to change at page 92, line 46 ¶ | |||
( | ( | |||
-24, | -24, | |||
h'D5535F3147E85F1CFACD9E78ABF9E0A81BBF' | h'D5535F3147E85F1CFACD9E78ABF9E0A81BBF' | |||
) | ) | |||
Which encodes to the following byte string: | Which encodes to the following byte string: | |||
message_3 (CBOR Sequence) (20 bytes) | message_3 (CBOR Sequence) (20 bytes) | |||
37 52 d5 53 5f 31 47 e8 5f 1c fa cd 9e 78 ab f9 e0 a8 1b bf | 37 52 d5 53 5f 31 47 e8 5f 1c fa cd 9e 78 ab f9 e0 a8 1b bf | |||
B.2.4. OSCORE Security Context Derivation | C.2.4. OSCORE Security Context Derivation | |||
From here, the Initiator and the Responder can derive an OSCORE | From here, the Initiator and the Responder can derive an OSCORE | |||
Security Context, using the EDHOC-Exporter interface. | Security Context, using the EDHOC-Exporter interface. | |||
From TH_3 and CIPHERTEXT_3, compute the input to the transcript hash | From TH_3 and CIPHERTEXT_3, compute the input to the transcript hash | |||
TH_4 = H( TH_3, CIPHERTEXT_3 ), as a CBOR Sequence of these 2 data | TH_4 = H( TH_3, CIPHERTEXT_3 ), as a CBOR Sequence of these 2 data | |||
items. | items. | |||
Input to calculate TH_4 (CBOR Sequence) (53 bytes) | Input to calculate TH_4 (CBOR Sequence) (53 bytes) | |||
58 20 b6 cd 80 4f c4 b9 d7 ca c5 02 ab d7 7c da 74 e4 1c b0 11 82 d7 cb | 58 20 b6 cd 80 4f c4 b9 d7 ca c5 02 ab d7 7c da 74 e4 1c b0 11 82 d7 cb | |||
skipping to change at page 92, line 46 ¶ | skipping to change at page 94, line 46 ¶ | |||
The AEAD Algorithm and the hash algorithm are the application AEAD | The AEAD Algorithm and the hash algorithm are the application AEAD | |||
and hash algorithms in the selected cipher suite. | and hash algorithms in the selected cipher suite. | |||
OSCORE AEAD Algorithm (int) | OSCORE AEAD Algorithm (int) | |||
10 | 10 | |||
OSCORE Hash Algorithm (int) | OSCORE Hash Algorithm (int) | |||
-16 | -16 | |||
Appendix C. Applicability Template | Appendix D. Applicability Template | |||
This appendix contains an example of an applicability statement, see | This appendix contains an example of an applicability statement, see | |||
Section 3.7. | Section 3.7. | |||
For use of EDHOC in the XX protocol, the following assumptions are | For use of EDHOC in the XX protocol, the following assumptions are | |||
made on the parameters: | made on the parameters: | |||
* METHOD_CORR = 5 | * METHOD_CORR = 5 | |||
- method = 1 (I uses signature key, R uses static DH key.) | - method = 1 (I uses signature key, R uses static DH key.) | |||
- corr = 1 (CoAP Token or other transport data enables | - corr = 1 (CoAP Token or other transport data enables | |||
correlation between message_1 and message_2.) | correlation between message_1 and message_2.) | |||
* EDHOC requests are expected by the server at /app1-edh, no | * EDHOC requests are expected by the server at /app1-edh, no | |||
Content-Format needed. | Content-Format needed. | |||
* C_1 = "null" is present to identify message_1 | * C_1 = "null" is present to identify message_1 | |||
* CRED_I is an 802.1AR IDevID encoded as a C509 Certificate of type | * CRED_I is an 802.1AR IDevID encoded as a C509 Certificate of type | |||
0 [I-D.mattsson-cose-cbor-cert-compress]. | 0 [I-D.ietf-cose-cbor-encoded-cert]. | |||
- R acquires CRED_I out-of-band, indicated in AD_1 | - R acquires CRED_I out-of-band, indicated in EAD_1 | |||
- ID_CRED_I = {4: h''} is a kid with value empty byte string | - ID_CRED_I = {4: h''} is a kid with value empty byte string | |||
* CRED_R is a COSE_Key of type OKP as specified in Section 3.3.4. | * CRED_R is a COSE_Key of type OKP as specified in Section 3.3.4. | |||
- 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 = CRED_R | * ID_CRED_R = CRED_R | |||
* AD_1 contains Auxiliary Data of type A (TBD) | ||||
* AD_2 contains Auxiliary Data of type B (TBD) | ||||
* No use of message_4: the application sends protected messages from | * No use of message_4: the application sends protected messages from | |||
R to I. | R to I. | |||
* Auxiliary Data is processed as specified in | * External authorization data is defined and processed as specified | |||
[I-D.selander-ace-ake-authz]. | in [I-D.selander-ace-ake-authz]. | |||
Appendix D. EDHOC Message Deduplication | Appendix E. 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. | |||
skipping to change at page 94, line 18 ¶ | skipping to change at page 96, line 18 ¶ | |||
support transport layers which does not handle message duplication. | support transport layers which does 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.2. | Section 5.2. | |||
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 a response consisting of another instance of the next EDHOC | |||
message. The result MAY be that a duplicate EDHOC response is sent, | message. The result MAY be that a duplicate EDHOC response is sent, | |||
provided it is still relevant with respect the current protocol | provided it is still relevant with respect the current protocol | |||
state. In any case, the received message MUST NOT be processed more | state. In any case, the received message MUST NOT be processed more | |||
than once by the same EDHOC instance. This is called "EDHOC message | than once in the same 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. An EDHOC implementation MAY keep the | |||
protocol state to be able to recreate the previously sent EDHOC | protocol state to be able to recreate the previously sent EDHOC | |||
message and resend it. The previous message or protocol state MUST | message and resend it. The previous message or protocol state MUST | |||
NOT be kept longer than what is required for retransmission, for | NOT be kept longer than what is required for retransmission, for | |||
example, in the case of CoAP transport, no longer than the | example, in the case of CoAP transport, no longer than the | |||
EXCHANGE_LIFETIME (see Section 4.8.2 of [RFC7252]). | EXCHANGE_LIFETIME (see Section 4.8.2 of [RFC7252]). | |||
Note that the requirements in Section 5.2 still apply because | Note that the requirements in Section 5.2 still apply because | |||
duplicate messages are not processed by the EDHOC state machine: | duplicate messages are not processed by the EDHOC state machine: | |||
* EDHOC messages SHALL be processed according to the current | * EDHOC messages SHALL be processed according to the current | |||
protocol state. | protocol state. | |||
* Different instances of the same message MUST NOT be processed in | * Different instances of the same message MUST NOT be processed in | |||
one protocol instance. | one session. | |||
Appendix E. Change Log | Appendix F. Change Log | |||
Main changes: | Main changes: | |||
* From -06 to -07: | ||||
- Changed transcript hash definition for TH_2 and TH_3 | ||||
- Removed "EDHOC signature algorithm curve" from cipher suite | ||||
- New IANA registry "EDHOC Exporter Label" | ||||
- New application defined parameter "context" in EDHOC-Exporter | ||||
- Changed normative language for failure from MUST to SHOULD send | ||||
error | ||||
- Made error codes non-negative and 0 for success | ||||
- Added detail on success error code | ||||
- Aligned terminology "protocol instance" -> "session" | ||||
- New appendix on compact EC point representation | ||||
- Added detail on use of ephemeral public keys | ||||
- Moved key derivation for OSCORE to draft-ietf-core-oscore-edhoc | ||||
- Additional security considerations | ||||
- Renamed "Auxililary Data" as "External Authorization Data" | ||||
- Added encrypted EAD_4 to message_4 | ||||
* From -05 to -06: | * From -05 to -06: | |||
- New section 5.2 "Message Processing Outline" | - New section 5.2 "Message Processing Outline" | |||
- Optional inital byte C_1 = null in message_1 | - Optional inital byte C_1 = null in message_1 | |||
- New format of error messages, table of error codes, IANA | - New format of error messages, table of error codes, IANA | |||
registry | registry | |||
- Change of recommendation transport of error in CoAP | - Change of recommendation transport of error in CoAP | |||
skipping to change at page 95, line 15 ¶ | skipping to change at page 97, line 47 ¶ | |||
"Applicability Statement" | "Applicability Statement" | |||
- Requiring use of deterministic CBOR | - Requiring use of deterministic CBOR | |||
- New section on message deduplication | - New section on message deduplication | |||
- New appendix containin all CDDL definitions | - New appendix containin all CDDL definitions | |||
- New appendix with change log | - New appendix with change log | |||
- Removed section "Other Documents Referncing EDHOC" | - Removed section "Other Documents Referencing EDHOC" | |||
- Clarifications based on review comments | - Clarifications based on review comments | |||
* From -04 to -05: | * From -04 to -05: | |||
- EDHOC-Rekey-FS -> EDHOC-KeyUpdate | - EDHOC-Rekey-FS -> EDHOC-KeyUpdate | |||
- Clarification of cipher suite negotiation | - Clarification of cipher suite negotiation | |||
- Updated security considerations | - Updated security considerations | |||
End of changes. 223 change blocks. | ||||
490 lines changed or deleted | 627 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/ |