Enforce single appearance of certain conditions.
authorScott Cantor <cantor.2@osu.edu>
Tue, 7 Apr 2009 17:04:27 +0000 (17:04 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 7 Apr 2009 17:04:27 +0000 (17:04 +0000)
saml/saml1/core/impl/AssertionsSchemaValidators.cpp
saml/saml2/core/impl/Assertions20SchemaValidators.cpp

index b57fec7..0acf070 100644 (file)
@@ -49,6 +49,9 @@ namespace opensaml {
             if (!ptr->hasChildren()) {
                 XMLOBJECTVALIDATOR_ONEOF(Conditions,NotBefore,NotOnOrAfter);
             }
+            else if (ptr->getDoNotCacheConditions().size() > 1) {
+                throw ValidationException("Multiple DoNotCacheCondition elements are not permitted.");
+            }
         END_XMLOBJECTVALIDATOR;
 
         BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,SubjectConfirmation);
index 3b60320..c297764 100644 (file)
@@ -92,6 +92,12 @@ namespace opensaml {
             if (!ptr->hasChildren()) {
                 XMLOBJECTVALIDATOR_ONEOF(Conditions,NotBefore,NotOnOrAfter);
             }
+            else if (ptr->getOneTimeUses().size() > 1) {
+                throw ValidationException("Multiple OneTimeUse condition elements are not permitted.");
+            }
+            else if (ptr->getProxyRestrictions().size() > 1) {
+                throw ValidationException("Multiple ProxyRestriction condition elements are not permitted.");
+            }
         END_XMLOBJECTVALIDATOR;
 
         BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,KeyInfoConfirmationDataType);