[cpp-sp] branch master updated: CPPXT-122 - Replace DateTime class with Xerces version

Scott Cantor cantor.2 at osu.edu
Mon Jan 8 20:58:52 EST 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=4c27c608b4a13e99c2dc822fea8c4820ffc7519b

The following commit(s) were added to refs/heads/master by this push:
       new  4c27c60   CPPXT-122 - Replace DateTime class with Xerces version
4c27c60 is described below

commit 4c27c608b4a13e99c2dc822fea8c4820ffc7519b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Jan 8 20:58:50 2018 -0500

    CPPXT-122 - Replace DateTime class with Xerces version
    
    https://issues.shibboleth.net/jira/browse/CPPXT-122
---
 adfs/adfs.cpp                                                |  1 -
 plugins/TimeAccessControl.cpp                                | 12 ++++++------
 .../attribute/resolver/impl/AssertionAttributeExtractor.cpp  |  1 -
 .../attribute/resolver/impl/DelegationAttributeExtractor.cpp |  1 -
 shibsp/handler/impl/ExternalAuthHandler.cpp                  |  7 +++----
 shibsp/handler/impl/SAML1Consumer.cpp                        |  1 -
 shibsp/handler/impl/SAML2Consumer.cpp                        |  1 -
 shibsp/handler/impl/StatusHandler.cpp                        | 10 +++++-----
 shibsp/impl/StorageServiceSessionCache.cpp                   | 11 +++++------
 shibsp/impl/XMLSecurityPolicyProvider.cpp                    |  1 +
 10 files changed, 20 insertions(+), 26 deletions(-)

diff --git a/adfs/adfs.cpp b/adfs/adfs.cpp
index 7c38074..cc1e51f 100644
--- a/adfs/adfs.cpp
+++ b/adfs/adfs.cpp
@@ -50,7 +50,6 @@
 #include <shibsp/handler/LogoutInitiator.h>
 #include <shibsp/handler/SessionInitiator.h>
 #include <xmltooling/logging.h>
-#include <xmltooling/util/DateTime.h>
 #include <xmltooling/util/NDC.h>
 #include <xmltooling/util/URLEncoder.h>
 #include <xmltooling/util/XMLHelper.h>
diff --git a/plugins/TimeAccessControl.cpp b/plugins/TimeAccessControl.cpp
index ca5de84..4b1f9aa 100644
--- a/plugins/TimeAccessControl.cpp
+++ b/plugins/TimeAccessControl.cpp
@@ -34,8 +34,8 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/algorithm/string.hpp>
 #include <boost/ptr_container/ptr_vector.hpp>
+#include <xercesc/util/XMLDateTime.hpp>
 #include <xmltooling/unicode.h>
-#include <xmltooling/util/DateTime.h>
 #include <xmltooling/util/XMLHelper.h>
 #include <xercesc/util/XMLUniDefs.hpp>
 
