-
Notifications
You must be signed in to change notification settings - Fork 20
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
Conversation
|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 | ||
<a data-cite="VC-DATA-MODEL-2.0#RANGE_ERROR">RANGE_ERROR</a> MUST be |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is now a sister PR to complete this one: w3c/vc-data-model#1405
index.html
Outdated
|credentialIndex| times the |size| in the |bitstring|. If the |credentialIndex| | ||
is a value outside of the range of the |bitstring|, a |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1d1a83a.
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Normative, multiple reviews, changes requested and made, no objections, merging. |
This PR is an attempt to address issue #9 by updating the validation algorithm to throw a RANGE_ERROR for indexes that are outside the length of a bitstring.
Preview | Diff