From af1165aaf526e950897a8674db6b144f9ae0e585 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Mon, 7 Mar 2011 13:27:20 +0000
Subject: [PATCH] saml: Allow missing NotOnOrAfter & NotBefore conditions.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2765 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/saml/lib/Message.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/saml/lib/Message.php b/modules/saml/lib/Message.php
index 1a0574fd7..4022a9008 100644
--- a/modules/saml/lib/Message.php
+++ b/modules/saml/lib/Message.php
@@ -552,12 +552,12 @@ class sspmod_saml_Message {
 		/* Check various properties of the assertion. */
 
 		$notBefore = $assertion->getNotBefore();
-		if ($notBefore > time() + 60) {
+		if ($notBefore !== NULL && $notBefore > time() + 60) {
 			throw new SimpleSAML_Error_Exception('Received an assertion that is valid in the future. Check clock synchronization on IdP and SP.');
 		}
 
 		$notOnOrAfter = $assertion->getNotOnOrAfter();
-		if ($notOnOrAfter <= time() - 60) {
+		if ($notOnOrAfter !== NULL && $notOnOrAfter <= time() - 60) {
 			throw new SimpleSAML_Error_Exception('Received an assertion that has expired. Check clock synchronization on IdP and SP.');
 		}
 
-- 
GitLab