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

Throw RANGE_ERROR for indexes outside the length of a bitstring. #104

Merged
merged 3 commits into from
Jan 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,10 @@ <h3>Validate Algorithm</h3>
</li>
<li>
Let |status| be the value at the position indicated by the
|credentialIndex| times the |size| in the |bitstring|.
|credentialIndex| times the |size| in the |bitstring|. If the |credentialIndex|
is a value outside of the range of the |bitstring|, a
Copy link
Member

Choose a reason for hiding this comment

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

This confuses me. |credentialIndex| times the |size| must be within the range of the |bitstring|, since that's what indicated the position of the |status| value. The |credentialIndex| value itself doesn't appear to have any relation to the range of the |bitstring|.

I think the above should change to either

Let |status| be the value in the |bitstring| at the position indicated
by the |credentialIndex| times the |size|. If the |credentialIndex|
times the |size| is a value outside of the range of the |bitstring|, a

or

Let |status| be the value in the |bitstring| at the position indicated
by the |credentialIndex|. If the |credentialIndex| is a value outside
of the range of the |bitstring|, a

This is not made as a GitHub suggestion, because a line "deleted" (really, changed) by the PR (line 745) is enveloped in the three I'm changing (lines 744-746).

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 1d1a83a.

<a data-cite="VC-DATA-MODEL-2.0#RANGE_ERROR">RANGE_ERROR</a> MUST be
Copy link
Member

Choose a reason for hiding this comment

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

The current VCDM does not specify a RANGE_ERROR. It only defined PARSING_ERROR, CRYPTOGRAPHIC_SECURITY_ERROR, and MALFORMED_VALUE_ERROR, see https://www.w3.org/TR/vc-data-model-2.0/#problem-details

Copy link
Member Author

Choose a reason for hiding this comment

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

I've opened a PR to register this new type here: w3c/vc-data-model#1405.

raised.
</li>
<li>
For `statusPurpose` of `revocation` or `suspension`,
Expand Down