Fix for no conditions.
authorcantor <cantor@fb386ef7-a10c-0410-8ebf-fd3f8e989ab0>
Fri, 14 Dec 2007 18:13:20 +0000 (18:13 +0000)
committercantor <cantor@fb386ef7-a10c-0410-8ebf-fd3f8e989ab0>
Fri, 14 Dec 2007 18:13:20 +0000 (18:13 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-opensaml2/trunk@354 fb386ef7-a10c-0410-8ebf-fd3f8e989ab0

saml/saml1/profile/AssertionValidator.cpp
saml/saml2/profile/Assertion20Validator.cpp

index 69cdf25..31014d4 100644 (file)
@@ -47,8 +47,11 @@ void AssertionValidator::validateAssertion(const Assertion& assertion) const
 #endif
 
     const Conditions* conds = assertion.getConditions();
+    if (!conds)
+        return;
+    
     // First verify the time conditions, using the specified timestamp, if non-zero.
-    if (m_ts>0 && conds) {
+    if (m_ts>0) {
         unsigned int skew = XMLToolingConfig::getConfig().clock_skew_secs;
         time_t t=conds->getNotBeforeEpoch();
         if (m_ts+skew < t)
index 373df27..faff298 100644 (file)
@@ -47,8 +47,11 @@ void AssertionValidator::validateAssertion(const Assertion& assertion) const
 #endif
 
     const Conditions* conds = assertion.getConditions();
+    if (!conds)
+        return;
+    
     // First verify the time conditions, using the specified timestamp, if non-zero.
-    if (m_ts>0 && conds) {
+    if (m_ts>0) {
         unsigned int skew = XMLToolingConfig::getConfig().clock_skew_secs;
         time_t t=conds->getNotBeforeEpoch();
         if (m_ts+skew < t)
@@ -59,7 +62,6 @@ void AssertionValidator::validateAssertion(const Assertion& assertion) const
     }
 
     // Now we process conditions, starting with the known types and then extensions.
-
     const vector<AudienceRestriction*>& acvec = conds->getAudienceRestrictions();
     for (vector<AudienceRestriction*>::const_iterator ac = acvec.begin(); ac!=acvec.end(); ++ac)
         validateCondition(*ac);