Skip to content

Commit 84506f9

Browse files
committed
Fixes to reflect upstream changes in xml-security
1 parent 0faddd5 commit 84506f9

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/XML/SignableElementTrait.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use SimpleSAML\XMLSecurity\Constants as C;
1515
use SimpleSAML\XMLSecurity\Exception\RuntimeException;
1616
use SimpleSAML\XMLSecurity\Exception\UnsupportedAlgorithmException;
17-
use SimpleSAML\XMLSecurity\Utils\XML;
1817
use SimpleSAML\XMLSecurity\XML\ds\CanonicalizationMethod;
1918
use SimpleSAML\XMLSecurity\XML\ds\KeyInfo;
2019
use SimpleSAML\XMLSecurity\XML\ds\Signature;
@@ -109,7 +108,7 @@ protected function doSign(DOMElement $xml): DOMElement
109108
new Transform(AnyURIValue::fromString($this->c14nAlg)),
110109
]);
111110

112-
$canonicalDocument = XML::processTransforms($transforms, $xml);
111+
$canonicalDocument = $this->processTransforms($transforms, $xml);
113112

114113
$signedInfo = new SignedInfo(
115114
new CanonicalizationMethod(AnyURIValue::fromString($this->c14nAlg)),

tests/Vulnerabilities/XmlSignatureWrappingTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use SimpleSAML\SAML2\Signature\Validator;
1212
use SimpleSAML\SAML2\XML\saml\Assertion;
1313
use SimpleSAML\XML\DOMDocumentFactory;
14-
use SimpleSAML\XMLSecurity\Exception\ReferenceValidationFailedException;
14+
use SimpleSAML\XMLSecurity\Exception\SignatureValidationFailedException;
1515
use SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock;
1616

1717
/**
@@ -43,8 +43,8 @@ public static function setUpBeforeClass(): void
4343
*/
4444
public function testThatASignatureReferencingAnEmbeddedAssertionIsNotValid(): void
4545
{
46-
$this->expectException(ReferenceValidationFailedException::class);
47-
$this->expectExceptionMessage('Reference does not point to given element.');
46+
$this->expectException(SignatureVerificationFailedException::class);
47+
$this->expectExceptionMessage('Failed to verify signature.');
4848

4949
$assertion = $this->getSignedAssertionWithEmbeddedAssertionReferencedInSignature();
5050
self::$signatureValidator->hasValidSignature($assertion, self::$identityProviderConfiguration);
@@ -55,8 +55,8 @@ public function testThatASignatureReferencingAnEmbeddedAssertionIsNotValid(): vo
5555
*/
5656
public function testThatASignatureReferencingAnotherAssertionIsNotValid(): void
5757
{
58-
$this->expectException(ReferenceValidationFailedException::class);
59-
$this->expectExceptionMessage('Reference does not point to given element.');
58+
$this->expectException(SignatureVerificationFailedException::class);
59+
$this->expectExceptionMessage('Failed to verify signature.');
6060

6161
$assertion = $this->getSignedAssertionWithSignatureThatReferencesAnotherAssertion();
6262
self::$signatureValidator->hasValidSignature($assertion, self::$identityProviderConfiguration);

0 commit comments

Comments
 (0)