X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fsaml2%2Fmetadata%2Fimpl%2FXMLMetadataProvider.cpp;h=8214e3a0b3c410fbbeb0c386e345bddd9e8790a3;hp=6938bce62317b4223e0a70e262ffd4cc32fb8e3d;hb=384f649a7ef352f15223417de3167bd67224bb00;hpb=f43f417f235f8cd182437d845099f8b76d743298 diff --git a/saml/saml2/metadata/impl/XMLMetadataProvider.cpp b/saml/saml2/metadata/impl/XMLMetadataProvider.cpp index 6938bce..8214e3a 100644 --- a/saml/saml2/metadata/impl/XMLMetadataProvider.cpp +++ b/saml/saml2/metadata/impl/XMLMetadataProvider.cpp @@ -27,6 +27,7 @@ #include #include +#include using namespace opensaml::saml2md; using namespace xmltooling::logging; @@ -101,6 +102,15 @@ pair XMLMetadataProvider::load() ); // Preprocess the metadata. + if (!m_validate) { + try { + SchemaValidators.validate(xmlObject.get()); + } + catch (exception& ex) { + m_log.error("metadata intance failed manual schema validation checking: ", ex.what()); + throw MetadataException("Metadata instance failed manual schema validation checking."); + } + } doFilters(*xmlObject.get()); xmlObject->releaseThisAndChildrenDOM(); xmlObject->setDocument(NULL); @@ -133,12 +143,12 @@ void XMLMetadataProvider::index() EntitiesDescriptor* group=dynamic_cast(m_object); if (group) { if (!m_local && group->getCacheDuration()) - exp = time_t(NULL) + group->getCacheDurationEpoch(); + exp = time(NULL) + group->getCacheDurationEpoch(); AbstractMetadataProvider::index(group, exp); return; } EntityDescriptor* site=dynamic_cast(m_object); if (!m_local && site->getCacheDuration()) - exp = time_t(NULL) + site->getCacheDurationEpoch(); + exp = time(NULL) + site->getCacheDurationEpoch(); AbstractMetadataProvider::index(site, exp); }