Skip to content
Snippets Groups Projects
Commit 304d4bad authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Merge branch 'patch-6' of https://github.com/tvdijen/simplesamlphp into tvdijen-patch-6

parents de8dac30 9e6aac9a
No related branches found
No related tags found
No related merge requests found
...@@ -263,11 +263,7 @@ class SimpleSAML_Metadata_Signer ...@@ -263,11 +263,7 @@ class SimpleSAML_Metadata_Signer
$rootNode = $xml->firstChild; $rootNode = $xml->firstChild;
// sign the metadata with our private key // sign the metadata with our private key
if ($type == 'ADFS IdP') { $objXMLSecDSig = new XMLSecurityDSig();
$objXMLSecDSig = new sspmod_adfs_XMLSecurityDSig($metadataString);
} else {
$objXMLSecDSig = new XMLSecurityDSig();
}
$objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N); $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
......
<?php
/**
* This class should be considered a temporary workaround to
* solve the lack of custom formatting in XMLSecurityDSig
* (xmlseclibs). It should be possible to either configure
* the original class to avoid formatting, or to use a custom
* template for the signature.
*
* @todo Move this functionality to xmlseclibs.
*
* @author Daniel Tsosie
* @package SimpleSAMLphp
*/
class sspmod_adfs_XMLSecurityDSig extends XMLSecurityDSig
{
function __construct($metaxml)
{
$template = '';
if (strpos("\n", $metaxml) === false) {
foreach (explode("\n", self::template) as $line) {
$template .= trim($line);
}
} else {
$template = self::template;
}
$sigdoc = \SAML2\DOMDocumentFactory::fromString($template);
$this->sigNode = $sigdoc->documentElement;
}
}
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