Skip to content
Snippets Groups Projects
Commit cc7aae18 authored by Olav Morken's avatar Olav Morken
Browse files

SimpleSAML_Metadata_SAMLParser: Fix bug in signature validation.

The signature validation removes the signature element from the DOM
tree, which causes the metadata parsing to skip the DOM node following
the signature element. Normally this element would be a text node, but
it could also be a SSODescriptor-element.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1931 44740490-163a-0410-bde0-09ae8108e29a
parent d49cc513
No related branches found
No related tags found
No related merge requests found
......@@ -1406,6 +1406,14 @@ class SimpleSAML_Metadata_SAMLParser {
$entityDescriptor = $element->parentNode;
assert('$entityDescriptor instanceof DOMElement');
/*
* Make a copy of the entity descriptor, so that the validator can
* change the DOM tree in any way it wants.
*/
$doc = new DOMDocument();
$entityDescriptor = $doc->importNode($entityDescriptor, TRUE);
$doc->appendChild($entityDescriptor);
/* Attempt to check the signature. */
try {
$validator = new SimpleSAML_XML_Validator($entityDescriptor, 'ID');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment