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

&subtypes= sorting in test vectors #32

Open
ssadler opened this issue Oct 11, 2017 · 3 comments
Open

&subtypes= sorting in test vectors #32

ssadler opened this issue Oct 11, 2017 · 3 comments

Comments

@ssadler
Copy link
Contributor

ssadler commented Oct 11, 2017

The RFC document says of the subtypes parameter in the URI:

The list MUST be ordered by the type id value of each type, in ascending order. i.e. preimage-sha-256 MUST appear before prefix-sha-256.

This appears to be incorrect in the test vectors and also in the javascript code, which just uses the javascript .sort() method on the subtype names. Unless I'm missing something?

I'm working on a new implementation of crypto-conditions, I'll try to make a PR with some changes when it's more complete.

@sappenin
Copy link
Collaborator

sappenin commented Feb 3, 2018

This quote above is no longer correct. Draft4 of the spec now says:

The parameters of a condition URI MUST appear in ascending lexicographical order based upon the name of each parameter. For example, the "cost" parameter must appear before the "fpt" parameter, which must appear before the "subtypes" parameter.

@sappenin
Copy link
Collaborator

sappenin commented Feb 7, 2018

@libscott I'm just realizing my comment above doesn't actually address your problem -- I think you are right that the RFC test-vectors are wrong in certain places when it comes to subtypes= sorting.

For example, here's the latest commit into many of the test-vectors, but it doesn't fix these for draft4 query-param ordering.

In the Java implementation, we have a corrected fork of these vectors, but relying on this data in the Java lib is incorrect and needs to be fixed -- we should instead be relying on the test vectors from this project (refer to hyperledger-archives/quilt#101 for tracking that).

@ssadler
Copy link
Contributor Author

ssadler commented Feb 7, 2018

@sappenin Yea, it's a bit ambiguous. You can't really target version 03 of the spec, unless you correct the vectors yourself as you say. I'm not sure if it's easy to target version 04 - the asn definition hasn't changed in over a year, since version 02, and the rfc document itself is still at version 03, even though the vectors are not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants