Handle 32-bit time size
authorScott Cantor <cantor.2@osu.edu>
Sun, 16 Jul 2006 22:09:54 +0000 (22:09 +0000)
committerScott Cantor <cantor.2@osu.edu>
Sun, 16 Jul 2006 22:09:54 +0000 (22:09 +0000)
config_win32.h
configure.ac
saml/internal.h
saml/saml1/core/impl/AssertionsImpl.cpp
saml/saml2/core/impl/Assertions20Impl.cpp
saml/saml2/core/impl/Protocols20Impl.cpp
saml/saml2/metadata/impl/FilesystemMetadataProvider.cpp
saml/saml2/metadata/impl/MetadataImpl.cpp
saml/saml2/metadata/impl/MetadataProvider.cpp

index baa4947..cfd83a1 100644 (file)
-/* config_win32.h.  Copied from a ./configure on Unix */\r
-\r
-/* Define to 1 if you have the <dlfcn.h> header file.\r
-#define HAVE_DLFCN_H 1\r
-*/\r
-\r
-/* Define to 1 if you have the `gmtime_r' function. */\r
-/* #undef HAVE_GMTIME_R */\r
-\r
-/* Define if you have an STL implementation that supports useful string\r
-   specialization. */\r
-#define HAVE_GOOD_STL 1\r
-\r
-/* Define to 1 if you have the <inttypes.h> header file.\r
-#define HAVE_INTTYPES_H 1\r
-*/\r
-\r
-/* Define if log4cpp library was found */\r
-#define HAVE_LIBLOG4CPP 1\r
-\r
-/* Define if Xerces-C library was found */\r
-#define HAVE_LIBXERCESC 1\r
-\r
-/* Define to 1 if you have the <memory.h> header file. */\r
-#define HAVE_MEMORY_H 1\r
-\r
-/* define if the compiler implements namespaces */\r
-#define HAVE_NAMESPACES 1\r
-\r
-/* Define to 1 if you have the <stdint.h> header file. */\r
-/* #undef HAVE_STDINT_H */\r
-\r
-/* Define to 1 if you have the <stdlib.h> header file. */\r
-#define HAVE_STDLIB_H 1\r
-\r
-/* Define to 1 if you have the `strchr' function. */\r
-#define HAVE_STRCHR 1\r
-\r
-/* Define to 1 if you have the `strdup' function. */\r
-#define HAVE_STRDUP 1\r
-\r
-/* Define to 1 if you have the <strings.h> header file.\r
-#define HAVE_STRINGS_H 1\r
-*/\r
-\r
-/* Define to 1 if you have the <string.h> header file. */\r
-#define HAVE_STRING_H 1\r
-\r
-/* Define to 1 if you have the `strstr' function. */\r
-#define HAVE_STRSTR 1\r
-\r
-/* Define to 1 if you have the <sys/stat.h> header file. */\r
-#define HAVE_SYS_STAT_H 1\r
-\r
-/* Define to 1 if you have the <sys/types.h> header file. */\r
-#define HAVE_SYS_TYPES_H 1\r
-\r
-/* Define to 1 if you have the <unistd.h> header file.\r
-#define HAVE_UNISTD_H 1\r
-*/\r
-\r
-/* Name of package */\r
-#define PACKAGE "opensaml"\r
-\r
-/* Define to the address where bug reports for this package should be sent. */\r
-#define PACKAGE_BUGREPORT "mace-opensaml-users@internet2.edu"\r
-\r
-/* Define to the full name of this package. */\r
-#define PACKAGE_NAME "opensaml"\r
-\r
-/* Define to the full name and version of this package. */\r
-#define PACKAGE_STRING "opensaml 2.0"\r
-\r
-/* Define to the one symbol short name of this package. */\r
-#define PACKAGE_TARNAME "opensaml"\r
-\r
-/* Define to the version of this package. */\r
-#define PACKAGE_VERSION "2.0"\r
-\r
-/* Define to the necessary symbol if this constant uses a non-standard name on\r
-   your system. */\r
-/* #undef PTHREAD_CREATE_JOINABLE */\r
-\r
-/* Define to 1 if you have the ANSI C header files. */\r
-#define STDC_HEADERS 1\r
-\r
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */\r
-/* #undef TM_IN_SYS_TIME */\r
-\r
-/* Version number of package */\r
-#define VERSION "2.0"\r
-\r
-/* Define if you wish to disable XML-Security-dependent features. */\r
-/* #undef XMLTOOLING_NO_XMLSEC */\r
-\r
-/* Define to empty if `const' does not conform to ANSI C. */\r
-/* #undef const */\r
-\r
-/* Define to `unsigned' if <sys/types.h> does not define. */\r
-/* #undef size_t */\r
+/* config_win32.h.  Copied from a ./configure on Unix */
+
+/* Define to 1 if you have the <dlfcn.h> header file.
+#define HAVE_DLFCN_H 1
+*/
+
+/* Define to 1 if you have the `gmtime_r' function. */
+/* #undef HAVE_GMTIME_R */
+
+/* Define if you have an STL implementation that supports useful string
+   specialization. */
+#define HAVE_GOOD_STL 1
+
+/* Define to 1 if you have the <inttypes.h> header file.
+#define HAVE_INTTYPES_H 1
+*/
+
+/* Define if log4cpp library was found */
+#define HAVE_LIBLOG4CPP 1
+
+/* Define if Xerces-C library was found */
+#define HAVE_LIBXERCESC 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* define if the compiler implements namespaces */
+#define HAVE_NAMESPACES 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #undef HAVE_STDINT_H */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the <strings.h> header file.
+#define HAVE_STRINGS_H 1
+*/
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strstr' function. */
+#define HAVE_STRSTR 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file.
+#define HAVE_UNISTD_H 1
+*/
+
+/* Name of package */
+#define PACKAGE "opensaml"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "mace-opensaml-users@internet2.edu"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "opensaml"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "opensaml 2.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "opensaml"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.0"
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+   your system. */
+/* #undef PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Version number of package */
+#define VERSION "2.0"
+
+/* Define if you wish to disable XML-Security-dependent features. */
+/* #undef XMLTOOLING_NO_XMLSEC */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* The size of a `time_t', as computed by sizeof. */
+#define SIZEOF_TIME_T 8
+
index 029d1fd..469d861 100644 (file)
@@ -55,6 +55,8 @@ AC_TYPE_SIZE_T
 # Checks for library functions.
 AC_CHECK_FUNCS([strchr strdup strstr])
 
 # Checks for library functions.
 AC_CHECK_FUNCS([strchr strdup strstr])
 
+AC_CHECK_SIZEOF(time_t)
+
 # libcurl settings
 AC_PATH_PROG(CURL_CONFIG,curl-config)
 AC_ARG_WITH(curl,
 # libcurl settings
 AC_PATH_PROG(CURL_CONFIG,curl-config)
 AC_ARG_WITH(curl,
index 7caa141..0877395 100644 (file)
 #endif
 #endif
 
 #endif
 #endif
 
+#if SIZEOF_TIME_T == 8
+# define SAMLTIME_MAX LLONG_MAX
+#elif SIZEOF_TIME_T == 4
+# define SAMLTIME_MAX LONG_MAX
+#endif
+
 #define SAML_LOGCAT "OpenSAML"
 
 namespace opensaml {
 #define SAML_LOGCAT "OpenSAML"
 
 namespace opensaml {
index 8f24e5b..eb4e798 100644 (file)
@@ -164,7 +164,7 @@ namespace opensaml {
             
             IMPL_XMLOBJECT_CLONE(Conditions);
             IMPL_DATETIME_ATTRIB(NotBefore,0);
             
             IMPL_XMLOBJECT_CLONE(Conditions);
             IMPL_DATETIME_ATTRIB(NotBefore,0);
-            IMPL_DATETIME_ATTRIB(NotOnOrAfter,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
             IMPL_TYPED_CHILDREN(AudienceRestrictionCondition, m_children.end());
             IMPL_TYPED_CHILDREN(DoNotCacheCondition,m_children.end());
             IMPL_TYPED_CHILDREN(Condition,m_children.end());
             IMPL_TYPED_CHILDREN(AudienceRestrictionCondition, m_children.end());
             IMPL_TYPED_CHILDREN(DoNotCacheCondition,m_children.end());
             IMPL_TYPED_CHILDREN(Condition,m_children.end());
index 4a5ac94..ef1160c 100644 (file)
@@ -401,7 +401,7 @@ namespace opensaml {
                         
             IMPL_XMLOBJECT_CLONE(Conditions);
             IMPL_DATETIME_ATTRIB(NotBefore,0);
                         
             IMPL_XMLOBJECT_CLONE(Conditions);
             IMPL_DATETIME_ATTRIB(NotBefore,0);
-            IMPL_DATETIME_ATTRIB(NotOnOrAfter,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
             IMPL_TYPED_CHILDREN(AudienceRestriction, m_children.end());
             IMPL_TYPED_CHILDREN(OneTimeUse,m_children.end());
             IMPL_TYPED_CHILDREN(ProxyRestriction, m_children.end());
             IMPL_TYPED_CHILDREN(AudienceRestriction, m_children.end());
             IMPL_TYPED_CHILDREN(OneTimeUse,m_children.end());
             IMPL_TYPED_CHILDREN(ProxyRestriction, m_children.end());
@@ -459,7 +459,7 @@ namespace opensaml {
             
             IMPL_XMLOBJECT_CLONE(SubjectConfirmationData);
             IMPL_DATETIME_ATTRIB(NotBefore,0);
             
             IMPL_XMLOBJECT_CLONE(SubjectConfirmationData);
             IMPL_DATETIME_ATTRIB(NotBefore,0);
-            IMPL_DATETIME_ATTRIB(NotOnOrAfter,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
             IMPL_STRING_ATTRIB(Recipient);
             IMPL_STRING_ATTRIB(InResponseTo);
             IMPL_STRING_ATTRIB(Address);
             IMPL_STRING_ATTRIB(Recipient);
             IMPL_STRING_ATTRIB(InResponseTo);
             IMPL_STRING_ATTRIB(Address);
@@ -547,7 +547,7 @@ namespace opensaml {
             
             IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType);
             IMPL_DATETIME_ATTRIB(NotBefore,0);
             
             IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType);
             IMPL_DATETIME_ATTRIB(NotBefore,0);
-            IMPL_DATETIME_ATTRIB(NotOnOrAfter,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
             IMPL_STRING_ATTRIB(Recipient);
             IMPL_STRING_ATTRIB(InResponseTo);
             IMPL_STRING_ATTRIB(Address);
             IMPL_STRING_ATTRIB(Recipient);
             IMPL_STRING_ATTRIB(InResponseTo);
             IMPL_STRING_ATTRIB(Address);
@@ -910,7 +910,7 @@ namespace opensaml {
             }
             IMPL_DATETIME_ATTRIB(AuthnInstant,0);
             IMPL_STRING_ATTRIB(SessionIndex);
             }
             IMPL_DATETIME_ATTRIB(AuthnInstant,0);
             IMPL_STRING_ATTRIB(SessionIndex);
-            IMPL_DATETIME_ATTRIB(SessionNotOnOrAfter,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(SessionNotOnOrAfter,SAMLTIME_MAX);
             IMPL_TYPED_CHILD(SubjectLocality);
             IMPL_TYPED_CHILD(AuthnContext);
     
             IMPL_TYPED_CHILD(SubjectLocality);
             IMPL_TYPED_CHILD(AuthnContext);
     
index c136be2..720de3e 100644 (file)
@@ -1453,7 +1453,7 @@ namespace opensaml {
             IMPL_XMLOBJECT_CLONE(LogoutRequest);
 
             IMPL_STRING_ATTRIB(Reason);
             IMPL_XMLOBJECT_CLONE(LogoutRequest);
 
             IMPL_STRING_ATTRIB(Reason);
-            IMPL_DATETIME_ATTRIB(NotOnOrAfter,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
             IMPL_TYPED_FOREIGN_CHILD(BaseID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(BaseID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
index 113e1a3..e9d3dbf 100644 (file)
@@ -66,8 +66,8 @@ namespace opensaml {
         private:
             XMLObject* load() const;
             void index();
         private:
             XMLObject* load() const;
             void index();
-            void index(EntityDescriptor* site, time_t validUntil=LLONG_MAX);
-            void index(EntitiesDescriptor* group, time_t validUntil=LLONG_MAX);
+            void index(EntityDescriptor* site, time_t validUntil=SAMLTIME_MAX);
+            void index(EntitiesDescriptor* group, time_t validUntil=SAMLTIME_MAX);
         
             // index of loaded metadata
             typedef multimap<string,const EntityDescriptor*> sitemap_t;
         
             // index of loaded metadata
             typedef multimap<string,const EntityDescriptor*> sitemap_t;
index f3f5eff..a88ae51 100644 (file)
@@ -986,7 +986,7 @@ namespace opensaml {
             IMPL_STRING_ATTRIB(ID);
             IMPL_STRING_ATTRIB(ProtocolSupportEnumeration);
             IMPL_STRING_ATTRIB(ErrorURL);
             IMPL_STRING_ATTRIB(ID);
             IMPL_STRING_ATTRIB(ProtocolSupportEnumeration);
             IMPL_STRING_ATTRIB(ErrorURL);
-            IMPL_DATETIME_ATTRIB(ValidUntil,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
             IMPL_DATETIME_ATTRIB(CacheDuration,0);
             IMPL_TYPED_CHILD(Extensions);
             IMPL_TYPED_CHILDREN(KeyDescriptor,m_pos_Organization);
             IMPL_DATETIME_ATTRIB(CacheDuration,0);
             IMPL_TYPED_CHILD(Extensions);
             IMPL_TYPED_CHILDREN(KeyDescriptor,m_pos_Organization);
@@ -1828,7 +1828,7 @@ namespace opensaml {
             
             IMPL_STRING_ATTRIB(ID);
             IMPL_STRING_ATTRIB(AffiliationOwnerID);
             
             IMPL_STRING_ATTRIB(ID);
             IMPL_STRING_ATTRIB(AffiliationOwnerID);
-            IMPL_DATETIME_ATTRIB(ValidUntil,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
             IMPL_DATETIME_ATTRIB(CacheDuration,0);
             IMPL_TYPED_CHILD(Extensions);
             IMPL_TYPED_CHILDREN(AffiliateMember,m_pos_AffiliateMember);
             IMPL_DATETIME_ATTRIB(CacheDuration,0);
             IMPL_TYPED_CHILD(Extensions);
             IMPL_TYPED_CHILDREN(AffiliateMember,m_pos_AffiliateMember);
@@ -2030,7 +2030,7 @@ namespace opensaml {
             
             IMPL_STRING_ATTRIB(ID);
             IMPL_STRING_ATTRIB(EntityID);
             
             IMPL_STRING_ATTRIB(ID);
             IMPL_STRING_ATTRIB(EntityID);
-            IMPL_DATETIME_ATTRIB(ValidUntil,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
             IMPL_DATETIME_ATTRIB(CacheDuration,0);
             IMPL_TYPED_CHILD(Extensions);
             IMPL_TYPED_CHILDREN(RoleDescriptor,m_pos_AffiliationDescriptor);
             IMPL_DATETIME_ATTRIB(CacheDuration,0);
             IMPL_TYPED_CHILD(Extensions);
             IMPL_TYPED_CHILDREN(RoleDescriptor,m_pos_AffiliationDescriptor);
@@ -2240,7 +2240,7 @@ namespace opensaml {
             
             IMPL_STRING_ATTRIB(ID);
             IMPL_STRING_ATTRIB(Name);
             
             IMPL_STRING_ATTRIB(ID);
             IMPL_STRING_ATTRIB(Name);
-            IMPL_DATETIME_ATTRIB(ValidUntil,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
             IMPL_DATETIME_ATTRIB(CacheDuration,0);
             IMPL_TYPED_CHILD(Extensions);
             IMPL_TYPED_CHILDREN(EntityDescriptor,m_children.end());
             IMPL_DATETIME_ATTRIB(CacheDuration,0);
             IMPL_TYPED_CHILD(Extensions);
             IMPL_TYPED_CHILDREN(EntityDescriptor,m_children.end());
index ad9818b..b5b5684 100644 (file)
@@ -43,7 +43,6 @@ MetadataProvider::MetadataProvider(const DOMElement* e)
 #ifdef _DEBUG
     NDC ndc("MetadataProvider");
 #endif
 #ifdef _DEBUG
     NDC ndc("MetadataProvider");
 #endif
-    Category& log=Category::getInstance(SAML_LOGCAT".Metadata");
     SAMLConfig& conf=SAMLConfig::getConfig();
     
     // Locate any default recognized filters.
     SAMLConfig& conf=SAMLConfig::getConfig();
     
     // Locate any default recognized filters.
@@ -70,7 +69,8 @@ MetadataProvider::MetadataProvider(const DOMElement* e)
             child = XMLHelper::getNextSiblingElement(child);
         }
     }
             child = XMLHelper::getNextSiblingElement(child);
         }
     }
-    catch (XMLToolingException&) {
+    catch (XMLToolingException& ex) {
+        Category::getInstance(SAML_LOGCAT".Metadata").error("caught exception while installing filters: %s", ex.what());
         for_each(m_filters.begin(),m_filters.end(),xmltooling::cleanup<MetadataFilter>());
         throw;
     }
         for_each(m_filters.begin(),m_filters.end(),xmltooling::cleanup<MetadataFilter>());
         throw;
     }