Skip to content

Commit b096862

Browse files
committed
Fixes issue in Discusion #54 when there are multiple X509Certificate tags in the metadata
1 parent 11ba7f4 commit b096862

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Net/SAML2/IdP.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ sub new_from_xml {
177177
{
178178
my $use = $key->getAttribute('use') || 'signing';
179179

180-
# We can't select by ds:KeyInfo/ds:X509Data/ds:X509Certificate
181-
# because of https://rt.cpan.org/Public/Bug/Display.html?id=8784
180+
$key->setNamespace('http://www.w3.org/2000/09/xmldsig#', 'ds');
181+
182182
my ($text)
183-
= $key->findvalue("//*[local-name()='X509Certificate']")
183+
= $key->findvalue("ds:KeyInfo/ds:X509Data/ds:X509Certificate", $key)
184184
=~ /^\s*(.+?)\s*$/s;
185185

186186
# rewrap the base64 data from the metadata; it may not

0 commit comments

Comments
 (0)