@@ -106,7 +106,7 @@ Rule::Rule(const DOMElement* e)
 {
     if (XMLString::equals(e->getLocalName(), TimeSinceAuthn)) {
         m_type = TM_AUTHN;
-        DateTime dur(e->getTextContent());
+        XMLDateTime dur(e->getTextContent());
         dur.parseDuration();
         m_value = dur.getEpoch(true);
         return;
@@ -130,9 +130,9 @@ Rule::Rule(const DOMElement* e)
     if (XMLString::equals(e->getLocalName(), Time)) {
         m_type = TM_TIME;
         auto_ptr_XMLCh widen(tokens.back().c_str());
-        DateTime dt(widen.get());
+        XMLDateTime dt(widen.get());
         dt.parseDateTime();
-        m_value = dt.getEpoch();
+        m_value = dt.getEpoch(false);
         return;
     }
 
@@ -172,9 +172,9 @@ AccessControl::aclresult_t Rule::authorized(const SPRequest& request, const Sess
             auto_ptr_XMLCh atime(session->getAuthnInstant());
             if (atime.get()) {
                 try {
-                    DateTime dt(atime.get());
+                    XMLDateTime dt(atime.get());
                     dt.parseDateTime();
-                    if (time(nullptr) - dt.getEpoch() <= m_value)
+                    if (time(nullptr) - dt.getEpoch(false) <= m_value)
                         return shib_acl_true;
                     request.log(SPRequest::SPDebug, "elapsed time since authentication exceeds limit");
                     return shib_acl_false;
diff --git a/shibsp/attribute/resolver/impl/AssertionAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/AssertionAttributeExtractor.cpp
index 5d1f0ac..c75b245 100644
--- a/shibsp/attribute/resolver/impl/AssertionAttributeExtractor.cpp
+++ b/shibsp/attribute/resolver/impl/AssertionAttributeExtractor.cpp
@@ -33,7 +33,6 @@
 #include <saml/saml1/core/Assertions.h>
 #include <saml/saml2/core/Protocols.h>
 #include <saml/saml2/metadata/Metadata.h>
-#include <xmltooling/util/DateTime.h>
 #include <xmltooling/util/XMLHelper.h>
 #include <xercesc/util/XMLUniDefs.hpp>
 
diff --git a/shibsp/attribute/resolver/impl/DelegationAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/DelegationAttributeExtractor.cpp
index 5e3a3db..dc6c1f7 100644
--- a/shibsp/attribute/resolver/impl/DelegationAttributeExtractor.cpp
+++ b/shibsp/attribute/resolver/impl/DelegationAttributeExtractor.cpp
@@ -37,7 +37,6 @@
 #include <saml/saml2/metadata/Metadata.h>
 #include <saml/saml2/metadata/MetadataCredentialCriteria.h>
 #include <xmltooling/security/CredentialResolver.h>
-#include <xmltooling/util/DateTime.h>
 #include <xmltooling/util/XMLHelper.h>
 #include <xercesc/util/XMLUniDefs.hpp>
 
diff --git a/shibsp/handler/impl/ExternalAuthHandler.cpp b/shibsp/handler/impl/ExternalAuthHandler.cpp
index e6faca9..7e639a5 100644
--- a/shibsp/handler/impl/ExternalAuthHandler.cpp
+++ b/shibsp/handler/impl/ExternalAuthHandler.cpp
@@ -51,7 +51,6 @@
 # include <saml/saml2/metadata/Metadata.h>
 # include <saml/saml2/metadata/MetadataProvider.h>
 # include <xmltooling/XMLToolingConfig.h>
-# include <xmltooling/util/DateTime.h>
 # include <xmltooling/util/ParserPool.h>
 # include <xmltooling/util/XMLHelper.h>
 # include <xercesc/framework/MemBufInputSource.hpp>
@@ -442,11 +441,11 @@ pair<bool,long> ExternalAuth::processMessage(
             }
         }
 
-        scoped_ptr<DateTime> authn_instant;
+        scoped_ptr<XMLDateTime> authn_instant;
         param = httpRequest.getParameter("AuthnInstant");
         if (param && *param) {
             auto_ptr_XMLCh d(param);
-            authn_instant.reset(new DateTime(d.get()));
+            authn_instant.reset(new XMLDateTime(d.get()));
             authn_instant->parseDateTime();
         }
 
@@ -826,4 +825,4 @@ LoginEvent* ExternalAuth::newLoginEvent(const Application& application, const HT
     return nullptr;
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/shibsp/handler/impl/SAML1Consumer.cpp b/shibsp/handler/impl/SAML1Consumer.cpp
index 310c1e2..d7d93a0 100644
--- a/shibsp/handler/impl/SAML1Consumer.cpp
+++ b/shibsp/handler/impl/SAML1Consumer.cpp
@@ -43,7 +43,6 @@
 # include <saml/saml2/metadata/Metadata.h>
 # include <xmltooling/XMLToolingConfig.h>
 # include <xmltooling/io/HTTPRequest.h>
-# include <xmltooling/util/DateTime.h>
 using namespace opensaml::saml1;
 using namespace opensaml::saml1p;
 using namespace opensaml;
diff --git a/shibsp/handler/impl/SAML2Consumer.cpp b/shibsp/handler/impl/SAML2Consumer.cpp
index d7d8fa9..ac85bb6 100644
--- a/shibsp/handler/impl/SAML2Consumer.cpp
+++ b/shibsp/handler/impl/SAML2Consumer.cpp
@@ -43,7 +43,6 @@
 # include <saml/saml2/profile/SAML2AssertionPolicy.h>
 # include <xmltooling/XMLToolingConfig.h>
 # include <xmltooling/io/HTTPRequest.h>
-# include <xmltooling/util/DateTime.h>
 # include <xmltooling/validation/ValidatorSuite.h>
 using namespace opensaml::saml2;
 using namespace opensaml::saml2p;
diff --git a/shibsp/handler/impl/StatusHandler.cpp b/shibsp/handler/impl/StatusHandler.cpp
index 250e58f..2788519 100644
--- a/shibsp/handler/impl/StatusHandler.cpp
+++ b/shibsp/handler/impl/StatusHandler.cpp
@@ -36,7 +36,7 @@
 #include <boost/iterator/indirect_iterator.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <xmltooling/version.h>
-#include <xmltooling/util/DateTime.h>
+#include <xercesc/util/XMLDateTime.hpp>
 
 #ifdef HAVE_SYS_UTSNAME_H
 # include <sys/utsname.h>
@@ -273,7 +273,7 @@ pair<bool,long> StatusHandler::run(SPRequest& request, bool isHandler) const
         map<string,const char*> props;
         settings.first->getAll(props);
 
-        DateTime now(time(nullptr));
+        XMLDateTime now(time(nullptr), false);
         now.parseDateTime();
         auto_ptr_char timestamp(now.getFormattedString());
         request.setContentType("text/xml");
@@ -310,7 +310,7 @@ pair<bool,long> StatusHandler::run(SPRequest& request, bool isHandler) const
     }
     catch (XMLToolingException& ex) {
         m_log.error("error while processing request: %s", ex.what());
-        DateTime now(time(nullptr));
+        XMLDateTime now(time(nullptr), false);
         now.parseDateTime();
         auto_ptr_char timestamp(now.getFormattedString());
         request.setContentType("text/xml");
@@ -329,7 +329,7 @@ pair<bool,long> StatusHandler::run(SPRequest& request, bool isHandler) const
     }
     catch (std::exception& ex) {
         m_log.error("error while processing request: %s", ex.what());
-        DateTime now(time(nullptr));
+        XMLDateTime now(time(nullptr), false);
         now.parseDateTime();
         auto_ptr_char timestamp(now.getFormattedString());
         request.setContentType("text/xml");
@@ -379,7 +379,7 @@ pair<bool,long> StatusHandler::processMessage(
 #ifndef SHIBSP_LITE
     m_log.debug("processing status request");
 
-    DateTime now(time(nullptr));
+    XMLDateTime now(time(nullptr), false);
     now.parseDateTime();
     auto_ptr_char timestamp(now.getFormattedString());
 
diff --git a/shibsp/impl/StorageServiceSessionCache.cpp b/shibsp/impl/StorageServiceSessionCache.cpp
index 4659c4d..d864504 100644
--- a/shibsp/impl/StorageServiceSessionCache.cpp
+++ b/shibsp/impl/StorageServiceSessionCache.cpp
@@ -48,7 +48,6 @@
 #include <boost/shared_ptr.hpp>
 #include <xmltooling/io/HTTPRequest.h>
 #include <xmltooling/io/HTTPResponse.h>
-#include <xmltooling/util/DateTime.h>
 #include <xmltooling/util/NDC.h>
 #include <xmltooling/util/ParserPool.h>
 #include <xmltooling/util/Threads.h>
@@ -66,7 +65,7 @@
 using namespace opensaml::saml2md;
 #else
 # include <ctime>
-# include <xmltooling/util/DateTime.h>
+# include <xercesc/util/XMLDateTime.hpp>
 #endif
 
 using namespace shibsp;
@@ -262,7 +261,7 @@ namespace {
 
             auto_ptr_XMLCh exp(m_obj["expires"].string());
             if (exp.get()) {
-                DateTime iso(exp.get());
+                XMLDateTime iso(exp.get());
                 iso.parseDateTime();
                 m_expires = iso.getEpoch();
             }
@@ -1153,7 +1152,7 @@ void SSCache::insert(
                 logexpstr = deadmenwalking["_shibnull"].string();
             if (logexpstr) {
                 auto_ptr_XMLCh dt(logexpstr);
-                DateTime dtobj(dt.get());
+                XMLDateTime dtobj(dt.get());
                 dtobj.parseDateTime();
                 time_t logexp = dtobj.getEpoch();
                 if (now - XMLToolingConfig::getConfig().clock_skew_secs < logexp)
@@ -1972,7 +1971,7 @@ void SSCache::receive(DDF& in, ostream& out)
         if (in["timeout"].string()) {
             time_t timeout = 0;
             auto_ptr_XMLCh dt(in["timeout"].string());
-            DateTime dtobj(dt.get());
+            XMLDateTime dtobj(dt.get());
             dtobj.parseDateTime();
             timeout = dtobj.getEpoch();
 
@@ -2029,7 +2028,7 @@ void SSCache::receive(DDF& in, ostream& out)
         time_t timeout = 0;
         auto_ptr_XMLCh dt(in["timeout"].string());
         if (dt.get()) {
-            DateTime dtobj(dt.get());
+            XMLDateTime dtobj(dt.get());
             dtobj.parseDateTime();
             timeout = dtobj.getEpoch();
         }
diff --git a/shibsp/impl/XMLSecurityPolicyProvider.cpp b/shibsp/impl/XMLSecurityPolicyProvider.cpp
index 7ff96ab..8efc65b 100644
--- a/shibsp/impl/XMLSecurityPolicyProvider.cpp
+++ b/shibsp/impl/XMLSecurityPolicyProvider.cpp
@@ -43,6 +43,7 @@
 #include <xmltooling/util/XMLHelper.h>
 #include <xercesc/util/XMLStringTokenizer.hpp>
 #include <xercesc/util/XMLUniDefs.hpp>
+#include <xsec/dsig/DSIGConstants.hpp>
 
 using shibspconstants::SHIB2SPCONFIG_NS;
 using opensaml::SAMLConfig;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list