Skip to content

Commit 3a76a22

Browse files
committed
draft cleanup for 120 submission
Signed-off-by: steve lasker <[email protected]>
1 parent d102df6 commit 3a76a22

File tree

1 file changed

+61
-56
lines changed

1 file changed

+61
-56
lines changed

draft-steele-cose-hash-envelope.md

Lines changed: 61 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,25 @@ author:
3737
country: Germany
3838

3939
normative:
40-
RFC9052: RFC9052
40+
RFC9596: RFC9596
4141
I-D.ietf-cose-typ-header-parameter: COSE-TYP
4242

4343
informative:
4444

4545
--- abstract
4646

47-
This document defines new COSE header parameters for signaling that a payload is the output of a hash function.
47+
This document defines new COSE header parameters for signaling a payload as an output of a hash function.
4848
This mechanism enables faster validation as access to the original payload is not required for signature validation.
49-
Additionally, hints of the detached payload's content format and availability are defined.
49+
Additionally, hints of the detached payload's content format and availability are defined providing optional discovery of the original payload content.
5050

5151
--- middle
5252

5353
# Introduction
5454

5555
COSE defined detached payloads in Section 2 of {{-RFC9052}}, using `nil` as the payload.
5656

57-
In order to verify a signature over a detached payload, the verifier must have access to the payload content. Storing a hash of the content allows for small signature envelopes, that are easy to transport and verify independently.
57+
In order to verify a signature over a detached payload, the verifier must have access to the payload content.
58+
Storing a hash of the content allows for small signature envelopes, that are easy to transport and verify independently.
5859

5960
Additional hints in the protected header ensure cryptographic agility for the hashing & signing algorithms, and discoverability for the original content which could be prohibitively large to move over a network.
6061

@@ -64,18 +65,18 @@ Additional hints in the protected header ensure cryptographic agility for the ha
6465

6566
# Header Parameters
6667

67-
To represent a hash of a detached payload, the following headers are defined:
68+
To represent a hash of a payload, the following headers are defined:
6869

69-
TBD 0:
70-
: will be assigned by {{-COSE-TYP}}, represents the content type of the code envelope, including the protected header and payload
70+
typ 16:
71+
: Assigned by {{-COSE-TYP}}, represents the content type of the code envelope, including the protected header and payload
7172

72-
TBD 1:
73+
TBD_1:
7374
: the hash algorithm used to generate the hash of the payload
7475

75-
TBD 2:
76+
TBD_2:
7677
: the content type of the payload the hash represents
7778

78-
TBD 3:
79+
TBD_3:
7980
: an identifier enabling a verifier to retrieve the full payload preimage.
8081

8182
## Signed Hash Envelopes Example
@@ -87,39 +88,28 @@ Hash_Envelope_Protected_Header = {
8788
? &(alg: 1) => int,
8889

8990
; Type of the envelope
90-
? &(typ: TBD_0) => int / tstr
91+
? &(typ: 16) => int / tstr
9192

9293
; Hash algorithm used to produce the payload from content
9394
; -16 for SHA-256,
9495
; See https://www.iana.org/assignments/cose/cose.xhtml
9596
&(payload_hash_alg: TBD_1) => int
9697

97-
; Content type of the preimage of the payload
98+
; Content type of the preimage (content to be hashed) of the payload
9899
; 50 for application/json,
99100
; See https://datatracker.ietf.org/doc/html/rfc7252#section-12.3
100101
&(payload_preimage_content_type: TBD_2) => int
101102

102-
; Identifier for an artifact repository
103+
; Location the content of the hashed payload is stored
103104
; For example:
104-
; pkg:container...image@sha256:244f...9c?repo..._url=dev.example
105-
? &(artifact_repository: TBD) => tstr
105+
; storage.example/244f...9c19
106+
? &(payload_location: TBD_3) => tstr
106107

107-
; Type of Verifiable Data Structure, e.g. RFC9162_SHA256
108-
; ? &(verifiable-data-structure: -111) => int,
109-
110-
; additional parameters allows.
111-
112-
}
113-
114-
Verifiable_Data_Proofs = {
115-
? &(inclusion-proofs: -1) => [ bstr .cbor inclusion-proof ]
116-
? &(consistency-proofs: -2) => [ bstr .cbor consistency-proof ]
117-
; ... other proofs are allowed here.
108+
* int => any
118109
}
119110

120111
Hash_Envelope_Unprotected_Header = {
121-
; ? &(verifiable-data-proofs: 222) => Verifiable_Data_Proofs
122-
; ... other unprotected header values are still allowed here.
112+
* int => any
123113
}
124114

125115
Hash_Envelope_as_COSE_Sign1 = [
@@ -134,31 +124,31 @@ Hash_Envelope = #6.18(Hash_Envelope_as_COSE_Sign1)
134124

135125
## Protected Header
136126

137-
TBD 0 (typ), TBD 1 (payload hash alg) and TBD 2 (content type of the preimage of the payload) MUST be present in the protected header and MUST NOT be present in the unprotected header.
127+
16 (typ), TBD_1 (payload hash alg) and TBD_2 (content type of the preimage of the payload) MUST be present in the protected header and MUST NOT be present in the unprotected header.
128+
TBD_3 (payload_location) MAY be added to the protected header and MUST NOT be presented in the unprotected header.
138129

139130
For example:
140131

141132
~~~~ cbor-diag
142133
{
143134
/ alg : ES384 / 1: -35,
144135
/ kid / 4: h'75726e3a...32636573',
145-
/ typ / TBD 0: application/hashed+cose
146-
/ payload_hash_alg sha-256 / TBD 1: 1
147-
/ payload_preimage_content_type / TBD 2: application/jwk+json
148-
/ artifact_repository / TBD 3 : \
149-
pkg:container/image@sha256:244f...?repository_url=dev.example
136+
/ typ / 16: application/hashed+cose
137+
/ payload_hash_alg sha-256 / TBD_1: 1
138+
/ payload_preimage_content_type / TBD_2: application/jwk+json
139+
/ payload_location / TBD_3 : storage.example/244f...9c19
150140
}
151141
~~~~
152142

153-
TBD 0 will be assigned by {{-COSE-TYP}}, it represents the content type of the code envelope, which includes the protected header and payload.
143+
{{-COSE-TYP}} represents the content type of the code envelope, which includes the protected header and payload.
154144

155-
TBD 1 will be assigned by this draft.
156-
TBD 2 will be assigned by this draft.
157-
TBD 3 will be assigned by this draft.
145+
TBD_1 will be assigned by this draft.
146+
TBD_2 will be assigned by this draft.
147+
TBD_3 will be assigned by this draft.
158148

159149
## Attached Payload
160150

161-
The payload MAY be attached.
151+
COSE_sign1 envelope with an attached payload, providing for signature validation.
162152

163153
~~~~ cbor-diag
164154
18( / COSE Sign 1 /
@@ -173,7 +163,7 @@ The payload MAY be attached.
173163

174164
## Detached Payload
175165

176-
The payload MAY be detached.
166+
COSE_sign1 detached payload (`nil`), which is compact, but the payload must be distributed out of band to validate the signature
177167

178168
~~~~ cbor-diag
179169
18( / COSE Sign 1 /
@@ -186,6 +176,21 @@ The payload MAY be detached.
186176
)
187177
~~~~
188178

179+
## Hashed Payload
180+
181+
A hashed payload functions equivalently to an attached payload, with the benefits of being compact in size and providing the ability to validate the signature.
182+
183+
~~~~ cbor-diag
184+
18( / COSE Sign 1 /
185+
[
186+
h'a4013822...3a616263', / Protected /
187+
{} / Unprotected /
188+
h'935b5a91...e18a588a', / Payload /
189+
h'15280897...93ef39e5' / Signature /
190+
]
191+
)
192+
~~~~
193+
189194
# Encrypted Hashes
190195

191196
Should we define this?
@@ -203,25 +208,25 @@ For example, when signing with ECDSA using P-256 and SHA-256, use SHA-256 to has
203208

204209
## COSE Header Algorithm Parameters
205210

206-
* Name: payload hash algorithm
207-
* Label: TBD_1
208-
* Value type: int
209-
* Value registry: https://www.iana.org/assignments/named-information/named-information.xhtml
210-
* Description: Hash algorithm used to produce the payload.
211+
- Name: payload hash algorithm
212+
- Label: TBD_1
213+
- Value type: int
214+
- Value registry: https://www.iana.org/assignments/named-information/named-information.xhtml
215+
- Description: Hash algorithm used to produce the payload.
211216

212217
## Named Information Hash Algorithm Registry
213218

214-
* Name: SHAKE256
215-
* Label: TBD_2
216-
* Value type: int
217-
* Value registry: https://www.iana.org/assignments/named-information/named-information.xhtml
218-
* Description: SHAKE256 a described in https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf
219-
220-
* Name: ASCON128
221-
* Label: TBD_3
222-
* Value type: int
223-
* Value registry: https://www.iana.org/assignments/named-information/named-information.xhtml
224-
* Description: ASCON128 a described in https://csrc.nist.gov/CSRC/media/Projects/lightweight-cryptography/documents/round-2/spec-doc-rnd2/ascon-spec-round2.pdf
219+
- Name: SHAKE256
220+
- Label: TBD_2
221+
- Value type: int
222+
- Value registry: https://www.iana.org/assignments/named-information/named-information.xhtml
223+
- Description: SHAKE256 a described in https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf
224+
225+
- Name: ASCON128
226+
- Label: TBD_3
227+
- Value type: int
228+
- Value registry: https://www.iana.org/assignments/named-information/named-information.xhtml
229+
- Description: ASCON128 a described in https://csrc.nist.gov/CSRC/media/Projects/lightweight-cryptography/documents/round-2/spec-doc-rnd2/ascon-spec-round2.pdf
225230

226231
--- back
227232

0 commit comments

Comments
 (0)