Skip to content

Commit b3dce32

Browse files
committed
Fix
1 parent a640478 commit b3dce32

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

src/XML/AbstractSignedXMLElement.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ abstract class AbstractSignedXMLElement implements SignedElementInterface
3535
* Create/parse an alg:SigningMethod element.
3636
*
3737
* @param \DOMElement $xml
38-
* @param \SimpleSAML\XMLSecurity\XML\SignableElementInterface $elt
3938
* @param \SimpleSAML\XMLSecurity\XML\ds\Signature $signature
4039
*/
41-
protected function __construct(DOMElement $xml, SignableElementInterface $elt, Signature $signature)
40+
protected function __construct(DOMElement $xml, Signature $signature)
4241
{
4342
$this->element = $elt;
4443
$this->setStructure($xml);

tests/XML/CustomSigned.php

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,10 @@ final class CustomSigned extends AbstractSignedXMLElement
3131
*/
3232
public static function fromXML(DOMElement $xml): object
3333
{
34-
Assert::same($xml->localName, 'CustomSignable', InvalidDOMElementException::class);
35-
Assert::same($xml->namespaceURI, CustomSignable::NS, InvalidDOMElementException::class);
34+
$signature = Signature::getChildrenOfClass($xml);
35+
Assert::minCount($signature, 1, MissingElementException::class);
36+
Assert::maxCount($signature, 1, TooManyElementsException::class);
3637

37-
//var_dump($xml->ownerDocument->saveXML());
38-
$signatureElement = XMLUtils::xpQuery($xml, './ds:Signature');
39-
Assert::minCount($signatureElement, 1, MissingElementException::class);
40-
Assert::minCount($signatureElement, 1, TooManyElementsException::class);
41-
// $signature = Signature::getChildrenOfClass($xml);
42-
// Assert::minCount($signature, 1, MissingElementException::class);
43-
// Assert::minCount($signature, 1, TooManyElementsException::class);
44-
45-
$clone = clone $signatureElement[0];
46-
$signature = Signature::fromXML($clone);
47-
48-
return new self(
49-
$xml,
50-
CustomSignable::fromXML($xml),
51-
$signature
52-
);
38+
return new self($xml, $signature);
5339
}
5440
}

0 commit comments

Comments
 (0)