From 3012bed3ee8da77d1524061a177d4f246310a729 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Tue, 4 Aug 2009 11:05:09 +0000 Subject: [PATCH] SAML2: Ignore signature validation exceptions. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1624 44740490-163a-0410-bde0-09ae8108e29a --- lib/SAML2/Message.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/SAML2/Message.php b/lib/SAML2/Message.php index 2a4c262b9..09d9a7d4e 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. */ } } -- GitLab