diff --git a/lib/SAML2/Message.php b/lib/SAML2/Message.php index 2a4c262b9feea60fbe9e9d17adcfd135489ff49b..09d9a7d4e38f1d34ba1a5e9871a02ffdf2bc5064 100644 --- a/lib/SAML2/Message.php +++ b/lib/SAML2/Message.php @@ -147,13 +147,19 @@ abstract class SAML2_Message implements SAML2_SignedElement { /* Validate the signature element of the message. */ - $sig = SAML2_Utils::validateElement($xml); - if ($sig !== FALSE) { - $this->certificates = $sig['Certificates']; - $this->validators[] = array( - 'Function' => array('SAML2_Utils', 'validateSignature'), - 'Data' => $sig, - ); + try { + $sig = SAML2_Utils::validateElement($xml); + + if ($sig !== FALSE) { + $this->certificates = $sig['Certificates']; + $this->validators[] = array( + 'Function' => array('SAML2_Utils', 'validateSignature'), + 'Data' => $sig, + ); + } + + } catch (Exception $e) { + /* Ignore signature validation errors. */ } }