Skip to content
Snippets Groups Projects
Commit 2fbb0839 authored by Mads Freek Petersen's avatar Mads Freek Petersen
Browse files

Emit the elements in <EncryptedData> (<EncryptionMethod>, <KeyInfo>,...

Emit the elements in <EncryptedData> (<EncryptionMethod>, <KeyInfo>, <CipherData>) in the sequence required by the spec.


git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@783 44740490-163a-0410-bde0-09ae8108e29a
parent 326884e6
No related branches found
No related tags found
No related merge requests found
......@@ -1272,7 +1272,7 @@ class XMLSecEnc {
$encMethod = $this->encdoc->documentElement->appendChild($this->encdoc->createElementNS(XMLSecEnc::XMLENCNS, 'xenc:EncryptionMethod'));
$encMethod->setAttribute('Algorithm', $objKey->getAlgorith());
$cipherValue->parentNode->parentNode->insertBefore($encMethod, $cipherValue->parentNode);
$cipherValue->parentNode->parentNode->insertBefore($encMethod, $cipherValue->parentNode->parentNode->firstChild);
$strEncrypt = base64_encode($objKey->encryptData($data));
$value = $this->encdoc->createTextNode($strEncrypt);
......@@ -1360,7 +1360,7 @@ class XMLSecEnc {
$root = $this->encdoc->documentElement;
$encKey = $this->encdoc->createElementNS(XMLSecEnc::XMLENCNS, 'xenc:EncryptedKey');
if ($append) {
$keyInfo = $root->appendChild($this->encdoc->createElementNS('http://www.w3.org/2000/09/xmldsig#', 'dsig:KeyInfo'));
$keyInfo = $root->insertBefore($this->encdoc->createElementNS('http://www.w3.org/2000/09/xmldsig#', 'dsig:KeyInfo'), $root->firstChild);
$keyInfo->appendChild($encKey);
} else {
$this->encKey = $encKey;
......
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