Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the XML schema defines an "ID" type just like "string" or "integer" that should be used when declaring an ID attribute within a node in xml... that's right, naming an attribute "ID" is not enough anymore.
The xml parser from previous java versions (earlier than 7u25) was very flexible about this constraint and did not require the ID type on "ID" attributes, but this is not the case with the newest java version.
With this fix, the isValid() method will traverse the xml document searching for attributes called "ID" and tag them as valid ID xml type, this will avoid an exception during the xmlSignature.validate(ctx) call.
NOTE. This will only happen if the Element.setIdAttribute method exists, which is the method that actually tags an ID attribute as a valid ID xml type. It exists since jdk 1.6 . The method won't be called on jdk 1.5 or previous versions but should not be a problem since the parser of those versions is more flexible.
I tested this fix successfully within jdk_6_u30 and jdk_7_u25