-
-
Notifications
You must be signed in to change notification settings - Fork 905
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
JRuby document.canonicalize inclusive_namespaces param needs fix. #1189
Comments
More testing shows many issues with the JRuby implementation of canonicalize. Id like to request a rewrite to the JRuby implementation. I am seeing serious issues with the results when validating a digest against the canonicalized document. |
@keaplogik Thanks for pointing out what you're experiencing with C14N. This functionality has been extremely difficult and time-consuming for Team Nokogiri to build out in a cross-platform way, and so I appreciate your patience and support. Requesting a rewrite isn't a very constructive suggestion. Perhaps you can help us triage how bad the problem is by opening tickets pointing out where you see there are compatibility or functionality problems? On this particular issue, just to make sure I understand what you're saying, is the problem that JRuby accepts a space-delimited string, and MRI accepts an array? |
Will be in Nokogiri 1.6.5, out soon. |
Yes that about sums it up. Agree a rewrite is not practical. I can follow up with more issues as I investigate and test against. Thanks. |
The C and Java implementations for XMLDocument canonicalize are different on how they handle the inclusive_namespaces parameter.
In Java see lines 584-591 in XMLDocument.java.
They take the first item in the array and later split those values into the InclusiveNamespaces.
This means a valid call to canonicalize in jruby would look like:
element.canonicalize(Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0, ["ds saml samlp xs xsi"])
In MRI See lines 523-529 in xml_document.c. They take each element in the array and assume each is an individual namespace.
This means a valid call to canonicalize in MRI would look like:
element.canonicalize(Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0, ["ds", "saml", "samlp", "xs", "xsi"])
This is related to issue SAML-Toolkits/ruby-saml#155 and blocks the resolution of that issue until this is fixed.
The text was updated successfully, but these errors were encountered: