Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

descriptor: size verification should be before digest calculation#65

Merged
vbatts merged 1 commit intoopencontainers:masterfrom
TrumanLing:Descriptor
Feb 8, 2017
Merged

descriptor: size verification should be before digest calculation#65
vbatts merged 1 commit intoopencontainers:masterfrom
TrumanLing:Descriptor

Conversation

@TrumanLing
Copy link
Contributor

Conforming to description 'Before calculating the digest, the size of the content SHOULD be
verified to reduce hash collision space.' at https://github.com/opencontainers/image-spec/blob/master/descriptor.md.

Signed-off-by: Ling FaKe lingfake@huawei.com

Conforming to description 'Before calculating the digest, the size of the content SHOULD be
verified to reduce hash collision space.' at https://github.com/opencontainers/image-spec/blob/master/descriptor.md.

Signed-off-by: Ling FaKe <lingfake@huawei.com>
@wking
Copy link
Contributor

wking commented Oct 31, 2016

0d2a606 looks good to me, although with the Copy approach currently
used by validateContent there's not much benefit in either order. The
spec wording does increase efficiency in cases where you can
calculate the size more cheaply (e.g. if you're reading a file off the
disk and can stat for the size, or if you're recieving a file over
HTTP and can look at Content-Length).

@coolljt0725
Copy link
Member

coolljt0725 commented Feb 7, 2017

LGTM

Approved with PullApprove

1 similar comment
@vbatts
Copy link
Member

vbatts commented Feb 8, 2017

LGTM

Approved with PullApprove

@vbatts vbatts merged commit 6058078 into opencontainers:master Feb 8, 2017
@wking wking mentioned this pull request Feb 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants