draft-ietf-cose-rfc8152bis-struct-02.txt | draft-ietf-cose-rfc8152bis-struct-03.txt | |||
---|---|---|---|---|
COSE Working Group J. Schaad | COSE Working Group J. Schaad | |||
Internet-Draft August Cellars | Internet-Draft August Cellars | |||
Obsoletes: 8152 (if approved) March 11, 2019 | Obsoletes: 8152 (if approved) June 10, 2019 | |||
Intended status: Standards Track | Intended status: Standards Track | |||
Expires: September 12, 2019 | Expires: December 12, 2019 | |||
CBOR CBOR Object Signing and Encryption (COSE): Structures and Process | CBOR Object Signing and Encryption (COSE): Structures and Process | |||
draft-ietf-cose-rfc8152bis-struct-02 | draft-ietf-cose-rfc8152bis-struct-03 | |||
Abstract | Abstract | |||
Concise Binary Object Representation (CBOR) is a data format designed | Concise Binary Object Representation (CBOR) is a data format designed | |||
for small code size and small message size. There is a need for the | for small code size and small message size. There is a need for the | |||
ability to have basic security services defined for this data format. | ability to have basic security services defined for this data format. | |||
This document defines the CBOR Object Signing and Encryption (COSE) | This document defines the CBOR Object Signing and Encryption (COSE) | |||
protocol. This specification describes how to create and process | protocol. This specification describes how to create and process | |||
signatures, message authentication codes, and encryption using CBOR | signatures, message authentication codes, and encryption using CBOR | |||
for serialization. This specification additionally describes how to | for serialization. This specification additionally describes how to | |||
skipping to change at page 1, line 49 ¶ | skipping to change at page 1, line 49 ¶ | |||
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 September 12, 2019. | This Internet-Draft will expire on December 12, 2019. | |||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2019 IETF Trust and the persons identified as the | Copyright (c) 2019 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 | Provisions Relating to IETF Documents | |||
(https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
publication of this document. Please review these documents | publication of this document. Please review these documents | |||
skipping to change at page 2, line 37 ¶ | skipping to change at page 2, line 37 ¶ | |||
1.5. CBOR-Related Terminology . . . . . . . . . . . . . . . . 7 | 1.5. CBOR-Related Terminology . . . . . . . . . . . . . . . . 7 | |||
1.6. Document Terminology . . . . . . . . . . . . . . . . . . 8 | 1.6. Document Terminology . . . . . . . . . . . . . . . . . . 8 | |||
2. Basic COSE Structure . . . . . . . . . . . . . . . . . . . . 8 | 2. Basic COSE Structure . . . . . . . . . . . . . . . . . . . . 8 | |||
3. Header Parameters . . . . . . . . . . . . . . . . . . . . . . 11 | 3. Header Parameters . . . . . . . . . . . . . . . . . . . . . . 11 | |||
3.1. Common COSE Headers Parameters . . . . . . . . . . . . . 13 | 3.1. Common COSE Headers Parameters . . . . . . . . . . . . . 13 | |||
4. Signing Objects . . . . . . . . . . . . . . . . . . . . . . . 17 | 4. Signing Objects . . . . . . . . . . . . . . . . . . . . . . . 17 | |||
4.1. Signing with One or More Signers . . . . . . . . . . . . 17 | 4.1. Signing with One or More Signers . . . . . . . . . . . . 17 | |||
4.2. Signing with One Signer . . . . . . . . . . . . . . . . . 19 | 4.2. Signing with One Signer . . . . . . . . . . . . . . . . . 19 | |||
4.3. Externally Supplied Data . . . . . . . . . . . . . . . . 20 | 4.3. Externally Supplied Data . . . . . . . . . . . . . . . . 20 | |||
4.4. Signing and Verification Process . . . . . . . . . . . . 21 | 4.4. Signing and Verification Process . . . . . . . . . . . . 21 | |||
4.5. Computing Counter Signatures . . . . . . . . . . . . . . 22 | 5. Counter Signatures . . . . . . . . . . . . . . . . . . . . . 22 | |||
5. Encryption Objects . . . . . . . . . . . . . . . . . . . . . 23 | 5.1. Full Countersignatures . . . . . . . . . . . . . . . . . 23 | |||
5.1. Enveloped COSE Structure . . . . . . . . . . . . . . . . 23 | 5.2. Abbreviated Countersignatures . . . . . . . . . . . . . . 24 | |||
5.1.1. Content Key Distribution Methods . . . . . . . . . . 25 | 6. Encryption Objects . . . . . . . . . . . . . . . . . . . . . 24 | |||
5.2. Single Recipient Encrypted . . . . . . . . . . . . . . . 25 | 6.1. Enveloped COSE Structure . . . . . . . . . . . . . . . . 25 | |||
5.3. How to Encrypt and Decrypt for AEAD Algorithms . . . . . 26 | 6.1.1. Content Key Distribution Methods . . . . . . . . . . 26 | |||
5.4. How to Encrypt and Decrypt for AE Algorithms . . . . . . 28 | 6.2. Single Recipient Encrypted . . . . . . . . . . . . . . . 27 | |||
6. MAC Objects . . . . . . . . . . . . . . . . . . . . . . . . . 30 | 6.3. How to Encrypt and Decrypt for AEAD Algorithms . . . . . 28 | |||
6.1. MACed Message with Recipients . . . . . . . . . . . . . . 30 | 6.4. How to Encrypt and Decrypt for AE Algorithms . . . . . . 30 | |||
6.2. MACed Messages with Implicit Key . . . . . . . . . . . . 31 | 7. MAC Objects . . . . . . . . . . . . . . . . . . . . . . . . . 31 | |||
6.3. How to Compute and Verify a MAC . . . . . . . . . . . . . 32 | 7.1. MACed Message with Recipients . . . . . . . . . . . . . . 32 | |||
7. Key Objects . . . . . . . . . . . . . . . . . . . . . . . . . 33 | 7.2. MACed Messages with Implicit Key . . . . . . . . . . . . 33 | |||
7.1. COSE Key Common Parameters . . . . . . . . . . . . . . . 34 | 7.3. How to Compute and Verify a MAC . . . . . . . . . . . . . 34 | |||
8. Signature Algorithms . . . . . . . . . . . . . . . . . . . . 37 | 8. Key Objects . . . . . . . . . . . . . . . . . . . . . . . . . 35 | |||
9. Message Authentication Code (MAC) Algorithms . . . . . . . . 38 | 8.1. COSE Key Common Parameters . . . . . . . . . . . . . . . 36 | |||
10. Content Encryption Algorithms . . . . . . . . . . . . . . . . 39 | 9. Signature Algorithms . . . . . . . . . . . . . . . . . . . . 38 | |||
11. Key Derivation Functions (KDFs) . . . . . . . . . . . . . . . 39 | 10. Message Authentication Code (MAC) Algorithms . . . . . . . . 39 | |||
12. Content Key Distribution Methods . . . . . . . . . . . . . . 40 | 11. Content Encryption Algorithms . . . . . . . . . . . . . . . . 40 | |||
12.1. Direct Encryption . . . . . . . . . . . . . . . . . . . 40 | 12. Key Derivation Functions (KDFs) . . . . . . . . . . . . . . . 40 | |||
12.2. Key Wrap . . . . . . . . . . . . . . . . . . . . . . . . 41 | 13. Content Key Distribution Methods . . . . . . . . . . . . . . 41 | |||
12.3. Key Transport . . . . . . . . . . . . . . . . . . . . . 41 | 13.1. Direct Encryption . . . . . . . . . . . . . . . . . . . 41 | |||
12.4. Direct Key Agreement . . . . . . . . . . . . . . . . . . 42 | 13.2. Key Wrap . . . . . . . . . . . . . . . . . . . . . . . . 42 | |||
12.5. Key Agreement with Key Wrap . . . . . . . . . . . . . . 43 | 13.3. Key Transport . . . . . . . . . . . . . . . . . . . . . 42 | |||
13. CBOR Encoder Restrictions . . . . . . . . . . . . . . . . . . 43 | 13.4. Direct Key Agreement . . . . . . . . . . . . . . . . . . 43 | |||
14. Application Profiling Considerations . . . . . . . . . . . . 44 | 13.5. Key Agreement with Key Wrap . . . . . . . . . . . . . . 44 | |||
15. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 45 | 14. CBOR Encoding Restrictions . . . . . . . . . . . . . . . . . 44 | |||
15.1. CBOR Tag Assignment . . . . . . . . . . . . . . . . . . 45 | 15. Application Profiling Considerations . . . . . . . . . . . . 44 | |||
15.2. COSE Header Parameters Registry . . . . . . . . . . . . 45 | 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 46 | |||
15.3. COSE Header Algorithm Parameters Registry . . . . . . . 45 | 16.1. CBOR Tag Assignment . . . . . . . . . . . . . . . . . . 46 | |||
15.4. COSE Key Common Parameters Registry . . . . . . . . . . 46 | 16.2. COSE Header Parameters Registry . . . . . . . . . . . . 46 | |||
15.5. Media Type Registrations . . . . . . . . . . . . . . . . 46 | 16.3. COSE Header Algorithm Parameters Registry . . . . . . . 47 | |||
15.5.1. COSE Security Message . . . . . . . . . . . . . . . 46 | 16.4. COSE Key Common Parameters Registry . . . . . . . . . . 47 | |||
15.5.2. COSE Key Media Type . . . . . . . . . . . . . . . . 47 | 16.5. Media Type Registrations . . . . . . . . . . . . . . . . 47 | |||
15.6. CoAP Content-Formats Registry . . . . . . . . . . . . . 49 | 16.5.1. COSE Security Message . . . . . . . . . . . . . . . 47 | |||
15.7. Expert Review Instructions . . . . . . . . . . . . . . . 49 | 16.5.2. COSE Key Media Type . . . . . . . . . . . . . . . . 48 | |||
16. Security Considerations . . . . . . . . . . . . . . . . . . . 50 | 16.6. CoAP Content-Formats Registry . . . . . . . . . . . . . 50 | |||
17. Implementation Status . . . . . . . . . . . . . . . . . . . . 52 | 17. Security Considerations . . . . . . . . . . . . . . . . . . . 50 | |||
17.1. Author's Versions . . . . . . . . . . . . . . . . . . . 52 | 18. Implementation Status . . . . . . . . . . . . . . . . . . . . 52 | |||
17.2. Java Script Version . . . . . . . . . . . . . . . . . . 53 | 18.1. Author's Versions . . . . . . . . . . . . . . . . . . . 53 | |||
17.3. Python Version . . . . . . . . . . . . . . . . . . . . . 54 | 18.2. Java Script Version . . . . . . . . . . . . . . . . . . 53 | |||
17.4. COSE Testing Library . . . . . . . . . . . . . . . . . . 54 | 18.3. Python Version . . . . . . . . . . . . . . . . . . . . . 54 | |||
18. References . . . . . . . . . . . . . . . . . . . . . . . . . 54 | 18.4. COSE Testing Library . . . . . . . . . . . . . . . . . . 54 | |||
18.1. Normative References . . . . . . . . . . . . . . . . . . 54 | 19. References . . . . . . . . . . . . . . . . . . . . . . . . . 55 | |||
18.2. Informative References . . . . . . . . . . . . . . . . . 56 | 19.1. Normative References . . . . . . . . . . . . . . . . . . 55 | |||
19.2. Informative References . . . . . . . . . . . . . . . . . 56 | ||||
Appendix A. Guidelines for External Data Authentication of | Appendix A. Guidelines for External Data Authentication of | |||
Algorithms . . . . . . . . . . . . . . . . . . . . . 58 | Algorithms . . . . . . . . . . . . . . . . . . . . . 58 | |||
A.1. Algorithm Identification . . . . . . . . . . . . . . . . 58 | Appendix B. Two Layers of Recipient Information . . . . . . . . 61 | |||
A.2. Counter Signature without Headers . . . . . . . . . . . . 61 | Appendix C. Examples . . . . . . . . . . . . . . . . . . . . . . 63 | |||
Appendix B. Two Layers of Recipient Information . . . . . . . . 62 | C.1. Examples of Signed Messages . . . . . . . . . . . . . . . 64 | |||
Appendix C. Examples . . . . . . . . . . . . . . . . . . . . . . 64 | C.1.1. Single Signature . . . . . . . . . . . . . . . . . . 64 | |||
C.1. Examples of Signed Messages . . . . . . . . . . . . . . . 65 | C.1.2. Multiple Signers . . . . . . . . . . . . . . . . . . 65 | |||
C.1.1. Single Signature . . . . . . . . . . . . . . . . . . 65 | C.1.3. Counter Signature . . . . . . . . . . . . . . . . . . 66 | |||
C.1.2. Multiple Signers . . . . . . . . . . . . . . . . . . 66 | C.1.4. Signature with Criticality . . . . . . . . . . . . . 67 | |||
C.1.3. Counter Signature . . . . . . . . . . . . . . . . . . 67 | C.2. Single Signer Examples . . . . . . . . . . . . . . . . . 68 | |||
C.1.4. Signature with Criticality . . . . . . . . . . . . . 68 | C.2.1. Single ECDSA Signature . . . . . . . . . . . . . . . 68 | |||
C.2. Single Signer Examples . . . . . . . . . . . . . . . . . 69 | C.3. Examples of Enveloped Messages . . . . . . . . . . . . . 69 | |||
C.2.1. Single ECDSA Signature . . . . . . . . . . . . . . . 69 | C.3.1. Direct ECDH . . . . . . . . . . . . . . . . . . . . . 69 | |||
C.3. Examples of Enveloped Messages . . . . . . . . . . . . . 70 | C.3.2. Direct Plus Key Derivation . . . . . . . . . . . . . 70 | |||
C.3.1. Direct ECDH . . . . . . . . . . . . . . . . . . . . . 70 | C.3.3. Counter Signature on Encrypted Content . . . . . . . 71 | |||
C.3.2. Direct Plus Key Derivation . . . . . . . . . . . . . 71 | C.3.4. Encrypted Content with External Data . . . . . . . . 73 | |||
C.3.3. Counter Signature on Encrypted Content . . . . . . . 72 | C.4. Examples of Encrypted Messages . . . . . . . . . . . . . 73 | |||
C.3.4. Encrypted Content with External Data . . . . . . . . 74 | C.4.1. Simple Encrypted Message . . . . . . . . . . . . . . 73 | |||
C.4. Examples of Encrypted Messages . . . . . . . . . . . . . 74 | C.4.2. Encrypted Message with a Partial IV . . . . . . . . . 74 | |||
C.4.1. Simple Encrypted Message . . . . . . . . . . . . . . 74 | ||||
C.4.2. Encrypted Message with a Partial IV . . . . . . . . . 75 | C.5. Examples of MACed Messages . . . . . . . . . . . . . . . 74 | |||
C.5. Examples of MACed Messages . . . . . . . . . . . . . . . 75 | C.5.1. Shared Secret Direct MAC . . . . . . . . . . . . . . 74 | |||
C.5.1. Shared Secret Direct MAC . . . . . . . . . . . . . . 75 | C.5.2. ECDH Direct MAC . . . . . . . . . . . . . . . . . . . 75 | |||
C.5.2. ECDH Direct MAC . . . . . . . . . . . . . . . . . . . 76 | C.5.3. Wrapped MAC . . . . . . . . . . . . . . . . . . . . . 76 | |||
C.5.3. Wrapped MAC . . . . . . . . . . . . . . . . . . . . . 77 | C.5.4. Multi-Recipient MACed Message . . . . . . . . . . . . 77 | |||
C.5.4. Multi-Recipient MACed Message . . . . . . . . . . . . 78 | C.6. Examples of MAC0 Messages . . . . . . . . . . . . . . . . 78 | |||
C.6. Examples of MAC0 Messages . . . . . . . . . . . . . . . . 79 | C.6.1. Shared Secret Direct MAC . . . . . . . . . . . . . . 78 | |||
C.6.1. Shared Secret Direct MAC . . . . . . . . . . . . . . 79 | C.7. COSE Keys . . . . . . . . . . . . . . . . . . . . . . . . 79 | |||
C.7. COSE Keys . . . . . . . . . . . . . . . . . . . . . . . . 80 | C.7.1. Public Keys . . . . . . . . . . . . . . . . . . . . . 79 | |||
C.7.1. Public Keys . . . . . . . . . . . . . . . . . . . . . 80 | C.7.2. Private Keys . . . . . . . . . . . . . . . . . . . . 80 | |||
C.7.2. Private Keys . . . . . . . . . . . . . . . . . . . . 81 | Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 82 | |||
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 83 | Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 83 | |||
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 84 | ||||
1. Introduction | 1. Introduction | |||
There has been an increased focus on small, constrained devices that | There has been an increased focus on small, constrained devices that | |||
make up the Internet of Things (IoT). One of the standards that has | make up the Internet of Things (IoT). One of the standards that has | |||
come out of this process is "Concise Binary Object Representation | come out of this process is "Concise Binary Object Representation | |||
(CBOR)" [RFC7049]. CBOR extended the data model of the JavaScript | (CBOR)" [RFC7049]. CBOR extended the data model of the JavaScript | |||
Object Notation (JSON) [RFC8259] by allowing for binary data, among | Object Notation (JSON) [RFC8259] by allowing for binary data, among | |||
other changes. CBOR has been adopted by several of the IETF working | other changes. CBOR has been adopted by several of the IETF working | |||
groups dealing with the IoT world as their encoding of data | groups dealing with the IoT world as their encoding of data | |||
skipping to change at page 6, line 22 ¶ | skipping to change at page 6, line 19 ¶ | |||
directions and trimmed in others. | directions and trimmed in others. | |||
1.2. Changes from RFC8152 | 1.2. Changes from RFC8152 | |||
o Split the orignal document into this document and | o Split the orignal document into this document and | |||
[I-D.ietf-cose-rfc8152bis-algs]. | [I-D.ietf-cose-rfc8152bis-algs]. | |||
o Add some text describing why there is no digest structure defined | o Add some text describing why there is no digest structure defined | |||
by COSE. | by COSE. | |||
o Rearrange the text around counter signatures and define a CBOR Tag | ||||
for a standalong countersignature. | ||||
1.3. Requirements Terminology | 1.3. Requirements Terminology | |||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
"OPTIONAL" in this document are to be interpreted as described in BCP | "OPTIONAL" in this document are to be interpreted as described in BCP | |||
14 [RFC2119] [RFC8174] when, and only when, they appear in all | 14 [RFC2119] [RFC8174] when, and only when, they appear in all | |||
capitals, as shown here. | capitals, as shown here. | |||
1.4. CBOR Grammar | 1.4. CBOR Grammar | |||
skipping to change at page 7, line 39 ¶ | skipping to change at page 7, line 39 ¶ | |||
//artwork[@type='CDDL']/text() | //artwork[@type='CDDL']/text() | |||
CDDL expects the initial non-terminal symbol to be the first symbol | CDDL expects the initial non-terminal symbol to be the first symbol | |||
in the file. For this reason, the first fragment of CDDL is | in the file. For this reason, the first fragment of CDDL is | |||
presented here. | presented here. | |||
start = COSE_Messages / COSE_Key / COSE_KeySet / Internal_Types | start = COSE_Messages / COSE_Key / COSE_KeySet / Internal_Types | |||
; This is defined to make the tool quieter: | ; This is defined to make the tool quieter: | |||
Internal_Types = Sig_structure / Enc_structure / MAC_structure / | Internal_Types = Sig_structure / Enc_structure / MAC_structure | |||
COSE_KDF_Context | ||||
The non-terminal Internal_Types is defined for dealing with the | The non-terminal Internal_Types is defined for dealing with the | |||
automated validation tools used during the writing of this document. | automated validation tools used during the writing of this document. | |||
It references those non-terminals that are used for security | It references those non-terminals that are used for security | |||
computations but are not emitted for transport. | computations but are not emitted for transport. | |||
1.5. CBOR-Related Terminology | 1.5. CBOR-Related Terminology | |||
In JSON, maps are called objects and only have one kind of map key: a | In JSON, maps are called objects and only have one kind of map key: a | |||
string. In COSE, we use strings, negative integers, and unsigned | string. In COSE, we use strings, negative integers, and unsigned | |||
skipping to change at page 9, line 12 ¶ | skipping to change at page 9, line 11 ¶ | |||
3. The content of the message. The content is either the plaintext | 3. The content of the message. The content is either the plaintext | |||
or the ciphertext as appropriate. The content may be detached | or the ciphertext as appropriate. The content may be detached | |||
(i.e. transported separately from the COSE structure), but the | (i.e. transported separately from the COSE structure), but the | |||
location is still used. The content is wrapped in a bstr when | location is still used. The content is wrapped in a bstr when | |||
present and is a nil value when detached. | present and is a nil value when detached. | |||
Elements after this point are dependent on the specific message type. | Elements after this point are dependent on the specific message type. | |||
COSE messages are built using the concept of layers to separate | COSE messages are built using the concept of layers to separate | |||
different types of cryptographic concepts. As an example of how this | different types of cryptographic concepts. As an example of how this | |||
works, consider the COSE_Encrypt message (Section 5.1). This message | works, consider the COSE_Encrypt message (Section 6.1). This message | |||
type is broken into two layers: the content layer and the recipient | type is broken into two layers: the content layer and the recipient | |||
layer. In the content layer, the plaintext is encrypted and | layer. In the content layer, the plaintext is encrypted and | |||
information about the encrypted message is placed. In the recipient | information about the encrypted message is placed. In the recipient | |||
layer, the content encryption key (CEK) is encrypted and information | layer, the content encryption key (CEK) is encrypted and information | |||
about how it is encrypted for each recipient is placed. A single | about how it is encrypted for each recipient is placed. A single | |||
layer version of the encryption message COSE_Encrypt0 (Section 5.2) | layer version of the encryption message COSE_Encrypt0 (Section 6.2) | |||
is provided for cases where the CEK is pre-shared. | is provided for cases where the CEK is pre-shared. | |||
Identification of which type of message has been presented is done by | Identification of which type of message has been presented is done by | |||
the following methods: | the following methods: | |||
1. The specific message type is known from the context. This may be | 1. The specific message type is known from the context. This may be | |||
defined by a marker in the containing structure or by | defined by a marker in the containing structure or by | |||
restrictions specified by the application protocol. | restrictions specified by the application protocol. | |||
2. The message type is identified by a CBOR tag. Messages with a | 2. The message type is identified by a CBOR tag. Messages with a | |||
skipping to change at page 10, line 5 ¶ | skipping to change at page 10, line 5 ¶ | |||
the untagged version of the structure is used. The value to use | the untagged version of the structure is used. The value to use | |||
with the parameter for each of the structures can be found in | with the parameter for each of the structures can be found in | |||
Table 1. | Table 1. | |||
4. When a COSE object is carried as a CoAP payload, the CoAP | 4. When a COSE object is carried as a CoAP payload, the CoAP | |||
Content-Format Option can be used to identify the message | Content-Format Option can be used to identify the message | |||
content. The CoAP Content-Format values can be found in Table 2. | content. The CoAP Content-Format values can be found in Table 2. | |||
The CBOR tag for the message structure is not required as each | The CBOR tag for the message structure is not required as each | |||
security message is uniquely identified. | security message is uniquely identified. | |||
+-------+---------------+---------------+---------------------------+ | +-------+------------------+----------------+-----------------------+ | |||
| CBOR | cose-type | Data Item | Semantics | | | CBOR | cose-type | Data Item | Semantics | | |||
| Tag | | | | | | Tag | | | | | |||
+-------+---------------+---------------+---------------------------+ | +-------+------------------+----------------+-----------------------+ | |||
| 98 | cose-sign | COSE_Sign | COSE Signed Data Object | | | 98 | cose-sign | COSE_Sign | COSE Signed Data | | |||
| 18 | cose-sign1 | COSE_Sign1 | COSE Single Signer Data | | | | | | Object | | |||
| | | | Object | | | 18 | cose-sign1 | COSE_Sign1 | COSE Single Signer | | |||
| 96 | cose-encrypt | COSE_Encrypt | COSE Encrypted Data | | | | | | Data Object | | |||
| | | | Object | | | 96 | cose-encrypt | COSE_Encrypt | COSE Encrypted Data | | |||
| 16 | cose-encrypt0 | COSE_Encrypt0 | COSE Single Recipient | | | | | | Object | | |||
| | | | Encrypted Data Object | | | 16 | cose-encrypt0 | COSE_Encrypt0 | COSE Single Recipient | | |||
| 97 | cose-mac | COSE_Mac | COSE MACed Data Object | | | | | | Encrypted Data Object | | |||
| 17 | cose-mac0 | COSE_Mac0 | COSE Mac w/o Recipients | | | 97 | cose-mac | COSE_Mac | COSE MACed Data | | |||
| | | | Object | | | | | | Object | | |||
+-------+---------------+---------------+---------------------------+ | | 17 | cose-mac0 | COSE_Mac0 | COSE Mac w/o | | |||
| | | | Recipients Object | | ||||
| TBD0 | cose-countersign | COSE_Signature | COSE standalone | | ||||
| | | | counter signature | | ||||
+-------+------------------+----------------+-----------------------+ | ||||
Table 1: COSE Message Identification | Table 1: COSE Message Identification | |||
+--------------------------------------+----------+-----+-----------+ | +--------------------------------------+----------+-----+-----------+ | |||
| Media Type | Encoding | ID | Reference | | | Media Type | Encoding | ID | Reference | | |||
+--------------------------------------+----------+-----+-----------+ | +--------------------------------------+----------+-----+-----------+ | |||
| application/cose; cose-type="cose- | | 98 | [RFC8152] | | | application/cose; cose-type="cose- | | 98 | [RFC8152] | | |||
| sign" | | | | | | sign" | | | | | |||
| application/cose; cose-type="cose- | | 18 | [RFC8152] | | | application/cose; cose-type="cose- | | 18 | [RFC8152] | | |||
| sign1" | | | | | | sign1" | | | | | |||
skipping to change at page 11, line 9 ¶ | skipping to change at page 11, line 9 ¶ | |||
Table 2: CoAP Content-Formats for COSE | Table 2: CoAP Content-Formats for COSE | |||
The following CDDL fragment identifies all of the top messages | The following CDDL fragment identifies all of the top messages | |||
defined in this document. Separate non-terminals are defined for the | defined in this document. Separate non-terminals are defined for the | |||
tagged and the untagged versions of the messages. | tagged and the untagged versions of the messages. | |||
COSE_Messages = COSE_Untagged_Message / COSE_Tagged_Message | COSE_Messages = COSE_Untagged_Message / COSE_Tagged_Message | |||
COSE_Untagged_Message = COSE_Sign / COSE_Sign1 / | COSE_Untagged_Message = COSE_Sign / COSE_Sign1 / | |||
COSE_Encrypt / COSE_Encrypt0 / | COSE_Encrypt / COSE_Encrypt0 / | |||
COSE_Mac / COSE_Mac0 | COSE_Mac / COSE_Mac0 / COSE_Countersignature | |||
COSE_Tagged_Message = COSE_Sign_Tagged / COSE_Sign1_Tagged / | COSE_Tagged_Message = COSE_Sign_Tagged / COSE_Sign1_Tagged / | |||
COSE_Encrypt_Tagged / COSE_Encrypt0_Tagged / | COSE_Encrypt_Tagged / COSE_Encrypt0_Tagged / | |||
COSE_Mac_Tagged / COSE_Mac0_Tagged | COSE_Mac_Tagged / COSE_Mac0_Tagged / COSE_Countersignature_Tagged | |||
3. Header Parameters | 3. Header Parameters | |||
The structure of COSE has been designed to have two buckets of | The structure of COSE has been designed to have two buckets of | |||
information that are not considered to be part of the payload itself, | information that are not considered to be part of the payload itself, | |||
but are used for holding information about content, algorithms, keys, | but are used for holding information about content, algorithms, keys, | |||
or evaluation hints for the processing of the layer. These two | or evaluation hints for the processing of the layer. These two | |||
buckets are available for use in all of the structures except for | buckets are available for use in all of the structures except for | |||
keys. While these buckets are present, they may not all be usable in | keys. While these buckets are present, they may not all be usable in | |||
all instances. For example, while the protected bucket is defined as | all instances. For example, while the protected bucket is defined as | |||
skipping to change at page 11, line 35 ¶ | skipping to change at page 11, line 35 ¶ | |||
recipient structures do not provide for authenticated data. If this | recipient structures do not provide for authenticated data. If this | |||
is the case, the protected bucket is left empty. | is the case, the protected bucket is left empty. | |||
Both buckets are implemented as CBOR maps. The map key is a 'label' | Both buckets are implemented as CBOR maps. The map key is a 'label' | |||
(Section 1.5). The value portion is dependent on the definition for | (Section 1.5). The value portion is dependent on the definition for | |||
the label. Both maps use the same set of label/value pairs. The | the label. Both maps use the same set of label/value pairs. The | |||
integer and string values for labels have been divided into several | integer and string values for labels have been divided into several | |||
sections including a standard range, a private range, and a range | sections including a standard range, a private range, and a range | |||
that is dependent on the algorithm selected. The defined labels can | that is dependent on the algorithm selected. The defined labels can | |||
be found in the "COSE Header Parameters" IANA registry | be found in the "COSE Header Parameters" IANA registry | |||
(Section 15.2). | (Section 16.2). | |||
Two buckets are provided for each layer: | Two buckets are provided for each layer: | |||
protected: Contains parameters about the current layer that are | protected: Contains parameters about the current layer that are | |||
cryptographically protected. This bucket MUST be empty if it is | cryptographically protected. This bucket MUST be empty if it is | |||
not going to be included in a cryptographic computation. This | not going to be included in a cryptographic computation. This | |||
bucket is encoded in the message as a binary object. This value | bucket is encoded in the message as a binary object. This value | |||
is obtained by CBOR encoding the protected map and wrapping it in | is obtained by CBOR encoding the protected map and wrapping it in | |||
a bstr object. Senders SHOULD encode a zero-length map as a zero- | a bstr object. Senders SHOULD encode a zero-length map as a zero- | |||
length byte string rather than as a zero-length map (encoded as | length byte string rather than as a zero-length map (encoded as | |||
skipping to change at page 12, line 27 ¶ | skipping to change at page 12, line 27 ¶ | |||
not placed in the recipient or signature layers. In principle, one | not placed in the recipient or signature layers. In principle, one | |||
should be able to process any given layer without reference to any | should be able to process any given layer without reference to any | |||
other layer. With the exception of the COSE_Sign structure, the only | other layer. With the exception of the COSE_Sign structure, the only | |||
data that needs to cross layers is the cryptographic key. | data that needs to cross layers is the cryptographic key. | |||
The buckets are present in all of the security objects defined in | The buckets are present in all of the security objects defined in | |||
this document. The fields in order are the 'protected' bucket (as a | this document. The fields in order are the 'protected' bucket (as a | |||
CBOR 'bstr' type) and then the 'unprotected' bucket (as a CBOR 'map' | CBOR 'bstr' type) and then the 'unprotected' bucket (as a CBOR 'map' | |||
type). The presence of both buckets is required. The parameters | type). The presence of both buckets is required. The parameters | |||
that go into the buckets come from the IANA "COSE Header Parameters" | that go into the buckets come from the IANA "COSE Header Parameters" | |||
registry (Section 15.2). Some common parameters are defined in the | registry (Section 16.2). Some common parameters are defined in the | |||
next section, but a number of parameters are defined throughout this | next section. | |||
document. | ||||
Labels in each of the maps MUST be unique. When processing messages, | Labels in each of the maps MUST be unique. When processing messages, | |||
if a label appears multiple times, the message MUST be rejected as | if a label appears multiple times, the message MUST be rejected as | |||
malformed. Applications SHOULD verify that the same label does not | malformed. Applications SHOULD verify that the same label does not | |||
occur in both the protected and unprotected headers. If the message | occur in both the protected and unprotected headers. If the message | |||
is not rejected as malformed, attributes MUST be obtained from the | is not rejected as malformed, attributes MUST be obtained from the | |||
protected bucket before they are obtained from the unprotected | protected bucket before they are obtained from the unprotected | |||
bucket. | bucket. | |||
The following CDDL fragment represents the two header buckets. A | The following CDDL fragment represents the two header buckets. A | |||
skipping to change at page 13, line 44 ¶ | skipping to change at page 13, line 44 ¶ | |||
crit: The parameter is used to indicate which protected header | crit: The parameter is used to indicate which protected header | |||
labels an application that is processing a message is required to | labels an application that is processing a message is required to | |||
understand. Parameters defined in this document do not need to be | understand. Parameters defined in this document do not need to be | |||
included as they should be understood by all implementations. | included as they should be understood by all implementations. | |||
When present, this parameter MUST be placed in the protected | When present, this parameter MUST be placed in the protected | |||
header bucket. The array MUST have at least one value in it. | header bucket. The array MUST have at least one value in it. | |||
Not all labels need to be included in the 'crit' parameter. The | Not all labels need to be included in the 'crit' parameter. The | |||
rules for deciding which header labels are placed in the array | rules for deciding which header labels are placed in the array | |||
are: | are: | |||
* Integer labels in the range of 0 to 8 SHOULD be omitted. | * Integer labels in the range of 0 to 7 SHOULD be omitted. | |||
* Integer labels in the range -1 to -128 can be omitted as they | * Integer labels in the range -1 to -128 can be omitted as they | |||
are algorithm dependent. If an application can correctly | are algorithm dependent. If an application can correctly | |||
process an algorithm, it can be assumed that it will correctly | process an algorithm, it can be assumed that it will correctly | |||
process all of the common parameters associated with that | process all of the common parameters associated with that | |||
algorithm. Integer labels in the range -129 to -65536 SHOULD | algorithm. Integer labels in the range -129 to -65536 SHOULD | |||
be included as these would be less common parameters that might | be included as these would be less common parameters that might | |||
not be generally supported. | not be generally supported. | |||
* Labels for parameters required for an application MAY be | * Labels for parameters required for an application MAY be | |||
skipping to change at page 15, line 24 ¶ | skipping to change at page 15, line 24 ¶ | |||
2. XOR the padded Partial IV with the context IV. | 2. XOR the padded Partial IV with the context IV. | |||
counter signature: This parameter holds one or more counter | counter signature: This parameter holds one or more counter | |||
signature values. Counter signatures provide a method of having a | signature values. Counter signatures provide a method of having a | |||
second party sign some data. The counter signature parameter can | second party sign some data. The counter signature parameter can | |||
occur as an unprotected attribute in any of the following | occur as an unprotected attribute in any of the following | |||
structures: COSE_Sign1, COSE_Signature, COSE_Encrypt, | structures: COSE_Sign1, COSE_Signature, COSE_Encrypt, | |||
COSE_recipient, COSE_Encrypt0, COSE_Mac, and COSE_Mac0. These | COSE_recipient, COSE_Encrypt0, COSE_Mac, and COSE_Mac0. These | |||
structures all have the same beginning elements, so that a | structures all have the same beginning elements, so that a | |||
consistent calculation of the counter signature can be computed. | consistent calculation of the counter signature can be computed. | |||
Details on computing counter signatures are found in Section 4.5. | Details on counter signatures are found in Section 5. | |||
+-----------+-------+----------------+-------------+----------------+ | +-----------+-------+----------------+-------------+----------------+ | |||
| Name | Label | Value Type | Value | Description | | | Name | Label | Value Type | Value | Description | | |||
| | | | Registry | | | | | | | Registry | | | |||
+-----------+-------+----------------+-------------+----------------+ | +-----------+-------+----------------+-------------+----------------+ | |||
| alg | 1 | int / tstr | COSE | Cryptographic | | | alg | 1 | int / tstr | COSE | Cryptographic | | |||
| | | | Algorithms | algorithm to | | | | | | Algorithms | algorithm to | | |||
| | | | registry | use | | | | | | registry | use | | |||
| crit | 2 | [+ label] | COSE Header | Critical | | | crit | 2 | [+ label] | COSE Header | Critical | | |||
| | | | Parameters | headers to be | | | | | | Parameters | headers to be | | |||
skipping to change at page 18, line 31 ¶ | skipping to change at page 18, line 31 ¶ | |||
payload: This field contains the serialized content to be signed. | payload: This field contains the serialized content to be signed. | |||
If the payload is not present in the message, the application is | If the payload is not present in the message, the application is | |||
required to supply the payload separately. The payload is wrapped | required to supply the payload separately. The payload is wrapped | |||
in a bstr to ensure that it is transported without changes. If | in a bstr to ensure that it is transported without changes. If | |||
the payload is transported separately ("detached content"), then a | the payload is transported separately ("detached content"), then a | |||
nil CBOR object is placed in this location, and it is the | nil CBOR object is placed in this location, and it is the | |||
responsibility of the application to ensure that it will be | responsibility of the application to ensure that it will be | |||
transported without changes. | transported without changes. | |||
Note: When a signature with a message recovery algorithm is used | Note: When a signature with a message recovery algorithm is used | |||
(Section 8), the maximum number of bytes that can be recovered is | (Section 9), the maximum number of bytes that can be recovered is | |||
the length of the payload. The size of the payload is reduced by | the length of the payload. The size of the payload is reduced by | |||
the number of bytes that will be recovered. If all of the bytes | the number of bytes that will be recovered. If all of the bytes | |||
of the payload are consumed, then the payload is encoded as a | of the payload are consumed, then the payload is encoded as a | |||
zero-length binary string rather than as being absent. | zero-length binary string rather than as being absent. | |||
signatures: This field is an array of signatures. Each signature is | signatures: This field is an array of signatures. Each signature is | |||
represented as a COSE_Signature structure. | represented as a COSE_Signature structure. | |||
The CDDL fragment that represents the above text for COSE_Sign | The CDDL fragment that represents the above text for COSE_Sign | |||
follows. | follows. | |||
skipping to change at page 21, line 26 ¶ | skipping to change at page 21, line 26 ¶ | |||
1. A text string identifying the context of the signature. The | 1. A text string identifying the context of the signature. The | |||
context string is: | context string is: | |||
"Signature" for signatures using the COSE_Signature structure. | "Signature" for signatures using the COSE_Signature structure. | |||
"Signature1" for signatures using the COSE_Sign1 structure. | "Signature1" for signatures using the COSE_Sign1 structure. | |||
"CounterSignature" for signatures used as counter signature | "CounterSignature" for signatures used as counter signature | |||
attributes. | attributes. | |||
"CounterSignature0" for signatures used as CounterSignature0 | ||||
attributes. | ||||
2. The protected attributes from the body structure encoded in a | 2. The protected attributes from the body structure encoded in a | |||
bstr type. If there are no protected attributes, a bstr of | bstr type. If there are no protected attributes, a bstr of | |||
length zero is used. | length zero is used. | |||
3. The protected attributes from the signer structure encoded in a | 3. The protected attributes from the signer structure encoded in a | |||
bstr type. If there are no protected attributes, a bstr of | bstr type. If there are no protected attributes, a bstr of | |||
length zero is used. This field is omitted for the COSE_Sign1 | length zero is used. This field is omitted for the COSE_Sign1 | |||
signature structure. | signature structure and CounterSignature0 attributes. | |||
4. The protected attributes from the application encoded in a bstr | 4. The protected attributes from the application encoded in a bstr | |||
type. If this field is not supplied, it defaults to a zero- | type. If this field is not supplied, it defaults to a zero- | |||
length binary string. (See Section 4.3 for application guidance | length binary string. (See Section 4.3 for application guidance | |||
on constructing this field.) | on constructing this field.) | |||
5. The payload to be signed encoded in a bstr type. The payload is | 5. The payload to be signed encoded in a bstr type. The payload is | |||
placed here independent of how it is transported. | placed here independent of how it is transported. | |||
The CDDL fragment that describes the above text is: | The CDDL fragment that describes the above text is: | |||
skipping to change at page 22, line 4 ¶ | skipping to change at page 22, line 12 ¶ | |||
The CDDL fragment that describes the above text is: | The CDDL fragment that describes the above text is: | |||
Sig_structure = [ | Sig_structure = [ | |||
context : "Signature" / "Signature1" / "CounterSignature", | context : "Signature" / "Signature1" / "CounterSignature", | |||
body_protected : empty_or_serialized_map, | body_protected : empty_or_serialized_map, | |||
? sign_protected : empty_or_serialized_map, | ? sign_protected : empty_or_serialized_map, | |||
external_aad : bstr, | external_aad : bstr, | |||
payload : bstr | payload : bstr | |||
] | ] | |||
How to compute a signature: | How to compute a signature: | |||
1. Create a Sig_structure and populate it with the appropriate | 1. Create a Sig_structure and populate it with the appropriate | |||
fields. | fields. | |||
2. Create the value ToBeSigned by encoding the Sig_structure to a | 2. Create the value ToBeSigned by encoding the Sig_structure to a | |||
byte string, using the encoding described in Section 13. | byte string, using the encoding described in Section 14. | |||
3. Call the signature creation algorithm passing in K (the key to | 3. Call the signature creation algorithm passing in K (the key to | |||
sign with), alg (the algorithm to sign with), and ToBeSigned (the | sign with), alg (the algorithm to sign with), and ToBeSigned (the | |||
value to sign). | value to sign). | |||
4. Place the resulting signature value in the 'signature' field of | 4. Place the resulting signature value in the 'signature' field of | |||
the array. | the array. | |||
The steps for verifying a signature are: | The steps for verifying a signature are: | |||
1. Create a Sig_structure object and populate it with the | 1. Create a Sig_structure object and populate it with the | |||
appropriate fields. | appropriate fields. | |||
2. Create the value ToBeSigned by encoding the Sig_structure to a | 2. Create the value ToBeSigned by encoding the Sig_structure to a | |||
byte string, using the encoding described in Section 13. | byte string, using the encoding described in Section 14. | |||
3. Call the signature verification algorithm passing in K (the key | 3. Call the signature verification algorithm passing in K (the key | |||
to verify with), alg (the algorithm used sign with), ToBeSigned | to verify with), alg (the algorithm used sign with), ToBeSigned | |||
(the value to sign), and sig (the signature to be verified). | (the value to sign), and sig (the signature to be verified). | |||
In addition to performing the signature verification, the application | In addition to performing the signature verification, the application | |||
performs the appropriate checks to ensure that the key is correctly | performs the appropriate checks to ensure that the key is correctly | |||
paired with the signing identity and that the signing identity is | paired with the signing identity and that the signing identity is | |||
authorized before performing actions. | authorized before performing actions. | |||
4.5. Computing Counter Signatures | 5. Counter Signatures | |||
Counter signatures provide a method of associating a different | COSE supports two different forms for counter signatures. Full | |||
signature generated by different signers with some piece of content. | countersignatures use the structure COSE_Countersign. This is same | |||
This is normally used to provide a signature on a signature allowing | structure as COSE_Signature and thus it can have protected | |||
for a proof that a signature existed at a given time (e.g., a | attributes, chained countersignatures and information about | |||
Timestamp). In this document, we allow for counter signatures to | identifying the key. Abbreviated countersignatures use the structure | |||
exist in a greater number of environments. As an example, it is | COSE_Countersign1. This structure only contains the signature value | |||
possible to place a counter signature in the unprotected attributes | and nothing else. The structures cannot be converted between each | |||
of a COSE_Encrypt object. This would allow for an intermediary to | other; as the signature computation includes a parameter identifying | |||
either verify that the encrypted byte string has not been modified, | which structure is being used, the converted structure will fail | |||
without being able to decrypt it, or assert that an encrypted byte | signature validation. | |||
string either existed at a given time or passed through it in terms | ||||
of routing (e.g., a proxy signature). | COSE was designed for uniformity in how the data strutures are | |||
specified. One result of this is that for COSE one can expand the | ||||
concept of countersignatures beyond just the idea of signing a | ||||
signature to being able to sign most of the structures without having | ||||
to create a new signing layer. When creating a countersignature, one | ||||
needs to be clear about the security properties that result. When | ||||
done on a COSE_Signature, the normal countersignature semantics are | ||||
preserved. That is the countersignature makes a statement about the | ||||
existance of a signature and, when used as a timestamp, a time point | ||||
at which the signature exists. When done on a COSE_Mac or a | ||||
COSE_Mac0, one effectively upgrades the MAC operation to a sginature | ||||
operation. When done on a COSE_Encrypt or COSE_Encrypt0, the | ||||
existance of the encrypted data is attested to. It should be noted | ||||
that there is a big difference between attesting to the enrypted data | ||||
as oppose to attesting to the unencrypted data. If the latter is | ||||
what is desired, then one needs to apply a signature to the data and | ||||
then encrypt that. It is always possible to construct cases where | ||||
the decryption is successful, while providing completely different | ||||
answers by using a different key. This situation is not detectable | ||||
by a countersignature on the encrypted data. | ||||
5.1. Full Countersignatures | ||||
The COSE_Countersignature structure allows for the same set of | ||||
capabilities of a COSE_Signature. This means that all of the | ||||
capabilities of a signature are duplicated with this structure. | ||||
Specifically, the countersigner does not need to be related to the | ||||
producer of what is being counter signed as key and algorithm | ||||
identification can be placed in the countersignature attributes. | ||||
This also means that the countersignature can itself be | ||||
countersigned. This is a feature required by protocols such as long- | ||||
term archiving services. More information on how this is used can be | ||||
found in the evidence record syntax described in [RFC4998]. | ||||
The full countersignature structure can be encoded as either a tagged | ||||
or untagged depending on the context it is used in. A tagged | ||||
COSE_Countersign steruture is identified byt the CBOR tag TBD0. The | ||||
CDDL fragment for full countersignatures is: | ||||
COSE_CounterSignature_Tagged = #6.98(COSE_CounterSignature) | ||||
COSE_CounterSignature = COSE_Signature | ||||
The details of the fields of a countersignature can be found in | ||||
Section 4.1. The process of creating and validating abbreviated | ||||
countersignatures is defined in Section 4.4. | ||||
An example of a counter signature on a signature can be found in | An example of a counter signature on a signature can be found in | |||
Appendix C.1.3. An example of a counter signature in an encryption | Appendix C.1.3. An example of a counter signature in an encryption | |||
object can be found in Appendix C.3.3. | object can be found in Appendix C.3.3. | |||
The creation and validation of counter signatures over the different | ||||
items relies on the fact that the objects have the same structure. | ||||
The elements are a set of protected attributes, a set of unprotected | ||||
attributes, and a body, in that order. This means that the | ||||
Sig_structure can be used in a uniform manner to get the byte string | ||||
for processing a signature. If the counter signature is going to be | ||||
computed over a COSE_Encrypt structure, the body_protected and | ||||
payload items can be mapped into the Sig_structure in the same manner | ||||
as from the COSE_Sign structure. | ||||
It should be noted that only a signature algorithm with appendix (see | It should be noted that only a signature algorithm with appendix (see | |||
Section 8) can be used for counter signatures. This is because the | Section 9) can be used for counter signatures. This is because the | |||
body should be able to be processed without having to evaluate the | body should be able to be processed without having to evaluate the | |||
counter signature, and this is not possible for signature schemes | counter signature, and this is not possible for signature schemes | |||
with message recovery. | with message recovery. | |||
5. Encryption Objects | 5.2. Abbreviated Countersignatures | |||
Abbreviated countersignatures were designed primarily to deal with | ||||
the problem of having group encrypted messaging, but still needing to | ||||
know who orginated the message. The object was to keep the | ||||
countersignature as small as possible while still providing the | ||||
needed security. For abbreviated countersignatures, there is no | ||||
provision for any protected attributes related to the signing | ||||
operation. Instead, the context that was used to describe the | ||||
encryption processing is also assumed to describe the context that | ||||
was used to create the countersignature. | ||||
The byte string representing the signature value is placed in the | ||||
CounterSignature0 attribute. This attribute is then encoded as an | ||||
unprotected header. The attribute is defined below. | ||||
The process of creating and validating abbreviated countersignatures | ||||
is defined in Section 4.4. | ||||
+-------------------+-------+---------+-------+---------------------+ | ||||
| Name | Label | Value | Value | Description | | ||||
| | | Type | | | | ||||
+-------------------+-------+---------+-------+---------------------+ | ||||
| CounterSignature0 | 9 | bstr | | Abbreviated | | ||||
| | | | | Countersignature | | ||||
+-------------------+-------+---------+-------+---------------------+ | ||||
Table 4: Header Parameter for CounterSignature0 | ||||
6. Encryption Objects | ||||
COSE supports two different encryption structures. COSE_Encrypt0 is | COSE supports two different encryption structures. COSE_Encrypt0 is | |||
used when a recipient structure is not needed because the key to be | used when a recipient structure is not needed because the key to be | |||
used is known implicitly. COSE_Encrypt is used the rest of the time. | used is known implicitly. COSE_Encrypt is used the rest of the time. | |||
This includes cases where there are multiple recipients or a | This includes cases where there are multiple recipients or a | |||
recipient algorithm other than direct (i.e. pre-shared secret) is | recipient algorithm other than direct (i.e. pre-shared secret) is | |||
used. | used. | |||
5.1. Enveloped COSE Structure | 6.1. Enveloped COSE Structure | |||
The enveloped structure allows for one or more recipients of a | The enveloped structure allows for one or more recipients of a | |||
message. There are provisions for parameters about the content and | message. There are provisions for parameters about the content and | |||
parameters about the recipient information to be carried in the | parameters about the recipient information to be carried in the | |||
message. The protected parameters associated with the content are | message. The protected parameters associated with the content are | |||
authenticated by the content encryption algorithm. The protected | authenticated by the content encryption algorithm. The protected | |||
parameters associated with the recipient are authenticated by the | parameters associated with the recipient are authenticated by the | |||
recipient algorithm (when the algorithm supports it). Examples of | recipient algorithm (when the algorithm supports it). Examples of | |||
parameters about the content are the type of the content and the | parameters about the content are the type of the content and the | |||
content encryption algorithm. Examples of parameters about the | content encryption algorithm. Examples of parameters about the | |||
skipping to change at page 25, line 20 ¶ | skipping to change at page 26, line 44 ¶ | |||
The CDDL fragment that corresponds to the above text for | The CDDL fragment that corresponds to the above text for | |||
COSE_recipient is: | COSE_recipient is: | |||
COSE_recipient = [ | COSE_recipient = [ | |||
Headers, | Headers, | |||
ciphertext : bstr / nil, | ciphertext : bstr / nil, | |||
? recipients : [+COSE_recipient] | ? recipients : [+COSE_recipient] | |||
] | ] | |||
5.1.1. Content Key Distribution Methods | 6.1.1. Content Key Distribution Methods | |||
An encrypted message consists of an encrypted content and an | An encrypted message consists of an encrypted content and an | |||
encrypted CEK for one or more recipients. The CEK is encrypted for | encrypted CEK for one or more recipients. The CEK is encrypted for | |||
each recipient, using a key specific to that recipient. The details | each recipient, using a key specific to that recipient. The details | |||
of this encryption depend on which class the recipient algorithm | of this encryption depend on which class the recipient algorithm | |||
falls into. Specific details on each of the classes can be found in | falls into. Specific details on each of the classes can be found in | |||
Section 12. A short summary of the five content key distribution | Section 13. A short summary of the five content key distribution | |||
methods is: | methods is: | |||
direct: The CEK is the same as the identified previously distributed | direct: The CEK is the same as the identified previously distributed | |||
symmetric key or is derived from a previously distributed secret. | symmetric key or is derived from a previously distributed secret. | |||
No CEK is transported in the message. | No CEK is transported in the message. | |||
symmetric key-encryption keys (KEK): The CEK is encrypted using a | symmetric key-encryption keys (KEK): The CEK is encrypted using a | |||
previously distributed symmetric KEK. Also known as key wrap. | previously distributed symmetric KEK. Also known as key wrap. | |||
key agreement: The recipient's public key and a sender's private key | key agreement: The recipient's public key and a sender's private key | |||
are used to generate a pairwise secret, a Key Derivation Function | are used to generate a pairwise secret, a Key Derivation Function | |||
(KDF) is applied to derive a key, and then the CEK is either the | (KDF) is applied to derive a key, and then the CEK is either the | |||
derived key or encrypted by the derived key. | derived key or encrypted by the derived key. | |||
key transport: The CEK is encrypted with the recipient's public key. | key transport: The CEK is encrypted with the recipient's public key. | |||
No key transport algorithms are defined in this document. | No key transport algorithms are defined in this document. | |||
passwords: The CEK is encrypted in a KEK that is derived from a | passwords: The CEK is encrypted in a KEK that is derived from a | |||
password. No password algorithms are defined in this document. | password. No password algorithms are defined in this document. | |||
5.2. Single Recipient Encrypted | 6.2. Single Recipient Encrypted | |||
The COSE_Encrypt0 encrypted structure does not have the ability to | The COSE_Encrypt0 encrypted structure does not have the ability to | |||
specify recipients of the message. The structure assumes that the | specify recipients of the message. The structure assumes that the | |||
recipient of the object will already know the identity of the key to | recipient of the object will already know the identity of the key to | |||
be used in order to decrypt the message. If a key needs to be | be used in order to decrypt the message. If a key needs to be | |||
identified to the recipient, the enveloped structure ought to be | identified to the recipient, the enveloped structure ought to be | |||
used. | used. | |||
Examples of encrypted messages can be found in Appendix C.3. | Examples of encrypted messages can be found in Appendix C.3. | |||
skipping to change at page 26, line 24 ¶ | skipping to change at page 27, line 48 ¶ | |||
COSE_Encrypt0_Tagged = #6.16(COSE_Encrypt0) | COSE_Encrypt0_Tagged = #6.16(COSE_Encrypt0) | |||
The COSE_Encrypt0 structure is a CBOR array. The fields of the array | The COSE_Encrypt0 structure is a CBOR array. The fields of the array | |||
in order are: | in order are: | |||
protected: This is as described in Section 3. | protected: This is as described in Section 3. | |||
unprotected: This is as described in Section 3. | unprotected: This is as described in Section 3. | |||
ciphertext: This is as described in Section 5.1. | ciphertext: This is as described in Section 6.1. | |||
The CDDL fragment for COSE_Encrypt0 that corresponds to the above | The CDDL fragment for COSE_Encrypt0 that corresponds to the above | |||
text is: | text is: | |||
COSE_Encrypt0 = [ | COSE_Encrypt0 = [ | |||
Headers, | Headers, | |||
ciphertext : bstr / nil, | ciphertext : bstr / nil, | |||
] | ] | |||
5.3. How to Encrypt and Decrypt for AEAD Algorithms | 6.3. How to Encrypt and Decrypt for AEAD Algorithms | |||
The encryption algorithm for AEAD algorithms is fairly simple. The | The encryption algorithm for AEAD algorithms is fairly simple. The | |||
first step is to create a consistent byte string for the | first step is to create a consistent byte string for the | |||
authenticated data structure. For this purpose, we use an | authenticated data structure. For this purpose, we use an | |||
Enc_structure. The Enc_structure is a CBOR array. The fields of the | Enc_structure. The Enc_structure is a CBOR array. The fields of the | |||
Enc_structure in order are: | Enc_structure in order are: | |||
1. A text string identifying the context of the authenticated data | 1. A text string identifying the context of the authenticated data | |||
structure. The context string is: | structure. The context string is: | |||
skipping to change at page 27, line 31 ¶ | skipping to change at page 29, line 4 ¶ | |||
constructing this field.) | constructing this field.) | |||
The CDDL fragment that describes the above text is: | The CDDL fragment that describes the above text is: | |||
Enc_structure = [ | Enc_structure = [ | |||
context : "Encrypt" / "Encrypt0" / "Enc_Recipient" / | context : "Encrypt" / "Encrypt0" / "Enc_Recipient" / | |||
"Mac_Recipient" / "Rec_Recipient", | "Mac_Recipient" / "Rec_Recipient", | |||
protected : empty_or_serialized_map, | protected : empty_or_serialized_map, | |||
external_aad : bstr | external_aad : bstr | |||
] | ] | |||
How to encrypt a message: | How to encrypt a message: | |||
1. Create an Enc_structure and populate it with the appropriate | 1. Create an Enc_structure and populate it with the appropriate | |||
fields. | fields. | |||
2. Encode the Enc_structure to a byte string (Additional | 2. Encode the Enc_structure to a byte string (Additional | |||
Authenticated Data (AAD)), using the encoding described in | Authenticated Data (AAD)), using the encoding described in | |||
Section 13. | Section 14. | |||
3. Determine the encryption key (K). This step is dependent on the | 3. Determine the encryption key (K). This step is dependent on the | |||
class of recipient algorithm being used. For: | class of recipient algorithm being used. For: | |||
No Recipients: The key to be used is determined by the algorithm | No Recipients: The key to be used is determined by the algorithm | |||
and key at the current layer. Examples are key transport keys | and key at the current layer. Examples are key transport keys | |||
(Section 12.3), key wrap keys (Section 12.2), or pre-shared | (Section 13.3), key wrap keys (Section 13.2), or pre-shared | |||
secrets. | secrets. | |||
Direct Encryption and Direct Key Agreement: The key is | Direct Encryption and Direct Key Agreement: The key is | |||
determined by the key and algorithm in the recipient | determined by the key and algorithm in the recipient | |||
structure. The encryption algorithm and size of the key to be | structure. The encryption algorithm and size of the key to be | |||
used are inputs into the KDF used for the recipient. (For | used are inputs into the KDF used for the recipient. (For | |||
direct, the KDF can be thought of as the identity operation.) | direct, the KDF can be thought of as the identity operation.) | |||
Examples of these algorithms are found in Sections !!! DIRECT- | Examples of these algorithms are found in Sections 6.1.2 and | |||
KDF !!! and !!! ECDH !!! of [I-D.ietf-cose-rfc8152bis-algs]. | 6.3 of [I-D.ietf-cose-rfc8152bis-algs]. | |||
Other: The key is randomly or pseudorandomly generated. | Other: The key is randomly or pseudorandomly generated. | |||
4. Call the encryption algorithm with K (the encryption key), P (the | 4. Call the encryption algorithm with K (the encryption key), P (the | |||
plaintext), and AAD. Place the returned ciphertext into the | plaintext), and AAD. Place the returned ciphertext into the | |||
'ciphertext' field of the structure. | 'ciphertext' field of the structure. | |||
5. For recipients of the message, recursively perform the encryption | 5. For recipients of the message, recursively perform the encryption | |||
algorithm for that recipient, using K (the encryption key) as the | algorithm for that recipient, using K (the encryption key) as the | |||
plaintext. | plaintext. | |||
How to decrypt a message: | How to decrypt a message: | |||
1. Create an Enc_structure and populate it with the appropriate | 1. Create an Enc_structure and populate it with the appropriate | |||
fields. | fields. | |||
2. Encode the Enc_structure to a byte string (AAD), using the | 2. Encode the Enc_structure to a byte string (AAD), using the | |||
encoding described in Section 13. | encoding described in Section 14. | |||
3. Determine the decryption key. This step is dependent on the | 3. Determine the decryption key. This step is dependent on the | |||
class of recipient algorithm being used. For: | class of recipient algorithm being used. For: | |||
No Recipients: The key to be used is determined by the algorithm | No Recipients: The key to be used is determined by the algorithm | |||
and key at the current layer. Examples are key transport keys | and key at the current layer. Examples are key transport keys | |||
(Section 12.3), key wrap keys (Section 12.2), or pre-shared | (Section 13.3), key wrap keys (Section 13.2), or pre-shared | |||
secrets. | secrets. | |||
Direct Encryption and Direct Key Agreement: The key is | Direct Encryption and Direct Key Agreement: The key is | |||
determined by the key and algorithm in the recipient | determined by the key and algorithm in the recipient | |||
structure. The encryption algorithm and size of the key to be | structure. The encryption algorithm and size of the key to be | |||
used are inputs into the KDF used for the recipient. (For | used are inputs into the KDF used for the recipient. (For | |||
direct, the KDF can be thought of as the identity operation.) | direct, the KDF can be thought of as the identity operation.) | |||
Other: The key is determined by decoding and decrypting one of | Other: The key is determined by decoding and decrypting one of | |||
the recipient structures. | the recipient structures. | |||
4. Call the decryption algorithm with K (the decryption key to use), | 4. Call the decryption algorithm with K (the decryption key to use), | |||
C (the ciphertext), and AAD. | C (the ciphertext), and AAD. | |||
5.4. How to Encrypt and Decrypt for AE Algorithms | 6.4. How to Encrypt and Decrypt for AE Algorithms | |||
How to encrypt a message: | How to encrypt a message: | |||
1. Verify that the 'protected' field is empty. | 1. Verify that the 'protected' field is empty. | |||
2. Verify that there was no external additional authenticated data | 2. Verify that there was no external additional authenticated data | |||
supplied for this operation. | supplied for this operation. | |||
3. Determine the encryption key. This step is dependent on the | 3. Determine the encryption key. This step is dependent on the | |||
class of recipient algorithm being used. For: | class of recipient algorithm being used. For: | |||
No Recipients: The key to be used is determined by the algorithm | No Recipients: The key to be used is determined by the algorithm | |||
and key at the current layer. Examples are key transport keys | and key at the current layer. Examples are key transport keys | |||
(Section 12.3), key wrap keys (Section 12.2), or pre-shared | (Section 13.3), key wrap keys (Section 13.2), or pre-shared | |||
secrets. | secrets. | |||
Direct Encryption and Direct Key Agreement: The key is | Direct Encryption and Direct Key Agreement: The key is | |||
determined by the key and algorithm in the recipient | determined by the key and algorithm in the recipient | |||
structure. The encryption algorithm and size of the key to be | structure. The encryption algorithm and size of the key to be | |||
used are inputs into the KDF used for the recipient. (For | used are inputs into the KDF used for the recipient. (For | |||
direct, the KDF can be thought of as the identity operation.) | direct, the KDF can be thought of as the identity operation.) | |||
Examples of these algorithms are found in Sections !!!DIRECT- | Examples of these algorithms are found in Sections 6.1.2 and | |||
KDF!!! and !!! ECDH !!! . | 6.3 of [I-D.ietf-cose-rfc8152bis-algs]. | |||
Other: The key is randomly generated. | Other: The key is randomly generated. | |||
4. Call the encryption algorithm with K (the encryption key to use) | 4. Call the encryption algorithm with K (the encryption key to use) | |||
and P (the plaintext). Place the returned ciphertext into the | and P (the plaintext). Place the returned ciphertext into the | |||
'ciphertext' field of the structure. | 'ciphertext' field of the structure. | |||
5. For recipients of the message, recursively perform the encryption | 5. For recipients of the message, recursively perform the encryption | |||
algorithm for that recipient, using K (the encryption key) as the | algorithm for that recipient, using K (the encryption key) as the | |||
plaintext. | plaintext. | |||
skipping to change at page 29, line 46 ¶ | skipping to change at page 31, line 21 ¶ | |||
1. Verify that the 'protected' field is empty. | 1. Verify that the 'protected' field is empty. | |||
2. Verify that there was no external additional authenticated data | 2. Verify that there was no external additional authenticated data | |||
supplied for this operation. | supplied for this operation. | |||
3. Determine the decryption key. This step is dependent on the | 3. Determine the decryption key. This step is dependent on the | |||
class of recipient algorithm being used. For: | class of recipient algorithm being used. For: | |||
No Recipients: The key to be used is determined by the algorithm | No Recipients: The key to be used is determined by the algorithm | |||
and key at the current layer. Examples are key transport keys | and key at the current layer. Examples are key transport keys | |||
(Section 12.3), key wrap keys (Section 12.2), or pre-shared | (Section 13.3), key wrap keys (Section 13.2), or pre-shared | |||
secrets. | secrets. | |||
Direct Encryption and Direct Key Agreement: The key is | Direct Encryption and Direct Key Agreement: The key is | |||
determined by the key and algorithm in the recipient | determined by the key and algorithm in the recipient | |||
structure. The encryption algorithm and size of the key to be | structure. The encryption algorithm and size of the key to be | |||
used are inputs into the KDF used for the recipient. (For | used are inputs into the KDF used for the recipient. (For | |||
direct, the KDF can be thought of as the identity operation.) | direct, the KDF can be thought of as the identity operation.) | |||
Examples of these algorithms are found in Sections !!! DIRECT- | Examples of these algorithms are found in Sections 6.1.2 and | |||
KDF !!! and !!! ECDH !!! . | 6.3 of [I-D.ietf-cose-rfc8152bis-algs]. | |||
Other: The key is determined by decoding and decrypting one of | Other: The key is determined by decoding and decrypting one of | |||
the recipient structures. | the recipient structures. | |||
4. Call the decryption algorithm with K (the decryption key to use) | 4. Call the decryption algorithm with K (the decryption key to use) | |||
and C (the ciphertext). | and C (the ciphertext). | |||
6. MAC Objects | 7. MAC Objects | |||
COSE supports two different MAC structures. COSE_MAC0 is used when a | COSE supports two different MAC structures. COSE_MAC0 is used when a | |||
recipient structure is not needed because the key to be used is | recipient structure is not needed because the key to be used is | |||
implicitly known. COSE_MAC is used for all other cases. These | implicitly known. COSE_MAC is used for all other cases. These | |||
include a requirement for multiple recipients, the key being unknown, | include a requirement for multiple recipients, the key being unknown, | |||
and a recipient algorithm of other than direct. | and a recipient algorithm of other than direct. | |||
In this section, we describe the structure and methods to be used | In this section, we describe the structure and methods to be used | |||
when doing MAC authentication in COSE. This document allows for the | when doing MAC authentication in COSE. This document allows for the | |||
use of all of the same classes of recipient algorithms as are allowed | use of all of the same classes of recipient algorithms as are allowed | |||
skipping to change at page 30, line 41 ¶ | skipping to change at page 32, line 16 ¶ | |||
the content has not been changed since the MAC was computed and to | the content has not been changed since the MAC was computed and to | |||
use the recipient algorithm to verify who sent it. The classes of | use the recipient algorithm to verify who sent it. The classes of | |||
recipient algorithms that support this are those that use a pre- | recipient algorithms that support this are those that use a pre- | |||
shared secret or do static-static (SS) key agreement (without the key | shared secret or do static-static (SS) key agreement (without the key | |||
wrap step). In both of these cases, the entity that created and sent | wrap step). In both of these cases, the entity that created and sent | |||
the message MAC can be validated. (This knowledge of the sender | the message MAC can be validated. (This knowledge of the sender | |||
assumes that there are only two parties involved and that you did not | assumes that there are only two parties involved and that you did not | |||
send the message to yourself.) The origination property can be | send the message to yourself.) The origination property can be | |||
obtained with both of the MAC message structures. | obtained with both of the MAC message structures. | |||
6.1. MACed Message with Recipients | 7.1. MACed Message with Recipients | |||
The multiple recipient MACed message uses two structures: the | The multiple recipient MACed message uses two structures: the | |||
COSE_Mac structure defined in this section for carrying the body and | COSE_Mac structure defined in this section for carrying the body and | |||
the COSE_recipient structure (Section 5.1) to hold the key used for | the COSE_recipient structure (Section 6.1) to hold the key used for | |||
the MAC computation. Examples of MACed messages can be found in | the MAC computation. Examples of MACed messages can be found in | |||
Appendix C.5. | Appendix C.5. | |||
The MAC structure can be encoded as either tagged or untagged | The MAC structure can be encoded as either tagged or untagged | |||
depending on the context it will be used in. A tagged COSE_Mac | depending on the context it will be used in. A tagged COSE_Mac | |||
structure is identified by the CBOR tag 97. The CDDL fragment that | structure is identified by the CBOR tag 97. The CDDL fragment that | |||
represents this is: | represents this is: | |||
COSE_Mac_Tagged = #6.97(COSE_Mac) | COSE_Mac_Tagged = #6.97(COSE_Mac) | |||
skipping to change at page 31, line 27 ¶ | skipping to change at page 32, line 49 ¶ | |||
the payload is not present in the message, the application is | the payload is not present in the message, the application is | |||
required to supply the payload separately. The payload is wrapped | required to supply the payload separately. The payload is wrapped | |||
in a bstr to ensure that it is transported without changes. If | in a bstr to ensure that it is transported without changes. If | |||
the payload is transported separately (i.e., detached content), | the payload is transported separately (i.e., detached content), | |||
then a nil CBOR value is placed in this location, and it is the | then a nil CBOR value is placed in this location, and it is the | |||
responsibility of the application to ensure that it will be | responsibility of the application to ensure that it will be | |||
transported without changes. | transported without changes. | |||
tag: This field contains the MAC value. | tag: This field contains the MAC value. | |||
recipients: This is as described in Section 5.1. | recipients: This is as described in Section 6.1. | |||
The CDDL fragment that represents the above text for COSE_Mac | The CDDL fragment that represents the above text for COSE_Mac | |||
follows. | follows. | |||
COSE_Mac = [ | COSE_Mac = [ | |||
Headers, | Headers, | |||
payload : bstr / nil, | payload : bstr / nil, | |||
tag : bstr, | tag : bstr, | |||
recipients :[+COSE_recipient] | recipients :[+COSE_recipient] | |||
] | ] | |||
6.2. MACed Messages with Implicit Key | 7.2. MACed Messages with Implicit Key | |||
In this section, we describe the structure and methods to be used | In this section, we describe the structure and methods to be used | |||
when doing MAC authentication for those cases where the recipient is | when doing MAC authentication for those cases where the recipient is | |||
implicitly known. | implicitly known. | |||
The MACed message uses the COSE_Mac0 structure defined in this | The MACed message uses the COSE_Mac0 structure defined in this | |||
section for carrying the body. Examples of MACed messages with an | section for carrying the body. Examples of MACed messages with an | |||
implicit key can be found in Appendix C.6. | implicit key can be found in Appendix C.6. | |||
The MAC structure can be encoded as either tagged or untagged | The MAC structure can be encoded as either tagged or untagged | |||
skipping to change at page 32, line 16 ¶ | skipping to change at page 33, line 39 ¶ | |||
COSE_Mac0_Tagged = #6.17(COSE_Mac0) | COSE_Mac0_Tagged = #6.17(COSE_Mac0) | |||
The COSE_Mac0 structure is a CBOR array. The fields of the array in | The COSE_Mac0 structure is a CBOR array. The fields of the array in | |||
order are: | order are: | |||
protected: This is as described in Section 3. | protected: This is as described in Section 3. | |||
unprotected: This is as described in Section 3. | unprotected: This is as described in Section 3. | |||
payload: This is as described in Section 6.1. | payload: This is as described in Section 7.1. | |||
tag: This field contains the MAC value. | tag: This field contains the MAC value. | |||
The CDDL fragment that corresponds to the above text is: | The CDDL fragment that corresponds to the above text is: | |||
COSE_Mac0 = [ | COSE_Mac0 = [ | |||
Headers, | Headers, | |||
payload : bstr / nil, | payload : bstr / nil, | |||
tag : bstr, | tag : bstr, | |||
] | ] | |||
6.3. How to Compute and Verify a MAC | 7.3. How to Compute and Verify a MAC | |||
In order to get a consistent encoding of the data to be | In order to get a consistent encoding of the data to be | |||
authenticated, the MAC_structure is used to have a canonical form. | authenticated, the MAC_structure is used to have a canonical form. | |||
The MAC_structure is a CBOR array. The fields of the MAC_structure | The MAC_structure is a CBOR array. The fields of the MAC_structure | |||
in order are: | in order are: | |||
1. A text string that identifies the structure that is being | 1. A text string that identifies the structure that is being | |||
encoded. This string is "MAC" for the COSE_Mac structure. This | encoded. This string is "MAC" for the COSE_Mac structure. This | |||
string is "MAC0" for the COSE_Mac0 structure. | string is "MAC0" for the COSE_Mac0 structure. | |||
skipping to change at page 33, line 18 ¶ | skipping to change at page 34, line 42 ¶ | |||
external_aad : bstr, | external_aad : bstr, | |||
payload : bstr | payload : bstr | |||
] | ] | |||
The steps to compute a MAC are: | The steps to compute a MAC are: | |||
1. Create a MAC_structure and populate it with the appropriate | 1. Create a MAC_structure and populate it with the appropriate | |||
fields. | fields. | |||
2. Create the value ToBeMaced by encoding the MAC_structure to a | 2. Create the value ToBeMaced by encoding the MAC_structure to a | |||
byte string, using the encoding described in Section 13. | byte string, using the encoding described in Section 14. | |||
3. Call the MAC creation algorithm passing in K (the key to use), | 3. Call the MAC creation algorithm passing in K (the key to use), | |||
alg (the algorithm to MAC with), and ToBeMaced (the value to | alg (the algorithm to MAC with), and ToBeMaced (the value to | |||
compute the MAC on). | compute the MAC on). | |||
4. Place the resulting MAC in the 'tag' field of the COSE_Mac or | 4. Place the resulting MAC in the 'tag' field of the COSE_Mac or | |||
COSE_Mac0 structure. | COSE_Mac0 structure. | |||
5. For COSE_Mac structures, encrypt and encode the MAC key for each | 5. For COSE_Mac structures, encrypt and encode the MAC key for each | |||
recipient of the message. | recipient of the message. | |||
The steps to verify a MAC are: | The steps to verify a MAC are: | |||
1. Create a MAC_structure object and populate it with the | 1. Create a MAC_structure object and populate it with the | |||
appropriate fields. | appropriate fields. | |||
2. Create the value ToBeMaced by encoding the MAC_structure to a | 2. Create the value ToBeMaced by encoding the MAC_structure to a | |||
byte string, using the encoding described in Section 13. | byte string, using the encoding described in Section 14. | |||
3. For COSE_Mac structures, obtain the cryptographic key from one of | 3. For COSE_Mac structures, obtain the cryptographic key from one of | |||
the recipients of the message. | the recipients of the message. | |||
4. Call the MAC creation algorithm passing in K (the key to use), | 4. Call the MAC creation algorithm passing in K (the key to use), | |||
alg (the algorithm to MAC with), and ToBeMaced (the value to | alg (the algorithm to MAC with), and ToBeMaced (the value to | |||
compute the MAC on). | compute the MAC on). | |||
5. Compare the MAC value to the 'tag' field of the COSE_Mac or | 5. Compare the MAC value to the 'tag' field of the COSE_Mac or | |||
COSE_Mac0 structure. | COSE_Mac0 structure. | |||
7. Key Objects | 8. Key Objects | |||
A COSE Key structure is built on a CBOR map object. The set of | A COSE Key structure is built on a CBOR map object. The set of | |||
common parameters that can appear in a COSE Key can be found in the | common parameters that can appear in a COSE Key can be found in the | |||
IANA "COSE Key Common Parameters" registry (Section 15.4). | IANA "COSE Key Common Parameters" registry (Section 16.4). | |||
Additional parameters defined for specific key types can be found in | Additional parameters defined for specific key types can be found in | |||
the IANA "COSE Key Type Parameters" registry ([COSE.KeyParameters]). | the IANA "COSE Key Type Parameters" registry ([COSE.KeyParameters]). | |||
A COSE Key Set uses a CBOR array object as its underlying type. The | A COSE Key Set uses a CBOR array object as its underlying type. The | |||
values of the array elements are COSE Keys. A COSE Key Set MUST have | values of the array elements are COSE Keys. A COSE Key Set MUST have | |||
at least one element in the array. Examples of COSE Key Sets can be | at least one element in the array. Examples of COSE Key Sets can be | |||
found in Appendix C.7. | found in Appendix C.7. | |||
Each element in a COSE Key Set MUST be processed independently. If | Each element in a COSE Key Set MUST be processed independently. If | |||
one element in a COSE Key Set is either malformed or uses a key that | one element in a COSE Key Set is either malformed or uses a key that | |||
skipping to change at page 34, line 33 ¶ | skipping to change at page 36, line 16 ¶ | |||
1 => tstr / int, ; kty | 1 => tstr / int, ; kty | |||
? 2 => bstr, ; kid | ? 2 => bstr, ; kid | |||
? 3 => tstr / int, ; alg | ? 3 => tstr / int, ; alg | |||
? 4 => [+ (tstr / int) ], ; key_ops | ? 4 => [+ (tstr / int) ], ; key_ops | |||
? 5 => bstr, ; Base IV | ? 5 => bstr, ; Base IV | |||
* label => values | * label => values | |||
} | } | |||
COSE_KeySet = [+COSE_Key] | COSE_KeySet = [+COSE_Key] | |||
7.1. COSE Key Common Parameters | 8.1. COSE Key Common Parameters | |||
This document defines a set of common parameters for a COSE Key | This document defines a set of common parameters for a COSE Key | |||
object. Table 4 provides a summary of the parameters defined in this | object. Table 5 provides a summary of the parameters defined in this | |||
section. There are also parameters that are defined for specific key | section. There are also parameters that are defined for specific key | |||
types. Key-type-specific parameters can be found in | types. Key-type-specific parameters can be found in | |||
[I-D.ietf-cose-rfc8152bis-algs]. | [I-D.ietf-cose-rfc8152bis-algs]. | |||
+---------+-------+----------------+------------+-------------------+ | +---------+-------+----------------+------------+-------------------+ | |||
| Name | Label | CBOR Type | Value | Description | | | Name | Label | CBOR Type | Value | Description | | |||
| | | | Registry | | | | | | | Registry | | | |||
+---------+-------+----------------+------------+-------------------+ | +---------+-------+----------------+------------+-------------------+ | |||
| kty | 1 | tstr / int | COSE Key | Identification of | | | kty | 1 | tstr / int | COSE Key | Identification of | | |||
| | | | Types | the key type | | | | | | Types | the key type | | |||
skipping to change at page 35, line 30 ¶ | skipping to change at page 36, line 49 ¶ | |||
| | | | | | | | | | | | | | |||
| key_ops | 4 | [+ (tstr/int)] | | Restrict set of | | | key_ops | 4 | [+ (tstr/int)] | | Restrict set of | | |||
| | | | | permissible | | | | | | | permissible | | |||
| | | | | operations | | | | | | | operations | | |||
| | | | | | | | | | | | | | |||
| Base IV | 5 | bstr | | Base IV to be | | | Base IV | 5 | bstr | | Base IV to be | | |||
| | | | | xor-ed with | | | | | | | xor-ed with | | |||
| | | | | Partial IVs | | | | | | | Partial IVs | | |||
+---------+-------+----------------+------------+-------------------+ | +---------+-------+----------------+------------+-------------------+ | |||
Table 4: Key Map Labels | Table 5: Key Map Labels | |||
kty: This parameter is used to identify the family of keys for this | kty: This parameter is used to identify the family of keys for this | |||
structure and, thus, the set of key-type-specific parameters to be | structure and, thus, the set of key-type-specific parameters to be | |||
found. The set of values defined in this document can be found in | found. The set of values defined in this document can be found in | |||
[COSE.KeyTypes]. This parameter MUST be present in a key object. | [COSE.KeyTypes]. This parameter MUST be present in a key object. | |||
Implementations MUST verify that the key type is appropriate for | Implementations MUST verify that the key type is appropriate for | |||
the algorithm being processed. The key type MUST be included as | the algorithm being processed. The key type MUST be included as | |||
part of the trust decision process. | part of the trust decision process. | |||
alg: This parameter is used to restrict the algorithm that is used | alg: This parameter is used to restrict the algorithm that is used | |||
skipping to change at page 36, line 10 ¶ | skipping to change at page 37, line 29 ¶ | |||
kid: This parameter is used to give an identifier for a key. The | kid: This parameter is used to give an identifier for a key. The | |||
identifier is not structured and can be anything from a user- | identifier is not structured and can be anything from a user- | |||
provided string to a value computed on the public portion of the | provided string to a value computed on the public portion of the | |||
key. This field is intended for matching against a 'kid' | key. This field is intended for matching against a 'kid' | |||
parameter in a message in order to filter down the set of keys | parameter in a message in order to filter down the set of keys | |||
that need to be checked. | that need to be checked. | |||
key_ops: This parameter is defined to restrict the set of operations | key_ops: This parameter is defined to restrict the set of operations | |||
that a key is to be used for. The value of the field is an array | that a key is to be used for. The value of the field is an array | |||
of values from Table 5. Algorithms define the values of key ops | of values from Table 6. Algorithms define the values of key ops | |||
that are permitted to appear and are required for specific | that are permitted to appear and are required for specific | |||
operations. The set of values matches that in [RFC7517] and | operations. The set of values matches that in [RFC7517] and | |||
[W3C.WebCrypto]. | [W3C.WebCrypto]. | |||
Base IV: This parameter is defined to carry the base portion of an | Base IV: This parameter is defined to carry the base portion of an | |||
IV. It is designed to be used with the Partial IV header | IV. It is designed to be used with the Partial IV header | |||
parameter defined in Section 3.1. This field provides the ability | parameter defined in Section 3.1. This field provides the ability | |||
to associate a Partial IV with a key that is then modified on a | to associate a Partial IV with a key that is then modified on a | |||
per message basis with the Partial IV. | per message basis with the Partial IV. | |||
skipping to change at page 37, line 28 ¶ | skipping to change at page 38, line 30 ¶ | |||
| derive | 7 | The key is used for deriving keys. Requires | | | derive | 7 | The key is used for deriving keys. Requires | | |||
| key | | private key fields. | | | key | | private key fields. | | |||
| derive | 8 | The key is used for deriving bits not to be | | | derive | 8 | The key is used for deriving bits not to be | | |||
| bits | | used as a key. Requires private key fields. | | | bits | | used as a key. Requires private key fields. | | |||
| MAC | 9 | The key is used for creating MACs. | | | MAC | 9 | The key is used for creating MACs. | | |||
| create | | | | | create | | | | |||
| MAC | 10 | The key is used for validating MACs. | | | MAC | 10 | The key is used for validating MACs. | | |||
| verify | | | | | verify | | | | |||
+---------+-------+-------------------------------------------------+ | +---------+-------+-------------------------------------------------+ | |||
Table 5: Key Operation Values | Table 6: Key Operation Values | |||
8. Signature Algorithms | 9. Signature Algorithms | |||
There are two signature algorithm schemes. The first is signature | There are two signature algorithm schemes. The first is signature | |||
with appendix. In this scheme, the message content is processed and | with appendix. In this scheme, the message content is processed and | |||
a signature is produced; the signature is called the appendix. This | a signature is produced; the signature is called the appendix. This | |||
is the scheme used by algorithms such as ECDSA and the RSA | is the scheme used by algorithms such as ECDSA and the RSA | |||
Probabilistic Signature Scheme (RSASSA-PSS). (In fact, the SSA in | Probabilistic Signature Scheme (RSASSA-PSS). (In fact, the SSA in | |||
RSASSA-PSS stands for Signature Scheme with Appendix.) | RSASSA-PSS stands for Signature Scheme with Appendix.) | |||
The signature functions for this scheme are: | The signature functions for this scheme are: | |||
skipping to change at page 38, line 31 ¶ | skipping to change at page 39, line 34 ¶ | |||
valid, message content = Verification(message sent, key, signature) | valid, message content = Verification(message sent, key, signature) | |||
Signature algorithms are used with the COSE_Signature and COSE_Sign1 | Signature algorithms are used with the COSE_Signature and COSE_Sign1 | |||
structures. At this time, only signatures with appendixes are | structures. At this time, only signatures with appendixes are | |||
defined for use with COSE; however, considerable interest has been | defined for use with COSE; however, considerable interest has been | |||
expressed in using a signature with message recovery algorithm due to | expressed in using a signature with message recovery algorithm due to | |||
the effective size reduction that is possible. Implementations will | the effective size reduction that is possible. Implementations will | |||
need to keep this in mind for later possible integration. | need to keep this in mind for later possible integration. | |||
9. Message Authentication Code (MAC) Algorithms | 10. Message Authentication Code (MAC) Algorithms | |||
Message Authentication Codes (MACs) provide data authentication and | Message Authentication Codes (MACs) provide data authentication and | |||
integrity protection. They provide either no or very limited data | integrity protection. They provide either no or very limited data | |||
origination. A MAC, for example, cannot be used to prove the | origination. A MAC, for example, cannot be used to prove the | |||
identity of the sender to a third party. | identity of the sender to a third party. | |||
MACs use the same scheme as signature with appendix algorithms. The | MACs use the same scheme as signature with appendix algorithms. The | |||
message content is processed and an authentication code is produced. | message content is processed and an authentication code is produced. | |||
The authentication code is frequently called a tag. | The authentication code is frequently called a tag. | |||
skipping to change at page 38, line 47 ¶ | skipping to change at page 40, line 4 ¶ | |||
MACs use the same scheme as signature with appendix algorithms. The | MACs use the same scheme as signature with appendix algorithms. The | |||
message content is processed and an authentication code is produced. | message content is processed and an authentication code is produced. | |||
The authentication code is frequently called a tag. | The authentication code is frequently called a tag. | |||
The MAC functions are: | The MAC functions are: | |||
tag = MAC_Create(message content, key) | tag = MAC_Create(message content, key) | |||
valid = MAC_Verify(message content, key, tag) | valid = MAC_Verify(message content, key, tag) | |||
MAC algorithms can be based on either a block cipher algorithm (i.e., | MAC algorithms can be based on either a block cipher algorithm (i.e., | |||
AES-MAC) or a hash algorithm (i.e., a Hash-based Message | AES-MAC) or a hash algorithm (i.e., a Hash-based Message | |||
Authentication Code (HMAC)). This document defines a MAC algorithm | Authentication Code (HMAC)). This document defines a MAC algorithm | |||
using each of these constructions. | using each of these constructions. | |||
MAC algorithms are used in the COSE_Mac and COSE_Mac0 structures. | MAC algorithms are used in the COSE_Mac and COSE_Mac0 structures. | |||
10. Content Encryption Algorithms | 11. Content Encryption Algorithms | |||
Content encryption algorithms provide data confidentiality for | Content encryption algorithms provide data confidentiality for | |||
potentially large blocks of data using a symmetric key. They provide | potentially large blocks of data using a symmetric key. They provide | |||
integrity on the data that was encrypted; however, they provide | integrity on the data that was encrypted; however, they provide | |||
either no or very limited data origination. (One cannot, for | either no or very limited data origination. (One cannot, for | |||
example, be used to prove the identity of the sender to a third | example, be used to prove the identity of the sender to a third | |||
party.) The ability to provide data origination is linked to how the | party.) The ability to provide data origination is linked to how the | |||
CEK is obtained. | CEK is obtained. | |||
COSE restricts the set of legal content encryption algorithms to | COSE restricts the set of legal content encryption algorithms to | |||
skipping to change at page 39, line 36 ¶ | skipping to change at page 40, line 40 ¶ | |||
valid, message content = Decrypt(ciphertext, key, additional data) | valid, message content = Decrypt(ciphertext, key, additional data) | |||
Most AEAD algorithms are logically defined as returning the message | Most AEAD algorithms are logically defined as returning the message | |||
content only if the decryption is valid. Many but not all | content only if the decryption is valid. Many but not all | |||
implementations will follow this convention. The message content | implementations will follow this convention. The message content | |||
MUST NOT be used if the decryption does not validate. | MUST NOT be used if the decryption does not validate. | |||
These algorithms are used in COSE_Encrypt and COSE_Encrypt0. | These algorithms are used in COSE_Encrypt and COSE_Encrypt0. | |||
11. Key Derivation Functions (KDFs) | 12. Key Derivation Functions (KDFs) | |||
KDFs are used to take some secret value and generate a different one. | KDFs are used to take some secret value and generate a different one. | |||
The secret value comes in three flavors: | The secret value comes in three flavors: | |||
o Secrets that are uniformly random: This is the type of secret that | o Secrets that are uniformly random: This is the type of secret that | |||
is created by a good random number generator. | is created by a good random number generator. | |||
o Secrets that are not uniformly random: This is type of secret that | o Secrets that are not uniformly random: This is type of secret that | |||
is created by operations like key agreement. | is created by operations like key agreement. | |||
o Secrets that are not random: This is the type of secret that | o Secrets that are not random: This is the type of secret that | |||
people generate for things like passwords. | people generate for things like passwords. | |||
General KDFs work well with the first type of secret, can do | General KDFs work well with the first type of secret, can do | |||
reasonably well with the second type of secret, and generally do | reasonably well with the second type of secret, and generally do | |||
poorly with the last type of secret. Functions like PBES2 [RFC8018] | poorly with the last type of secret. Functions like PBES2 [RFC8018] | |||
need to be used for non-random secrets. | need to be used for non-random secrets. | |||
The same KDF can be set up to deal with the first two types of | The same KDF can be set up to deal with the first two types of | |||
secrets in a different way. The KDF defined in !!! HDKF !!! (section | secrets in a different way. The KDF defined in section 5.1 of | |||
XXXX of [I-D.ietf-cose-rfc8152bis-algs]) is such a function. This is | [I-D.ietf-cose-rfc8152bis-algs] is such a function. This is | |||
reflected in the set of algorithms defined around the HMAC-based | reflected in the set of algorithms defined around the HMAC-based | |||
Extract-and-Expand Key Derivation Function (HKDF). | Extract-and-Expand Key Derivation Function (HKDF). | |||
When using KDFs, one component that is included is context | When using KDFs, one component that is included is context | |||
information. Context information is used to allow for different | information. Context information is used to allow for different | |||
keying information to be derived from the same secret. The use of | keying information to be derived from the same secret. The use of | |||
context-based keying material is considered to be a good security | context-based keying material is considered to be a good security | |||
practice. | practice. | |||
12. Content Key Distribution Methods | 13. Content Key Distribution Methods | |||
Content key distribution methods (recipient algorithms) can be | Content key distribution methods (recipient algorithms) can be | |||
defined into a number of different classes. COSE has the ability to | defined into a number of different classes. COSE has the ability to | |||
support many classes of recipient algorithms. In this section, a | support many classes of recipient algorithms. In this section, a | |||
number of classes are listed. The names of the recipient algorithm | number of classes are listed. The names of the recipient algorithm | |||
classes used here are the same as those defined in [RFC7516]. Other | classes used here are the same as those defined in [RFC7516]. Other | |||
specifications use different terms for the recipient algorithm | specifications use different terms for the recipient algorithm | |||
classes or do not support some of the recipient algorithm classes. | classes or do not support some of the recipient algorithm classes. | |||
12.1. Direct Encryption | 13.1. Direct Encryption | |||
The direct encryption class algorithms share a secret between the | The direct encryption class algorithms share a secret between the | |||
sender and the recipient that is used either directly or after | sender and the recipient that is used either directly or after | |||
manipulation as the CEK. When direct encryption mode is used, it | manipulation as the CEK. When direct encryption mode is used, it | |||
MUST be the only mode used on the message. | MUST be the only mode used on the message. | |||
The COSE_Recipient structure for the recipient is organized as | The COSE_Recipient structure for the recipient is organized as | |||
follows: | follows: | |||
o The 'protected' field MUST be a zero-length item unless it is used | o The 'protected' field MUST be a zero-length item unless it is used | |||
in the computation of the content key. | in the computation of the content key. | |||
o The 'alg' parameter MUST be present. | o The 'alg' parameter MUST be present. | |||
o A parameter identifying the shared secret SHOULD be present. | o A parameter identifying the shared secret SHOULD be present. | |||
o The 'ciphertext' field MUST be a zero-length item. | o The 'ciphertext' field MUST be a zero-length item. | |||
o The 'recipients' field MUST be absent. | o The 'recipients' field MUST be absent. | |||
12.2. Key Wrap | 13.2. Key Wrap | |||
In key wrap mode, the CEK is randomly generated and that key is then | In key wrap mode, the CEK is randomly generated and that key is then | |||
encrypted by a shared secret between the sender and the recipient. | encrypted by a shared secret between the sender and the recipient. | |||
All of the currently defined key wrap algorithms for COSE are AE | All of the currently defined key wrap algorithms for COSE are AE | |||
algorithms. Key wrap mode is considered to be superior to direct | algorithms. Key wrap mode is considered to be superior to direct | |||
encryption if the system has any capability for doing random key | encryption if the system has any capability for doing random key | |||
generation. This is because the shared key is used to wrap random | generation. This is because the shared key is used to wrap random | |||
data rather than data that has some degree of organization and may in | data rather than data that has some degree of organization and may in | |||
fact be repeating the same content. The use of key wrap loses the | fact be repeating the same content. The use of key wrap loses the | |||
weak data origination that is provided by the direct encryption | weak data origination that is provided by the direct encryption | |||
skipping to change at page 41, line 36 ¶ | skipping to change at page 42, line 38 ¶ | |||
recipient is an acceptable way of dealing with it. Failing to | recipient is an acceptable way of dealing with it. Failing to | |||
process the message is not an acceptable way of dealing with it. | process the message is not an acceptable way of dealing with it. | |||
o The plaintext to be encrypted is the key from next layer down | o The plaintext to be encrypted is the key from next layer down | |||
(usually the content layer). | (usually the content layer). | |||
o At a minimum, the 'unprotected' field MUST contain the 'alg' | o At a minimum, the 'unprotected' field MUST contain the 'alg' | |||
parameter and SHOULD contain a parameter identifying the shared | parameter and SHOULD contain a parameter identifying the shared | |||
secret. | secret. | |||
12.3. Key Transport | 13.3. Key Transport | |||
Key transport mode is also called key encryption mode in some | Key transport mode is also called key encryption mode in some | |||
standards. Key transport mode differs from key wrap mode in that it | standards. Key transport mode differs from key wrap mode in that it | |||
uses an asymmetric encryption algorithm rather than a symmetric | uses an asymmetric encryption algorithm rather than a symmetric | |||
encryption algorithm to protect the key. A set of key transport | encryption algorithm to protect the key. A set of key transport | |||
algorithms are defined in [RFC8230]. | algorithms are defined in [RFC8230]. | |||
When using a key transport algorithm, the COSE_Encrypt structure for | When using a key transport algorithm, the COSE_Encrypt structure for | |||
the recipient is organized as follows: | the recipient is organized as follows: | |||
o The 'protected' field MUST be absent. | o The 'protected' field MUST be absent. | |||
o The plaintext to be encrypted is the key from the next layer down | o The plaintext to be encrypted is the key from the next layer down | |||
(usually the content layer). | (usually the content layer). | |||
o At a minimum, the 'unprotected' field MUST contain the 'alg' | o At a minimum, the 'unprotected' field MUST contain the 'alg' | |||
parameter and SHOULD contain a parameter identifying the | parameter and SHOULD contain a parameter identifying the | |||
asymmetric key. | asymmetric key. | |||
12.4. Direct Key Agreement | 13.4. Direct Key Agreement | |||
The 'direct key agreement' class of recipient algorithms uses a key | The 'direct key agreement' class of recipient algorithms uses a key | |||
agreement method to create a shared secret. A KDF is then applied to | agreement method to create a shared secret. A KDF is then applied to | |||
the shared secret to derive a key to be used in protecting the data. | the shared secret to derive a key to be used in protecting the data. | |||
This key is normally used as a CEK or MAC key, but could be used for | This key is normally used as a CEK or MAC key, but could be used for | |||
other purposes if more than two layers are in use (see Appendix B). | other purposes if more than two layers are in use (see Appendix B). | |||
The most commonly used key agreement algorithm is Diffie-Hellman, but | The most commonly used key agreement algorithm is Diffie-Hellman, but | |||
other variants exist. Since COSE is designed for a store and forward | other variants exist. Since COSE is designed for a store and forward | |||
environment rather than an online environment, many of the DH | environment rather than an online environment, many of the DH | |||
skipping to change at page 43, line 5 ¶ | skipping to change at page 44, line 5 ¶ | |||
The COSE_Encrypt structure for the recipient is organized as follows: | The COSE_Encrypt structure for the recipient is organized as follows: | |||
o At a minimum, headers MUST contain the 'alg' parameter and SHOULD | o At a minimum, headers MUST contain the 'alg' parameter and SHOULD | |||
contain a parameter identifying the recipient's asymmetric key. | contain a parameter identifying the recipient's asymmetric key. | |||
o The headers SHOULD identify the sender's key for the static-static | o The headers SHOULD identify the sender's key for the static-static | |||
versions and MUST contain the sender's ephemeral key for the | versions and MUST contain the sender's ephemeral key for the | |||
ephemeral-static versions. | ephemeral-static versions. | |||
12.5. Key Agreement with Key Wrap | 13.5. Key Agreement with Key Wrap | |||
Key Agreement with Key Wrap uses a randomly generated CEK. The CEK | Key Agreement with Key Wrap uses a randomly generated CEK. The CEK | |||
is then encrypted using a key wrap algorithm and a key derived from | is then encrypted using a key wrap algorithm and a key derived from | |||
the shared secret computed by the key agreement algorithm. The | the shared secret computed by the key agreement algorithm. The | |||
function for this would be: | function for this would be: | |||
encryptedKey = KeyWrap(KDF(DH-Shared, context), CEK) | encryptedKey = KeyWrap(KDF(DH-Shared, context), CEK) | |||
The COSE_Encrypt structure for the recipient is organized as follows: | The COSE_Encrypt structure for the recipient is organized as follows: | |||
o The 'protected' field is fed into the KDF context structure. | o The 'protected' field is fed into the KDF context structure. | |||
o The plaintext to be encrypted is the key from the next layer down | o The plaintext to be encrypted is the key from the next layer down | |||
(usually the content layer). | (usually the content layer). | |||
o The 'alg' parameter MUST be present in the layer. | o The 'alg' parameter MUST be present in the layer. | |||
o A parameter identifying the recipient's key SHOULD be present. A | o A parameter identifying the recipient's key SHOULD be present. A | |||
parameter identifying the sender's key SHOULD be present. | parameter identifying the sender's key SHOULD be present. | |||
13. CBOR Encoder Restrictions | 14. CBOR Encoding Restrictions | |||
There has been an attempt to limit the number of places where the | There has been an attempt to limit the number of places where the | |||
document needs to impose restrictions on how the CBOR Encoder needs | document needs to impose restrictions on how the CBOR Encoder needs | |||
to work. We have managed to narrow it down to the following | to work. We have managed to narrow it down to the following | |||
restrictions: | restrictions: | |||
o The restriction applies to the encoding of the COSE_KDF_Context, | o The restriction applies to the encoding of the Sig_structure, the | |||
the Sig_structure, the Enc_structure, and the MAC_structure. | Enc_structure, and the MAC_structure. | |||
o The rules for "Canonical CBOR" (Section 3.9 of RFC 7049) MUST be | o Encoding MUST be done using definite lengths and the length of the | |||
used in these locations. The main rule that needs to be enforced | MUST be the minimum possible length. This means that the integer | |||
is that all lengths in these structures MUST be encoded such that | 1 is encoded as "0x01" and not "0x1801". | |||
they are using definite lengths, and the minimum length encoding | ||||
is used. | ||||
o Applications MUST NOT generate messages with the same label used | o Applications MUST NOT generate messages with the same label used | |||
twice as a key in a single map. Applications MUST NOT parse and | twice as a key in a single map. Applications MUST NOT parse and | |||
process messages with the same label used twice as a key in a | process messages with the same label used twice as a key in a | |||
single map. Applications can enforce the parse and process | single map. Applications can enforce the parse and process | |||
requirement by using parsers that will fail the parse step or by | requirement by using parsers that will fail the parse step or by | |||
using parsers that will pass all keys to the application, and the | using parsers that will pass all keys to the application, and the | |||
application can perform the check for duplicate keys. | application can perform the check for duplicate keys. | |||
14. Application Profiling Considerations | 15. Application Profiling Considerations | |||
This document is designed to provide a set of security services, but | This document is designed to provide a set of security services, but | |||
not impose algorithm implementation requirements for specific usage. | not impose algorithm implementation requirements for specific usage. | |||
The interoperability requirements are provided for how each of the | The interoperability requirements are provided for how each of the | |||
individual services are used and how the algorithms are to be used | individual services are used and how the algorithms are to be used | |||
for interoperability. The requirements about which algorithms and | for interoperability. The requirements about which algorithms and | |||
which services are needed are deferred to each application. | which services are needed are deferred to each application. | |||
An example of a profile can be found in | An example of a profile can be found in | |||
[I-D.ietf-core-object-security] where a profiles was developed for | [I-D.ietf-core-object-security] where a profiles was developed for | |||
skipping to change at page 45, line 22 ¶ | skipping to change at page 46, line 16 ¶ | |||
* Advertising in the message (S/MIME capabilities) [RFC5751]. | * Advertising in the message (S/MIME capabilities) [RFC5751]. | |||
* Advertising in the certificate (capabilities extension) | * Advertising in the certificate (capabilities extension) | |||
[RFC4262]. | [RFC4262]. | |||
* Minimum requirements for the S/MIME, which have been updated | * Minimum requirements for the S/MIME, which have been updated | |||
over time [RFC2633] [RFC5751] (note that [RFC2633] has been | over time [RFC2633] [RFC5751] (note that [RFC2633] has been | |||
obsoleted by [RFC5751]). | obsoleted by [RFC5751]). | |||
15. IANA Considerations | 16. IANA Considerations | |||
The registeries and registrations listed below were created during | The registeries and registrations listed below were created during | |||
processing of RFC 8152 [RFC8152]. The only known action at this time | processing of RFC 8152 [RFC8152]. The only known action at this time | |||
is to update the references. | is to update the references. | |||
15.1. CBOR Tag Assignment | 16.1. CBOR Tag Assignment | |||
IANA assigned tags in the "CBOR Tags" registry as part of processing | IANA assigned tags in the "CBOR Tags" registry as part of processing | |||
[RFC8152]. IANA is requested to update the references from [RFC8152] | [RFC8152]. IANA is requested to update the references from [RFC8152] | |||
to this document. | to this document. | |||
15.2. COSE Header Parameters Registry | IANA is requested to register a new tag for the CounterSignature | |||
type. | ||||
Tag: TBD0 | ||||
Data Item: COSE_Signature | ||||
Semantics: COSE standalone counter signature | ||||
Reference: [[this document]] | ||||
16.2. COSE Header Parameters Registry | ||||
IANA created a registry titled "COSE Header Parameters" as part of | IANA created a registry titled "COSE Header Parameters" as part of | |||
processing [RFC8152]. The registry has been created to use the | processing [RFC8152]. The registry has been created to use the | |||
"Expert Review Required" registration procedure [RFC8126]. | "Expert Review Required" registration procedure [RFC8126]. | |||
IANA is requested to update the reference for entries in the table | IANA is requested to update the reference for entries in the table | |||
from [RFC8152] to this document. This document does not update the | from [RFC8152] to this document. This document does not update the | |||
expert review guidelines provided in [RFC8152]. | expert review guidelines provided in [RFC8152]. | |||
15.3. COSE Header Algorithm Parameters Registry | 16.3. COSE Header Algorithm Parameters Registry | |||
IANA created a registry titled "COSE Header Algorithm Parameters" as | IANA created a registry titled "COSE Header Algorithm Parameters" as | |||
part of processing [RFC8152]. The registry has been created to use | part of processing [RFC8152]. The registry has been created to use | |||
the "Expert Review Required" registration procedure [RFC8126]. | the "Expert Review Required" registration procedure [RFC8126]. | |||
IANA is requested to update the references from [RFC8152] to this | IANA is requested to update the references from [RFC8152] to this | |||
document. This document does not update the expert review guidelines | document. This document does not update the expert review guidelines | |||
provided in [RFC8152]. | provided in [RFC8152]. | |||
15.4. COSE Key Common Parameters Registry | 16.4. COSE Key Common Parameters Registry | |||
IANA created a registry titled "COSE Key Common Parameters" as part | IANA created a registry titled "COSE Key Common Parameters" as part | |||
of the processing of [RFC8152]. The registry has been created to use | of the processing of [RFC8152]. The registry has been created to use | |||
the "Expert Review Required" registration procedure [RFC8126]. | the "Expert Review Required" registration procedure [RFC8126]. | |||
IANA is requested to update the reference for entries in the table | IANA is requested to update the reference for entries in the table | |||
from [RFC8152] to this document. This document does not update the | from [RFC8152] to this document. This document does not update the | |||
expert review guidelines provided in [RFC8152]. | expert review guidelines provided in [RFC8152]. | |||
15.5. Media Type Registrations | 16.5. Media Type Registrations | |||
15.5.1. COSE Security Message | 16.5.1. COSE Security Message | |||
This section registers the 'application/cose' media type in the | This section registers the 'application/cose' media type in the | |||
"Media Types" registry. These media types are used to indicate that | "Media Types" registry. These media types are used to indicate that | |||
the content is a COSE message. | the content is a COSE message. | |||
Type name: application | Type name: application | |||
Subtype name: cose | Subtype name: cose | |||
Required parameters: N/A | Required parameters: N/A | |||
Optional parameters: cose-type | Optional parameters: cose-type | |||
Encoding considerations: binary | Encoding considerations: binary | |||
Security considerations: See the Security Considerations section | Security considerations: See the Security Considerations section | |||
of [[This Document]]. | of [[This Document]]. | |||
Interoperability considerations: N/A | Interoperability considerations: N/A | |||
Published specification: RFC 8152 | Published specification: [[this document]] | |||
Applications that use this media type: IoT applications sending | Applications that use this media type: IoT applications sending | |||
security content over HTTP(S) transports. | security content over HTTP(S) transports. | |||
Fragment identifier considerations: N/A | Fragment identifier considerations: N/A | |||
Additional information: | Additional information: | |||
* Deprecated alias names for this type: N/A | * Deprecated alias names for this type: N/A | |||
skipping to change at page 47, line 19 ¶ | skipping to change at page 48, line 30 ¶ | |||
Intended usage: COMMON | Intended usage: COMMON | |||
Restrictions on usage: N/A | Restrictions on usage: N/A | |||
Author: Jim Schaad, ietf@augustcellars.com | Author: Jim Schaad, ietf@augustcellars.com | |||
Change Controller: IESG | Change Controller: IESG | |||
Provisional registration? No | Provisional registration? No | |||
15.5.2. COSE Key Media Type | 16.5.2. COSE Key Media Type | |||
This section registers the 'application/cose-key' and 'application/ | This section registers the 'application/cose-key' and 'application/ | |||
cose-key-set' media types in the "Media Types" registry. These media | cose-key-set' media types in the "Media Types" registry. These media | |||
types are used to indicate, respectively, that content is a COSE_Key | types are used to indicate, respectively, that content is a COSE_Key | |||
or COSE_KeySet object. | or COSE_KeySet object. | |||
The template for registering 'application/cose-key' is: | The template for registering 'application/cose-key' is: | |||
Type name: application | Type name: application | |||
skipping to change at page 47, line 42 ¶ | skipping to change at page 49, line 4 ¶ | |||
Required parameters: N/A | Required parameters: N/A | |||
Optional parameters: N/A | Optional parameters: N/A | |||
Encoding considerations: binary | Encoding considerations: binary | |||
Security considerations: See the Security Considerations section | Security considerations: See the Security Considerations section | |||
of [[This Document]]. | of [[This Document]]. | |||
Interoperability considerations: N/A | Interoperability considerations: N/A | |||
Published specification: [[this document]] | ||||
Published specification: RFC 8152 | ||||
Applications that use this media type: Distribution of COSE based | Applications that use this media type: Distribution of COSE based | |||
keys for IoT applications. | keys for IoT applications. | |||
Fragment identifier considerations: N/A | Fragment identifier considerations: N/A | |||
Additional information: | Additional information: | |||
* Deprecated alias names for this type: N/A | * Deprecated alias names for this type: N/A | |||
skipping to change at page 48, line 43 ¶ | skipping to change at page 49, line 51 ¶ | |||
Optional parameters: N/A | Optional parameters: N/A | |||
Encoding considerations: binary | Encoding considerations: binary | |||
Security considerations: See the Security Considerations section | Security considerations: See the Security Considerations section | |||
of [[This Document]]. | of [[This Document]]. | |||
Interoperability considerations: N/A | Interoperability considerations: N/A | |||
Published specification: RFC 8152 | Published specification: [[this document]] | |||
Applications that use this media type: Distribution of COSE based | Applications that use this media type: Distribution of COSE based | |||
keys for IoT applications. | keys for IoT applications. | |||
Fragment identifier considerations: N/A | Fragment identifier considerations: N/A | |||
Additional information: | Additional information: | |||
* Deprecated alias names for this type: N/A | * Deprecated alias names for this type: N/A | |||
* Magic number(s): N/A | * Magic number(s): N/A | |||
* File extension(s): cbor | * File extension(s): cbor | |||
* Macintosh file type code(s): N/A | * Macintosh file type code(s): N/A | |||
Person & email address to contact for further information: | Person & email address to contact for further information: | |||
iesg@ietf.org | iesg@ietf.org | |||
Intended usage: COMMON | Intended usage: COMMON | |||
skipping to change at page 49, line 23 ¶ | skipping to change at page 50, line 32 ¶ | |||
Intended usage: COMMON | Intended usage: COMMON | |||
Restrictions on usage: N/A | Restrictions on usage: N/A | |||
Author: Jim Schaad, ietf@augustcellars.com | Author: Jim Schaad, ietf@augustcellars.com | |||
Change Controller: IESG | Change Controller: IESG | |||
Provisional registration? No | Provisional registration? No | |||
15.6. CoAP Content-Formats Registry | 16.6. CoAP Content-Formats Registry | |||
IANA added the following entries to the "CoAP Content-Formats" | IANA added the following entries to the "CoAP Content-Formats" | |||
registry while processing [RFC8152]. IANA is requested to update the | registry while processing [RFC8152]. IANA is requested to update the | |||
reference value from [RFC8152] to [[This Document]]. | reference value from [RFC8152] to [[This Document]]. | |||
15.7. Expert Review Instructions | 17. Security Considerations | |||
All of the IANA registries established in this document are defined | ||||
as expert review. This section gives some general guidelines for | ||||
what the experts should be looking for, but they are being designated | ||||
as experts for a reason, so they should be given substantial | ||||
latitude. | ||||
Expert reviewers should take into consideration the following points: | ||||
o Point squatting should be discouraged. Reviewers are encouraged | ||||
to get sufficient information for registration requests to ensure | ||||
that the usage is not going to duplicate one that is already | ||||
registered, and that the point is likely to be used in | ||||
deployments. The zones tagged as private use are intended for | ||||
testing purposes and closed environments; code points in other | ||||
ranges should not be assigned for testing. | ||||
o Specifications are required for the standards track range of point | ||||
assignment. Specifications should exist for specification | ||||
required ranges, but early assignment before a specification is | ||||
available is considered to be permissible. Specifications are | ||||
needed for the first-come, first-serve range if they are expected | ||||
to be used outside of closed environments in an interoperable way. | ||||
When specifications are not provided, the description provided | ||||
needs to have sufficient information to identify what the point is | ||||
being used for. | ||||
o Experts should take into account the expected usage of fields when | ||||
approving point assignment. The fact that there is a range for | ||||
standards track documents does not mean that a standards track | ||||
document cannot have points assigned outside of that range. The | ||||
length of the encoded value should be weighed against how many | ||||
code points of that length are left, the size of device it will be | ||||
used on, and the number of code points left that encode to that | ||||
size. | ||||
o When algorithms are registered, vanity registrations should be | ||||
discouraged. One way to do this is to require registrations to | ||||
provide additional documentation on security analysis of the | ||||
algorithm. Another thing that should be considered is requesting | ||||
an opinion on the algorithm from the Crypto Forum Research Group | ||||
(CFRG). Algorithms that do not meet the security requirements of | ||||
the community and the messages structures should not be | ||||
registered. | ||||
16. Security Considerations | ||||
There are a number of security considerations that need to be taken | There are a number of security considerations that need to be taken | |||
into account by implementers of this specification. The security | into account by implementers of this specification. The security | |||
considerations that are specific to an individual algorithm are | considerations that are specific to an individual algorithm are | |||
placed next to the description of the algorithm. While some | placed next to the description of the algorithm. While some | |||
considerations have been highlighted here, additional considerations | considerations have been highlighted here, additional considerations | |||
may be found in the documents listed in the references. | may be found in the documents listed in the references. | |||
Implementations need to protect the private key material for any | Implementations need to protect the private key material for any | |||
individuals. There are some cases in this document that need to be | individuals. There are some cases in this document that need to be | |||
skipping to change at page 52, line 24 ¶ | skipping to change at page 52, line 35 ¶ | |||
analysis of encrypted messages based on the length of the message. | analysis of encrypted messages based on the length of the message. | |||
This specification does not provide for a uniform method of providing | This specification does not provide for a uniform method of providing | |||
padding as part of the message structure. An observer can | padding as part of the message structure. An observer can | |||
distinguish between two different strings (for example, 'YES' and | distinguish between two different strings (for example, 'YES' and | |||
'NO') based on the length for all of the content encryption | 'NO') based on the length for all of the content encryption | |||
algorithms that are defined in this document. This means that it is | algorithms that are defined in this document. This means that it is | |||
up to the applications to document how content padding is to be done | up to the applications to document how content padding is to be done | |||
in order to prevent or discourage such analysis. (For example, the | in order to prevent or discourage such analysis. (For example, the | |||
strings could be defined as 'YES' and 'NO '.) | strings could be defined as 'YES' and 'NO '.) | |||
17. Implementation Status | 18. Implementation Status | |||
This section records the status of known implementations of the | This section records the status of known implementations of the | |||
protocol defined by this specification at the time of posting of this | protocol defined by this specification at the time of posting of this | |||
Internet-Draft, and is based on a proposal described in [RFC7942]. | Internet-Draft, and is based on a proposal described in [RFC7942]. | |||
The description of implementations in this section is intended to | The description of implementations in this section is intended to | |||
assist the IETF in its decision processes in progressing drafts to | assist the IETF in its decision processes in progressing drafts to | |||
RFCs. Please note that the listing of any individual implementation | RFCs. Please note that the listing of any individual implementation | |||
here does not imply endorsement by the IETF. Furthermore, no effort | here does not imply endorsement by the IETF. Furthermore, no effort | |||
has been spent to verify the information presented here that was | has been spent to verify the information presented here that was | |||
supplied by IETF contributors. This is not intended as, and must not | supplied by IETF contributors. This is not intended as, and must not | |||
skipping to change at page 52, line 46 ¶ | skipping to change at page 53, line 9 ¶ | |||
features. Readers are advised to note that other implementations may | features. Readers are advised to note that other implementations may | |||
exist. | exist. | |||
According to [RFC7942], "this will allow reviewers and working groups | According to [RFC7942], "this will allow reviewers and working groups | |||
to assign due consideration to documents that have the benefit of | to assign due consideration to documents that have the benefit of | |||
running code, which may serve as evidence of valuable experimentation | running code, which may serve as evidence of valuable experimentation | |||
and feedback that have made the implemented protocols more mature. | and feedback that have made the implemented protocols more mature. | |||
It is up to the individual working groups to use this information as | It is up to the individual working groups to use this information as | |||
they see fit". | they see fit". | |||
17.1. Author's Versions | 18.1. Author's Versions | |||
There are three different implementations that have been created by | There are three different implementations that have been created by | |||
the author of the document both to create the examples that are | the author of the document both to create the examples that are | |||
included in the document and to validate the structures and | included in the document and to validate the structures and | |||
methodology used in the design of COSE. | methodology used in the design of COSE. | |||
Implementation Location: https://github.com/cose-wg | Implementation Location: https://github.com/cose-wg | |||
Primary Maintainer: Jim Schaad | Primary Maintainer: Jim Schaad | |||
skipping to change at page 53, line 34 ¶ | skipping to change at page 53, line 45 ¶ | |||
libraries. All three libraries have tests to allow for the | libraries. All three libraries have tests to allow for the | |||
creating of the same messages that are in the example library | creating of the same messages that are in the example library | |||
followed by validating them. These are not compared against the | followed by validating them. These are not compared against the | |||
example library. The Java and C# libraries have unit testing | example library. The Java and C# libraries have unit testing | |||
included. Not all of the MUST statements in the document have | included. Not all of the MUST statements in the document have | |||
been implemented as part of the libraries. One such statement is | been implemented as part of the libraries. One such statement is | |||
the requirement that unique labels be present. | the requirement that unique labels be present. | |||
Licensing: Revised BSD License | Licensing: Revised BSD License | |||
17.2. Java Script Version | 18.2. Java Script Version | |||
Implementation Location: https://github.com/erdtman/cose-js | Implementation Location: https://github.com/erdtman/cose-js | |||
Primary Maintainer: Samuel Erdtman | Primary Maintainer: Samuel Erdtman | |||
Languages: JavaScript | Languages: JavaScript | |||
Cryptography: TBD | Cryptography: TBD | |||
Coverage: Full Encrypt, Signature and MAC objects are supported. | Coverage: Full Encrypt, Signature and MAC objects are supported. | |||
Testing: Basic testing against the common example library. | Testing: Basic testing against the common example library. | |||
Licensing: Apache License 2.0 | Licensing: Apache License 2.0 | |||
17.3. Python Version | 18.3. Python Version | |||
Implementation Location: https://github.com/TimothyClaeys/COSE- | Implementation Location: https://github.com/TimothyClaeys/COSE- | |||
PYTHON | PYTHON | |||
Primary Maintainer: Timothy Claeys | Primary Maintainer: Timothy Claeys | |||
Languages: Python | Languages: Python | |||
Cryptography: pyecdsak, crypto python libraries | Cryptography: pyecdsak, crypto python libraries | |||
Coverage: TBD | Coverage: TBD | |||
Testing: Basic testing plus running against the common example | Testing: Basic testing plus running against the common example | |||
library. | library. | |||
Licensing: BSD 3-Clause License | Licensing: BSD 3-Clause License | |||
17.4. COSE Testing Library | 18.4. COSE Testing Library | |||
Implementation Location: https://github.com/cose-wg/Examples | Implementation Location: https://github.com/cose-wg/Examples | |||
Primary Maintainer: Jim Schaad | Primary Maintainer: Jim Schaad | |||
Description: A set of tests for the COSE library is provided as | Description: A set of tests for the COSE library is provided as | |||
part of the implementation effort. Both success and fail tests | part of the implementation effort. Both success and fail tests | |||
have been provided. All of the examples in this document are part | have been provided. All of the examples in this document are part | |||
of this example set. | of this example set. | |||
Coverage: An attempt has been made to have test cases for every | Coverage: An attempt has been made to have test cases for every | |||
message type and algorithm in the document. Currently examples | message type and algorithm in the document. Currently examples | |||
dealing with counter signatures, and ECDH with Curve24459 and | dealing with counter signatures, and ECDH with Curve24459 and | |||
Goldilocks are missing. | Goldilocks are missing. | |||
Licensing: Public Domain | Licensing: Public Domain | |||
18. References | 19. References | |||
18.1. Normative References | 19.1. Normative References | |||
[COAP.Formats] | [COAP.Formats] | |||
IANA, "CoAP Content-Formats", | IANA, "CoAP Content-Formats", | |||
<https://www.iana.org/assignments/core-parameters/ | <https://www.iana.org/assignments/core-parameters/ | |||
core-parameters.xhtml#content-formats>. | core-parameters.xhtml#content-formats>. | |||
[COSE.Algorithms] | [COSE.Algorithms] | |||
IANA, "COSE Algorithms", | IANA, "COSE Algorithms", | |||
<https://www.iana.org/assignments/cose/ | <https://www.iana.org/assignments/cose/ | |||
cose.xhtml#algorithms>. | cose.xhtml#algorithms>. | |||
skipping to change at page 55, line 27 ¶ | skipping to change at page 55, line 36 ¶ | |||
<https://www.iana.org/assignments/cose/ | <https://www.iana.org/assignments/cose/ | |||
cose.xhtml#algorithms>. | cose.xhtml#algorithms>. | |||
[DSS] National Institute of Standards and Technology, "Digital | [DSS] National Institute of Standards and Technology, "Digital | |||
Signature Standard (DSS)", FIPS PUB 186-4, | Signature Standard (DSS)", FIPS PUB 186-4, | |||
DOI 10.6028/NIST.FIPS.186-4, July 2013, | DOI 10.6028/NIST.FIPS.186-4, July 2013, | |||
<http://nvlpubs.nist.gov/nistpubs/FIPS/ | <http://nvlpubs.nist.gov/nistpubs/FIPS/ | |||
NIST.FIPS.186-4.pdf>. | NIST.FIPS.186-4.pdf>. | |||
[I-D.ietf-cose-rfc8152bis-algs] | [I-D.ietf-cose-rfc8152bis-algs] | |||
Schaad, J., "CBOR Algorithms for Object Signing and | Schaad, J., "CBOR Object Signing and Encryption (COSE): | |||
Encryption (COSE)", draft-ietf-cose-rfc8152bis-algs-01 | Initial Algorithms", draft-ietf-cose-rfc8152bis-algs-02 | |||
(work in progress), February 2019. | (work in progress), March 2019. | |||
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
<https://www.rfc-editor.org/info/rfc2119>. | <https://www.rfc-editor.org/info/rfc2119>. | |||
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object | [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object | |||
Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, | Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, | |||
October 2013, <https://www.rfc-editor.org/info/rfc7049>. | October 2013, <https://www.rfc-editor.org/info/rfc7049>. | |||
[RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital | [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital | |||
Signature Algorithm (EdDSA)", RFC 8032, | Signature Algorithm (EdDSA)", RFC 8032, | |||
DOI 10.17487/RFC8032, January 2017, | DOI 10.17487/RFC8032, January 2017, | |||
<https://www.rfc-editor.org/info/rfc8032>. | <https://www.rfc-editor.org/info/rfc8032>. | |||
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | |||
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | |||
May 2017, <https://www.rfc-editor.org/info/rfc8174>. | May 2017, <https://www.rfc-editor.org/info/rfc8174>. | |||
18.2. Informative References | 19.2. Informative References | |||
[I-D.ietf-cbor-cddl] | [I-D.ietf-cbor-cddl] | |||
Birkholz, H., Vigano, C., and C. Bormann, "Concise data | Birkholz, H., Vigano, C., and C. Bormann, "Concise data | |||
definition language (CDDL): a notational convention to | definition language (CDDL): a notational convention to | |||
express CBOR and JSON data structures", draft-ietf-cbor- | express CBOR and JSON data structures", draft-ietf-cbor- | |||
cddl-07 (work in progress), February 2019. | cddl-08 (work in progress), March 2019. | |||
[I-D.ietf-core-object-security] | [I-D.ietf-core-object-security] | |||
Selander, G., Mattsson, J., Palombini, F., and L. Seitz, | Selander, G., Mattsson, J., Palombini, F., and L. Seitz, | |||
"Object Security for Constrained RESTful Environments | "Object Security for Constrained RESTful Environments | |||
(OSCORE)", draft-ietf-core-object-security-15 (work in | (OSCORE)", draft-ietf-core-object-security-16 (work in | |||
progress), August 2018. | progress), March 2019. | |||
[PVSig] Brown, D. and D. Johnson, "Formal Security Proofs for a | [PVSig] Brown, D. and D. Johnson, "Formal Security Proofs for a | |||
Signature Scheme with Partial Message Recovery", | Signature Scheme with Partial Message Recovery", | |||
DOI 10.1007/3-540-45353-9_11, LNCS Volume 2020, June 2000. | DOI 10.1007/3-540-45353-9_11, LNCS Volume 2020, June 2000. | |||
[RFC2633] Ramsdell, B., Ed., "S/MIME Version 3 Message | [RFC2633] Ramsdell, B., Ed., "S/MIME Version 3 Message | |||
Specification", RFC 2633, DOI 10.17487/RFC2633, June 1999, | Specification", RFC 2633, DOI 10.17487/RFC2633, June 1999, | |||
<https://www.rfc-editor.org/info/rfc2633>. | <https://www.rfc-editor.org/info/rfc2633>. | |||
[RFC4262] Santesson, S., "X.509 Certificate Extension for Secure/ | [RFC4262] Santesson, S., "X.509 Certificate Extension for Secure/ | |||
Multipurpose Internet Mail Extensions (S/MIME) | Multipurpose Internet Mail Extensions (S/MIME) | |||
Capabilities", RFC 4262, DOI 10.17487/RFC4262, December | Capabilities", RFC 4262, DOI 10.17487/RFC4262, December | |||
2005, <https://www.rfc-editor.org/info/rfc4262>. | 2005, <https://www.rfc-editor.org/info/rfc4262>. | |||
[RFC4949] Shirey, R., "Internet Security Glossary, Version 2", | [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", | |||
FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, | FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, | |||
<https://www.rfc-editor.org/info/rfc4949>. | <https://www.rfc-editor.org/info/rfc4949>. | |||
[RFC4998] Gondrom, T., Brandner, R., and U. Pordesch, "Evidence | ||||
Record Syntax (ERS)", RFC 4998, DOI 10.17487/RFC4998, | ||||
August 2007, <https://www.rfc-editor.org/info/rfc4998>. | ||||
[RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated | [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated | |||
Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, | Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, | |||
<https://www.rfc-editor.org/info/rfc5116>. | <https://www.rfc-editor.org/info/rfc5116>. | |||
[RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, | [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, | |||
RFC 5652, DOI 10.17487/RFC5652, September 2009, | RFC 5652, DOI 10.17487/RFC5652, September 2009, | |||
<https://www.rfc-editor.org/info/rfc5652>. | <https://www.rfc-editor.org/info/rfc5652>. | |||
[RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet | [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet | |||
Mail Extensions (S/MIME) Version 3.2 Message | Mail Extensions (S/MIME) Version 3.2 Message | |||
skipping to change at page 58, line 25 ¶ | skipping to change at page 58, line 35 ¶ | |||
Interchange Format", STD 90, RFC 8259, | Interchange Format", STD 90, RFC 8259, | |||
DOI 10.17487/RFC8259, December 2017, | DOI 10.17487/RFC8259, December 2017, | |||
<https://www.rfc-editor.org/info/rfc8259>. | <https://www.rfc-editor.org/info/rfc8259>. | |||
[W3C.WebCrypto] | [W3C.WebCrypto] | |||
Watson, M., "Web Cryptography API", W3C Recommendation, | Watson, M., "Web Cryptography API", W3C Recommendation, | |||
January 2017, <https://www.w3.org/TR/WebCryptoAPI/>. | January 2017, <https://www.w3.org/TR/WebCryptoAPI/>. | |||
Appendix A. Guidelines for External Data Authentication of Algorithms | Appendix A. Guidelines for External Data Authentication of Algorithms | |||
A portion of the working group has expressed a strong desire to relax | During development of COSE, the requirement that the algorithm | |||
the rule that the algorithm identifier be required to appear in each | identifier be located in the protected attributes was relaxed from a | |||
level of a COSE object. There are two basic reasons that have been | must to a should. There were two basic reasons that have been | |||
advanced to support this position. First, the resulting message will | advanced to support this position. First, the resulting message will | |||
be smaller if the algorithm identifier is omitted from the most | be smaller if the algorithm identifier is omitted from the most | |||
common messages in a CoAP environment. Second, there is a potential | common messages in a CoAP environment. Second, there is a potential | |||
bug that will arise if full checking is not done correctly between | bug that will arise if full checking is not done correctly between | |||
the different places that an algorithm identifier could be placed | the different places that an algorithm identifier could be placed | |||
(the message itself, an application statement, the key structure that | (the message itself, an application statement, the key structure that | |||
the sender possesses, and the key structure the recipient possesses). | the sender possesses, and the key structure the recipient possesses). | |||
This appendix lays out how such a change can be made and the details | This appendix lays out how such a change can be made and the details | |||
that an application needs to specify in order to use this option. | that an application needs to specify in order to use this option. | |||
Two different sets of details are specified: those needed to omit an | Two different sets of details are specified: those needed to omit an | |||
algorithm identifier and those needed to use a variant on the counter | algorithm identifier and those needed to use a variant on the counter | |||
signature attribute that contains no attributes about itself. | signature attribute that contains no attributes about itself. | |||
A.1. Algorithm Identification | Three sets of recommendations are laid out. The first set of | |||
recommendations apply to having an implicit algorithm identified for | ||||
In this section, three sets of recommendations are laid out. The | a single layer of a COSE object. The second set of recommendations | |||
first set of recommendations apply to having an implicit algorithm | apply to having multiple implicit algorithms identified for multiple | |||
identified for a single layer of a COSE object. The second set of | layers of a COSE object. The third set of recommendations apply to | |||
recommendations apply to having multiple implicit algorithms | having implicit algorithms for multiple COSE object constructs. | |||
identified for multiple layers of a COSE object. The third set of | ||||
recommendations apply to having implicit algorithms for multiple COSE | ||||
object constructs. | ||||
The key words from [RFC2119] are deliberately not used here. This | The key words from [RFC2119] are deliberately not used here. This | |||
specification can provide recommendations, but it cannot enforce | specification can provide recommendations, but it cannot enforce | |||
them. | them. | |||
This set of recommendations applies to the case where an application | This set of recommendations applies to the case where an application | |||
is distributing a fixed algorithm along with the key information for | is distributing a fixed algorithm along with the key information for | |||
use in a single COSE object. This normally applies to the smallest | use in a single COSE object. This normally applies to the smallest | |||
of the COSE objects, specifically COSE_Sign1, COSE_Mac0, and | of the COSE objects, specifically COSE_Sign1, COSE_Mac0, and | |||
COSE_Encrypt0, but could apply to the other structures as well. | COSE_Encrypt0, but could apply to the other structures as well. | |||
skipping to change at page 61, line 37 ¶ | skipping to change at page 61, line 44 ¶ | |||
different types of messages that have different keys, but where | different types of messages that have different keys, but where | |||
the keys may be used in a coordinated manner. | the keys may be used in a coordinated manner. | |||
For these cases, the following additional items need to be | For these cases, the following additional items need to be | |||
considered: | considered: | |||
o Applications need to ensure that the multiple contexts stay | o Applications need to ensure that the multiple contexts stay | |||
associated. If one of the contexts is invalidated for any reason, | associated. If one of the contexts is invalidated for any reason, | |||
all of the contexts associated with it should also be invalidated. | all of the contexts associated with it should also be invalidated. | |||
A.2. Counter Signature without Headers | ||||
There is a group of people who want to have a counter signature | ||||
parameter that is directly tied to the value being signed, and thus | ||||
the authenticated and unauthenticated buckets can be removed from the | ||||
message being sent. The focus on this is an even smaller size, as | ||||
all of the information on the process of creating the counter | ||||
signature is implicit rather than being explicitly carried in the | ||||
message. This includes not only the algorithm identifier as | ||||
presented above, but also items such as the key identification, which | ||||
is always external to the signature structure. This means that the | ||||
entities that are doing the validation of the counter signature are | ||||
required to infer which key is to be used from context rather than | ||||
being explicit. One way of doing this would be to presume that all | ||||
data coming from a specific port (or to a specific URL) is to be | ||||
validated by a specific key. (Note that this does not require that | ||||
the key identifier be part of the value signed as it does not serve a | ||||
cryptographic purpose. If the key validates the counter signature, | ||||
then it should be presumed that the entity associated with that key | ||||
produced the signature.) | ||||
When computing the signature for the bare counter signature header, | ||||
the same Sig_structure defined in Section 4.4 is used. The | ||||
sign_protected field is omitted, as there is no protected header | ||||
field in this counter signature header. The value of | ||||
"CounterSignature0" is placed in the context field of the | ||||
Sig_stucture. | ||||
+-------------------+-------+-------+-------+-----------------------+ | ||||
| Name | Label | Value | Value | Description | | ||||
| | | Type | | | | ||||
+-------------------+-------+-------+-------+-----------------------+ | ||||
| CounterSignature0 | 9 | bstr | | Counter signature | | ||||
| | | | | with implied signer | | ||||
| | | | | and headers | | ||||
+-------------------+-------+-------+-------+-----------------------+ | ||||
Table 6: Header Parameter for CounterSignature0 | ||||
Appendix B. Two Layers of Recipient Information | Appendix B. Two Layers of Recipient Information | |||
All of the currently defined recipient algorithm classes only use two | All of the currently defined recipient algorithm classes only use two | |||
layers of the COSE_Encrypt structure. The first layer is the message | layers of the COSE_Encrypt structure. The first layer is the message | |||
content, and the second layer is the content key encryption. | content, and the second layer is the content key encryption. | |||
However, if one uses a recipient algorithm such as the RSA Key | However, if one uses a recipient algorithm such as the RSA Key | |||
Encapsulation Mechanism (RSA-KEM) (see Appendix A of RSA-KEM | Encapsulation Mechanism (RSA-KEM) (see Appendix A of RSA-KEM | |||
[RFC5990]), then it makes sense to have three layers of the | [RFC5990]), then it makes sense to have three layers of the | |||
COSE_Encrypt structure. | COSE_Encrypt structure. | |||
These layers would be: | These layers would be: | |||
o Layer 0: The content encryption layer. This layer contains the | o Layer 0: The content encryption layer. This layer contains the | |||
payload of the message. | payload of the message. | |||
o Layer 1: The encryption of the CEK by a KEK. | o Layer 1: The encryption of the CEK by a KEK. | |||
End of changes. 109 change blocks. | ||||
322 lines changed or deleted | 315 lines changed or added | |||
This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |