Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require digest verification for related resources. #1567

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

msporny
Copy link
Member

@msporny msporny commented Oct 1, 2024

This PR is an attempt to address w3c/vc-data-integrity#272 by requiring digest verification for related resources.


Preview | Diff

@msporny msporny requested a review from TallTed as a code owner October 1, 2024 04:49
@msporny msporny added normative The PR is a normative change to the CR specification CR1 This item was processed during CR1 labels Oct 1, 2024
@msporny msporny changed the base branch from main to TallTed-20240911-abstraction October 1, 2024 04:51
@msporny msporny changed the base branch from TallTed-20240911-abstraction to main October 1, 2024 04:51
@iherman
Copy link
Member

iherman commented Oct 1, 2024

@msporny I believe there is a github manipulation error. The 'diff' file shows over 1000 changes, mostly editorials, which makes it difficult to review. I presume the subject of this PR is only §5.3 on the Integrity of Related Resources...

@msporny
Copy link
Member Author

msporny commented Oct 1, 2024

@msporny I believe there is a github manipulation error. The 'diff' file shows over 1000 changes, mostly editorials, which makes it difficult to review. I presume the subject of this PR is only §5.3 on the Integrity of Related Resources...

This is what I see when I view the diff on Github:

image

There was an issue initially, which created the issue you mention, but I fixed that last night. I expect you probably hit a cache somewhere that gave you the old version. Try a hard refresh?

@iherman
Copy link
Member

iherman commented Oct 1, 2024

It may be there is a cache issue, but not mine... I have made a clean reload, and I have also looked at the diff file from browsers that I have never used for this purpose. I still see changes in the abstract or the introduction, for example:

Screenshot 2024-10-01 at 16 47 17

Anyway. I can concentrate on the part that you highlight, maybe this exchange is good enough for other reviewers to disregard the rest...

@iherman
Copy link
Member

iherman commented Oct 1, 2024

B.t.w., if I look at the "Files changed" tab, then I get what you really changed only. Something with the preview cache...

Comment on lines +3195 to +3196
the `id` of an object inside a [=conforming document=] with a corresponding
cryptographic digest MUST check the digest against the retrieved resource. If
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just being picky...

Suggested change
the `id` of an object inside a [=conforming document=] with a corresponding
cryptographic digest MUST check the digest against the retrieved resource. If
the `id` of an object inside a [=conforming document=] with a corresponding
cryptographic digest appearing in a `relatedResource` object value MUST check the digest against the retrieved resource. If

It is pickiness. I will a accept either way.

Copy link
Contributor

@dlongley dlongley Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iherman,

Hmm, this is in the related resource section. The id is in the relatedResource object, that's the object that is being referred to here, i.e., relatedResource.id, so I don't think your suggestion is correct and / or it is redundant in a strange way. IMO, if we need to, we can say "the id of a relatedResource object" instead of "the id of an object".

Note the sentence right before the above paragraph says:

Any objects for which selective disclosure or unlinkable disclosure is desired SHOULD NOT be included as an object in the relatedResource array.

This "an object" ^ is the same one referred to in the paragraph above.

Comment on lines +3194 to +3198
A [=conforming verifier implementation=] that makes use of a resource based on
the `id` of an object inside a [=conforming document=] with a corresponding
cryptographic digest MUST check the digest against the retrieved resource. If
the digest of the retrieved resource does not match the one provided by the
[=issuer=], the [=conforming verifier implementation=] MUST produce an error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this end something like "MUST produce an error that SHOULD indicate type _____"?

Suggested change
A [=conforming verifier implementation=] that makes use of a resource based on
the `id` of an object inside a [=conforming document=] with a corresponding
cryptographic digest MUST check the digest against the retrieved resource. If
the digest of the retrieved resource does not match the one provided by the
[=issuer=], the [=conforming verifier implementation=] MUST produce an error.
A [=conforming verifier implementation=] that makes use of a resource based on
the `id` of an object inside a [=conforming document=] with a corresponding
cryptographic digest MUST compute the digest of the retrieved resource. If the
digest provided by the [=issuer=] does not match the digest computed for the
retrieved resource, the [=conforming verifier implementation=] MUST produce
an error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revised based on conversation between @dlongley and @iherman above. Still wondering whether this should end with something like "MUST produce an error that SHOULD indicate type _____"?

Suggested change
A [=conforming verifier implementation=] that makes use of a resource based on
the `id` of an object inside a [=conforming document=] with a corresponding
cryptographic digest MUST check the digest against the retrieved resource. If
the digest of the retrieved resource does not match the one provided by the
[=issuer=], the [=conforming verifier implementation=] MUST produce an error.
A [=conforming verifier implementation=] that makes use of a resource based on
the `id` of a `relatedResource` object inside a [=conforming document=] with a
corresponding cryptographic digest appearing in a `relatedResource` object value
MUST compute the digest of the retrieved resource. If the digest provided by the
[=issuer=] does not match the digest computed for the retrieved resource, the
[=conforming verifier implementation=] MUST produce an error.

Comment on lines +3195 to +3196
the `id` of an object inside a [=conforming document=] with a corresponding
cryptographic digest MUST check the digest against the retrieved resource. If
Copy link
Contributor

@dlongley dlongley Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iherman,

Hmm, this is in the related resource section. The id is in the relatedResource object, that's the object that is being referred to here, i.e., relatedResource.id, so I don't think your suggestion is correct and / or it is redundant in a strange way. IMO, if we need to, we can say "the id of a relatedResource object" instead of "the id of an object".

Note the sentence right before the above paragraph says:

Any objects for which selective disclosure or unlinkable disclosure is desired SHOULD NOT be included as an object in the relatedResource array.

This "an object" ^ is the same one referred to in the paragraph above.

specification MUST produce a validation error unless the resource matches the
expected media type and cryptographic digest.
A [=conforming verifier implementation=] that makes use of a resource based on
the `id` of an object inside a [=conforming document=] with a corresponding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If necessary for clarity, here's an alternative suggestion to what Ivan suggests below:

Suggested change
the `id` of an object inside a [=conforming document=] with a corresponding
the `id` of a `relatedResource` object inside a [=conforming document=] with a corresponding

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that works and is mathematically more precise.

👍

Copy link
Contributor

@longpd longpd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes make the clarity of the language much more explicit and I approve this PR

@iherman
Copy link
Member

iherman commented Oct 10, 2024

The issue was discussed in a meeting on 2024-10-09

  • no resolutions were taken
View the transcript

2.1. Require digest verification for related resources. (pr vc-data-model#1567)

See github pull request vc-data-model#1567.

Manu Sporny: I took an action to raise a PR in VCDM 2.0 for requiring digest verification if it's provided, there has been some discussion on it, I wanted the group to see that this is out there, there are some suggested changes, I will process this and merge it by the end of the week, please get in there and provide commentary, hopefully the PR reflects consensus in the group. I plan to close the DI issue based on the merge of requiring digest verification if it's provideds provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR1 This item was processed during CR1 normative The PR is a normative change to the CR specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants