File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -103,12 +103,15 @@ sub new_from_xml {
103103 $xpath = XML::LibXML::XPathContext-> new($dom );
104104 $xpath -> registerNs(' saml' , ' urn:oasis:names:tc:SAML:2.0:assertion' );
105105 $xpath -> registerNs(' samlp' , ' urn:oasis:names:tc:SAML:2.0:protocol' );
106+ $xpath -> registerNs(' dsig' , ' http://www.w3.org/2000/09/xmldsig#' );
106107 $xpath -> registerNs(' xenc' , ' http://www.w3.org/2001/04/xmlenc#' );
107108
108109 my $xml_opts -> { no_xml_declaration } = 1;
109110
110111 my $assert = $xpath -> findnodes(' //saml:Assertion' )-> [0];
111- if (defined $assert ) {
112+ my @signedinfo = $xpath -> findnodes(' dsig:Signature' , $assert );
113+
114+ if (defined $assert && (scalar @signedinfo ne 0)) {
112115 my $x = Net::SAML2::XML::Sig-> new($xml_opts );
113116 my $ret = $x -> verify($assert -> serialize);
114117 die " Decrypted Assertion signature check failed" unless $ret ;
You can’t perform that action at this time.
0 commit comments