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

metadata: Make the documentid a hash over the document contents, so it does...

metadata: Make the documentid a hash over the document contents, so it does not change on every page load
parent d386e132
No related branches found
No related tags found
No related merge requests found
...@@ -262,6 +262,7 @@ class Signer ...@@ -262,6 +262,7 @@ class Signer
// get the EntityDescriptor node we should sign // get the EntityDescriptor node we should sign
$rootNode = $xml->firstChild; $rootNode = $xml->firstChild;
$rootNode->setAttribute('ID', '_'.hash('sha256', $metadataString));
// sign the metadata with our private key // sign the metadata with our private key
$objXMLSecDSig = new XMLSecurityDSig(); $objXMLSecDSig = new XMLSecurityDSig();
...@@ -272,7 +273,7 @@ class Signer ...@@ -272,7 +273,7 @@ class Signer
[$rootNode], [$rootNode],
$signature_cf['digest'], $signature_cf['digest'],
['http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N], ['http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N],
['id_name' => 'ID'] ['id_name' => 'ID', 'overwrite' => false]
); );
$objXMLSecDSig->sign($objKey); $objXMLSecDSig->sign($objKey);
......
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