From b840ac479c92ca9ad1a55842369ea1262ed99a74 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Tue, 24 Jun 2008 08:52:01 +0000 Subject: [PATCH] xmlseclibs: Remove SAML20 and Shib13 specific appendSignature, and replace with original. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@703 44740490-163a-0410-bde0-09ae8108e29a --- lib/xmlseclibs.php | 85 ---------------------------------------------- 1 file changed, 85 deletions(-) diff --git a/lib/xmlseclibs.php b/lib/xmlseclibs.php index 975d85f36..c4fbe284e 100644 --- a/lib/xmlseclibs.php +++ b/lib/xmlseclibs.php @@ -1097,8 +1097,6 @@ class XMLSecurityDSig { $objKey->serializeKey($parent); } - - /* public function appendSignature($parentNode, $insertBefore = FALSE) { $baseDoc = ($parentNode instanceof DOMDocument)?$parentNode:$parentNode->ownerDocument; $newSig = $baseDoc->importNode($this->sigNode, TRUE); @@ -1108,48 +1106,6 @@ class XMLSecurityDSig { $parentNode->appendChild($newSig); } } - */ - - - public function appendSignatureShib($parentNode, $insertBefore = FALSE, $assertion = false) { - $baseDoc = ($parentNode instanceof DOMDocument)?$parentNode:$parentNode->ownerDocument; - $newSig = $baseDoc->importNode($this->sigNode, TRUE); - - - - $xnode = null; - - $xpath = new DOMXPath($baseDoc); - $xpath->registerNamespace('secdsig', XMLSecurityDSig::XMLDSIGNS); - $xpath->registerNamespace('samlp', 'urn:oasis:names:tc:SAML:1.0:protocol'); - $xpath->registerNamespace('saml', 'urn:oasis:names:tc:SAML:1.0:assertion'); - - - if ($insertBefore && !$assertion) { - - $query = "//samlp:Status"; - $nodeset = $xpath->query($query, $parentNode); - - $xnode = $nodeset->item(0); - if (!$xnode) - throw new Exception("Could not find node to sign before (Root signing mode)"); - - $parentNode->insertBefore($newSig, $xnode); - - } elseif ($insertBefore) { - - $query = "//saml:Assertion/saml:Subject"; - $nodeset = $xpath->query($query, $parentNode); - - $xnode = $nodeset->item(0); - if (!$xnode) - throw new Exception("Could not find node to sign before (Assertion signing mode)"); - - $parentNode->insertBefore($newSig, $xnode); - } else { - $parentNode->appendChild($newSig); - } - } /** @@ -1177,47 +1133,6 @@ class XMLSecurityDSig { } } - - public function appendSignature($parentNode, $insertBefore = false, $assertion = false) { - $baseDoc = ($parentNode instanceof DOMDocument)?$parentNode:$parentNode->ownerDocument; - $newSig = $baseDoc->importNode($this->sigNode, TRUE); - - - - $xnode = null; - - $xpath = new DOMXPath($baseDoc); - $xpath->registerNamespace('secdsig', XMLSecurityDSig::XMLDSIGNS); - $xpath->registerNamespace('samlp', 'urn:oasis:names:tc:SAML:2.0:protocol'); - $xpath->registerNamespace('saml', 'urn:oasis:names:tc:SAML:2.0:assertion'); - - - if ($insertBefore && !$assertion) { - - $query = "//samlp:Status"; - $nodeset = $xpath->query($query, $parentNode); - - $xnode = $nodeset->item(0); - if (!$xnode) - throw new Exception("Could not find node to sign before (Root signing mode)"); - - $parentNode->insertBefore($newSig, $xnode); - - } elseif ($insertBefore) { - - $query = "//saml:Assertion/saml:Subject"; - $nodeset = $xpath->query($query, $parentNode); - - $xnode = $nodeset->item(0); - if (!$xnode) - throw new Exception("Could not find node to sign before (Assertion signing mode)"); - - $parentNode->insertBefore($newSig, $xnode); - } else { - $parentNode->appendChild($newSig); - } - } - static function get509XCert($cert, $isPEMFormat=TRUE) { $certs = XMLSecurityDSig::staticGet509XCerts($cert, $isPEMFormat); if (! empty($certs)) { -- GitLab