Starting migration to new SP library
authorScott Cantor <cantor.2@osu.edu>
Fri, 22 Dec 2006 04:01:37 +0000 (04:01 +0000)
committerScott Cantor <cantor.2@osu.edu>
Fri, 22 Dec 2006 04:01:37 +0000 (04:01 +0000)
34 files changed:
.gitignore
Shibboleth.sln
apache/mod_apache.cpp
apache/mod_shib13.vcproj
isapi_shib/isapi_shib.cpp
nsapi_shib/nsapi_shib.cpp
shar/shar.cpp
shar/test-client.cpp
shib-target/SocketListener.cpp
shib-target/XMLRequestMapper.cpp
shib-target/internal.h
shib-target/shib-ccache.cpp
shib-target/shib-config.cpp
shib-target/shib-handlers.cpp
shib-target/shib-ini.cpp
shib-target/shib-target.h
shibsp/.gitignore
shibsp/Makefile.am [new file with mode: 0644]
shibsp/SPConfig.cpp [new file with mode: 0644]
shibsp/SPConfig.h [new file with mode: 0644]
shibsp/base.h [new file with mode: 0644]
shibsp/exceptions.h [new file with mode: 0644]
shibsp/internal.h [new file with mode: 0644]
shibsp/paths.h.in [new file with mode: 0644]
shibsp/shibsp.vcproj
shibsp/version.h [new file with mode: 0644]
test/posttest.cpp
test/shibtest.cpp
xmlproviders/CredResolvers.cpp
xmlproviders/XMLAAP.cpp
xmlproviders/XMLAccessControl.cpp
xmlproviders/XMLCredentials.cpp
xmlproviders/XMLMetadata.cpp
xmlproviders/XMLTrust.cpp

index d42d662..ae58d81 100644 (file)
@@ -35,3 +35,4 @@
 /shibboleth.spec
 /.settings
 /*.suo
+/Debug
index b22cf89..eb94c38 100644 (file)
@@ -2,6 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 9.00
 # Visual Studio 2005
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isapi_shib", "isapi_shib\isapi_shib.vcproj", "{87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}"
        ProjectSection(ProjectDependencies) = postProject
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
                {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
        EndProjectSection
@@ -10,30 +11,35 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isapi_shib_gui", "isapi_shi
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shib13", "apache\mod_shib13.vcproj", "{D243B43E-728E-4F32-BDFF-B3A897037C6D}"
        ProjectSection(ProjectDependencies) = postProject
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
                {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shib20", "apache\mod_shib20.vcproj", "{68E9568B-476C-4289-B93C-893432378ADC}"
        ProjectSection(ProjectDependencies) = postProject
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
                {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsapi_shib", "nsapi_shib\nsapi_shib.vcproj", "{1396D80A-8672-4224-9B02-95F3F4207CDB}"
        ProjectSection(ProjectDependencies) = postProject
-               {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
+               {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "posttest", "posttest\posttest.vcproj", "{16E70C47-789E-43D5-AFDF-964D386C3CB5}"
        ProjectSection(ProjectDependencies) = postProject
-               {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
+               {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shar", "shar\shar.vcproj", "{F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}"
        ProjectSection(ProjectDependencies) = postProject
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
                {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
        EndProjectSection
@@ -49,10 +55,12 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibtarget", "shib-target\shibtarget.vcproj", "{84890110-2190-4AAE-9BDC-58F90DF71E4F}"
        ProjectSection(ProjectDependencies) = postProject
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibtest", "shibtest\shibtest.vcproj", "{67AF22A3-C26E-40BE-B0CA-2ABEE5123763}"
        ProjectSection(ProjectDependencies) = postProject
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
                {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
        EndProjectSection
@@ -61,8 +69,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "siterefresh", "siterefresh\
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testclient", "shar\testclient.vcproj", "{B3F1E899-86F9-4D3A-8026-B57D1A5B90B1}"
        ProjectSection(ProjectDependencies) = postProject
-               {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
+               {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlproviders", "xmlproviders\xmlproviders.vcproj", "{68E46D06-6B91-4C59-A700-78DD4D4C420B}"
@@ -79,6 +88,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "odbc_ccache", "odbc_ccache\
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shib22", "apache\mod_shib22.vcproj", "{B44C0852-83B8-4FB2-A86E-097C9C8256D0}"
        ProjectSection(ProjectDependencies) = postProject
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
                {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
                {E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
        EndProjectSection
index dbeb11b..955afd6 100644 (file)
@@ -35,6 +35,7 @@
 #include <saml/saml.h>
 #include <shib/shib.h>
 #include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
 #include <xercesc/util/regx/RegularExpression.hpp>
 
 #ifdef WIN32
@@ -65,6 +66,7 @@
 #include <unistd.h>            // for getpid()
 #endif
 
+using namespace shibsp;
 using namespace shibtarget;
 using namespace saml;
 using namespace xmltooling;
@@ -929,14 +931,14 @@ extern "C" void shib_child_init(apr_pool_t* p, server_rec* s)
 
     try {
         g_Config=&ShibTargetConfig::getConfig();
-        g_Config->setFeatures(
-            ShibTargetConfig::Caching |
-            ShibTargetConfig::Listener |
-            ShibTargetConfig::Metadata |
-            ShibTargetConfig::AAP |
-            ShibTargetConfig::RequestMapper |
-            ShibTargetConfig::InProcess |
-            ShibTargetConfig::Logging
+        SPConfig::getConfig().setFeatures(
+            SPConfig::Caching |
+            SPConfig::Listener |
+            SPConfig::Metadata |
+            SPConfig::AAP |
+            SPConfig::RequestMapper |
+            SPConfig::InProcess |
+            SPConfig::Logging
             );
         if (!g_Config->init(g_szSchemaDir)) {
             ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init() failed to initialize libraries");
index 5b8ccfa..8a0f87c 100644 (file)
        </References>
        <Files>
                <File
-                       RelativePath="mod_apache.cpp"
-                       >
-               </File>
-               <File
                        RelativePath="mod_shib_13.cpp"
                        >
                </File>
index 0074ea6..74684b6 100644 (file)
@@ -29,6 +29,7 @@
 #include <saml/saml.h>
 #include <shib/shib.h>
 #include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
 
 #include <ctime>
 #include <fstream>
@@ -39,6 +40,7 @@
 #include <httpfilt.h>
 #include <httpext.h>
 
+using namespace shibsp;
 using namespace shibtarget;
 using namespace saml;
 using namespace xmltooling;
@@ -154,14 +156,14 @@ extern "C" BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer)
         if (!config)
             config=SHIB_CONFIG;
         g_Config=&ShibTargetConfig::getConfig();
-        g_Config->setFeatures(
-            ShibTargetConfig::Listener |
-            ShibTargetConfig::Caching |
-            ShibTargetConfig::Metadata |
-            ShibTargetConfig::AAP |
-            ShibTargetConfig::RequestMapper |
-            ShibTargetConfig::InProcess |
-            ShibTargetConfig::Logging
+        SPConfig::getConfig().setFeatures(
+            SPConfig::Listener |
+            SPConfig::Caching |
+            SPConfig::Metadata |
+            SPConfig::AAP |
+            SPConfig::RequestMapper |
+            SPConfig::InProcess |
+            SPConfig::Logging
             );
         if (!g_Config->init(schemadir)) {
             g_Config=NULL;
index 34580d0..aa0ff5a 100644 (file)
@@ -36,6 +36,7 @@
 #include <saml/saml.h>
 #include <shib/shib.h>
 #include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
 
 #include <ctime>
 #include <fstream>
@@ -57,6 +58,7 @@ extern "C"
 #include <nsapi.h>
 }
 
+using namespace shibsp;
 using namespace shibtarget;
 using namespace saml;
 using namespace xmltooling;
@@ -123,14 +125,14 @@ extern "C" NSAPI_PUBLIC int nsapi_shib_init(pblock* pb, Session* sn, Request* rq
         if (!config)
             config=SHIB_CONFIG;
         g_Config=&ShibTargetConfig::getConfig();
-        g_Config->setFeatures(
-            ShibTargetConfig::Listener |
-            ShibTargetConfig::Caching |
-            ShibTargetConfig::Metadata |
-            ShibTargetConfig::AAP |
-            ShibTargetConfig::RequestMapper |
-            ShibTargetConfig::InProcess |
-            ShibTargetConfig::Logging
+        SPConfig::getConfig().setFeatures(
+            SPConfig::Listener |
+            SPConfig::Caching |
+            SPConfig::Metadata |
+            SPConfig::AAP |
+            SPConfig::RequestMapper |
+            SPConfig::InProcess |
+            SPConfig::Logging
             );
         if (!g_Config->init(schemadir)) {
             g_Config=NULL;
index 521e459..0fde514 100644 (file)
@@ -36,6 +36,7 @@
 #endif
 
 #include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #include <signal.h>
 #include <log4cpp/Category.hh>
 
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+using namespace shibsp;
 using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
 using namespace log4cpp;
+using namespace std;
 
 bool shibd_shutdown = false;
 const char* shar_config = NULL;
@@ -104,15 +106,15 @@ int real_main(int preinit)
     if (preinit) {
 
         // initialize the shib-target library
-        conf.setFeatures(
-            ShibTargetConfig::Listener |
-            ShibTargetConfig::Caching |
-            ShibTargetConfig::Metadata |
-            ShibTargetConfig::Trust |
-            ShibTargetConfig::Credentials |
-            ShibTargetConfig::AAP |
-            ShibTargetConfig::OutOfProcess |
-            (shar_checkonly ? (ShibTargetConfig::InProcess | ShibTargetConfig::RequestMapper) : ShibTargetConfig::Logging)
+        SPConfig::getConfig().setFeatures(
+            SPConfig::Listener |
+            SPConfig::Caching |
+            SPConfig::Metadata |
+            SPConfig::Trust |
+            SPConfig::Credentials |
+            SPConfig::AAP |
+            SPConfig::OutOfProcess |
+            (shar_checkonly ? (SPConfig::InProcess | SPConfig::RequestMapper) : SPConfig::Logging)
             );
         if (!shar_config)
             shar_config=getenv("SHIBCONFIG");
@@ -248,15 +250,15 @@ int main(int argc, char *argv[])
 
     // initialize the shib-target library
     ShibTargetConfig& conf=ShibTargetConfig::getConfig();
-    conf.setFeatures(
-        ShibTargetConfig::Listener |
-        ShibTargetConfig::Caching |
-        ShibTargetConfig::Metadata |
-        ShibTargetConfig::Trust |
-        ShibTargetConfig::Credentials |
-        ShibTargetConfig::AAP |
-        ShibTargetConfig::OutOfProcess |
-        (shar_checkonly ? (ShibTargetConfig::InProcess | ShibTargetConfig::RequestMapper) : ShibTargetConfig::Logging)
+    SPConfig::getConfig().setFeatures(
+        SPConfig::Listener |
+        SPConfig::Caching |
+        SPConfig::Metadata |
+        SPConfig::Trust |
+        SPConfig::Credentials |
+        SPConfig::AAP |
+        SPConfig::OutOfProcess |
+        (shar_checkonly ? (SPConfig::InProcess | SPConfig::RequestMapper) : SPConfig::Logging)
         );
     if (!conf.init(shar_schemadir) || !conf.load(shar_config)) {
         fprintf(stderr, "configuration is invalid, check console for specific problems\n");
index eb8d9d6..c22b912 100644 (file)
 #endif
 
 #include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
 #include <iostream>
 
-using namespace std;
-using namespace saml;
+using namespace shibsp;
 using namespace shibtarget;
+using namespace saml;
+using namespace std;
 
 int main (int argc, char *argv[])
 {
@@ -36,7 +38,7 @@ int main (int argc, char *argv[])
     schemadir=SHIB_SCHEMAS;
 
   ShibTargetConfig& conf=ShibTargetConfig::getConfig();
-  conf.setFeatures(ShibTargetConfig::Listener | ShibTargetConfig::InProcess);
+  SPConfig::getConfig().setFeatures(SPConfig::Listener | SPConfig::InProcess);
   if (!conf.init(schemadir) || !conf.load(config))
       return -10;
 
index 715d852..df0046d 100644 (file)
 
 #include <errno.h>
 #include <sstream>
+#include <shibsp/SPConfig.h>
 
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
+using namespace shibsp;
 using namespace shibtarget;
 using namespace saml;
 using namespace xmltooling;
@@ -153,11 +155,11 @@ SocketListener::SocketListener(const DOMElement* e) : log(&Category::getInstance
     m_shutdown(NULL), m_child_lock(NULL), m_child_wait(NULL), m_socketpool(NULL), m_socket((ShibSocket)0)
 {
     // Are we a client?
-    if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+    if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
         m_socketpool=new SocketPool(*log,this);
     }
     // Are we a server?
-    if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess)) {
+    if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
         m_child_lock = Mutex::create();
         m_child_wait = CondWait::create();
     }
index 849f445..c12fa29 100644 (file)
@@ -242,7 +242,7 @@ Override::Override(const DOMElement* e, Category& log, const Override* base) : m
 Override::~Override()
 {
     delete m_acl;
-    for_each(m_map.begin(),m_map.end(),cleanup_pair<string,Override>());
+    for_each(m_map.begin(),m_map.end(),xmltooling::cleanup_pair<string,Override>());
 }
 
 pair<bool,bool> Override::getBool(const char* name, const char* ns) const
index 337ddba..e68ed96 100644 (file)
 #define SHIBT_LOGCAT "shibtarget"
 #define SHIBTRAN_LOGCAT "Shibboleth-TRANSACTION"
 
-// Controls default logging level of console tools and other situations
-// where full shibboleth.xml-based logging isn't used.
-#define SHIB_LOGGING "WARN"
-
 namespace shibtarget {
     // Generic class, which handles the IPropertySet configuration interface.
     // Most of the basic configuration details are exposed via this interface.
index a763f1e..1cea2d1 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include <log4cpp/Category.hh>
+#include <shibsp/SPConfig.h>
 
 #include <ctime>
 #include <algorithm>
@@ -37,6 +38,7 @@
 #include <dmalloc.h>
 #endif
 
+using namespace shibsp;
 using namespace shibtarget;
 using namespace shibboleth;
 using namespace saml;
@@ -425,7 +427,7 @@ MemorySessionCacheEntry::MemorySessionCacheEntry(
 
         // Save actual objects only if we're running inprocess. The subject needs to be
         // owned by the entry, so we'll defer creation of a cloned copy.
-        if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+        if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
             if (m_obj["tokens.filtered"].isstring())
                 m_pFiltered=filtered.release();
         }
@@ -504,7 +506,7 @@ MemorySessionCacheEntry::MemorySessionCacheEntry(
             m_obj.addmember("tokens.filtered").string(fstr.c_str());
 
         // Save actual objects only if we're running inprocess.
-        if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+        if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
             m_pUnfiltered=unfiltered.release();
             if (m_obj["tokens.filtered"].isstring())
                 m_pFiltered=filtered.release();
@@ -680,7 +682,7 @@ void MemorySessionCacheEntry::populate(const IApplication* application, const IE
                         m_obj.addmember("tokens.filtered").string(fstr.c_str());
                     
                     // Save actual objects only if we're running inprocess.
-                    if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+                    if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
                         m_pUnfiltered=respFromSink.release();
                         if (m_obj["tokens.filtered"].isstring())
                             m_pFiltered=filteredFromSink.release();
@@ -735,7 +737,7 @@ void MemorySessionCacheEntry::populate(const IApplication* application, const IE
             m_responseExpiration=calculateExpiration(*new_responses.second);
 
             // Save actual objects only if we're running inprocess.
-            if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+            if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
                 m_pUnfiltered=r1.release();
                 if (m_obj["tokens.filtered"].isstring())
                     m_pFiltered=r2.release();
@@ -1060,7 +1062,7 @@ MemorySessionCache::MemorySessionCache(const DOMElement* e)
 
     // Register for remoted messages.
     IListener* listener=ShibTargetConfig::getConfig().getINI()->getListener();
-    if (listener && ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess)) {
+    if (listener && SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
         restoreInsert=listener->regListener("SessionCache::insert",this);
         restoreFind=listener->regListener("SessionCache::find",this);
         restoreRemove=listener->regListener("SessionCache::remove",this);
@@ -1082,13 +1084,13 @@ MemorySessionCache::~MemorySessionCache()
 
     // Unregister remoted messages.
     IListener* listener=ShibTargetConfig::getConfig().getINI()->getListener();
-    if (listener && ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess)) {
+    if (listener && SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
         listener->unregListener("SessionCache::insert",this,restoreInsert);
         listener->unregListener("SessionCache::find",this,restoreFind);
         listener->unregListener("SessionCache::remove",this,restoreRemove);
     }
 
-    for_each(m_hashtable.begin(),m_hashtable.end(),shibtarget::cleanup_pair<string,MemorySessionCacheEntry>());
+    for_each(m_hashtable.begin(),m_hashtable.end(),xmltooling::cleanup_pair<string,MemorySessionCacheEntry>());
     delete m_lock;
     delete shutdown_wait;
 }
@@ -1575,7 +1577,7 @@ void* MemorySessionCache::cleanup_fcn(void* cache_p)
 IPlugIn* MemoryCacheFactory(const DOMElement* e)
 {
     // If this is a long-lived process, we return the "real" cache.
-    if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess))
+    if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess))
         return new MemorySessionCache(e);
     // Otherwise, we return a stubbed front-end that remotes calls to the real cache.
     return new StubCache(e);
index bd04094..8f82e9e 100644 (file)
  */
 
 #include "internal.h"
-#include <saml/SAMLConfig.h>
 #include <saml/util/SAMLConstants.h>
+#include <shibsp/SPConfig.h>
 #include <xmltooling/XMLToolingConfig.h>
 #include <xmltooling/util/NDC.h>
-#include <xmltooling/util/TemplateEngine.h>
 
 #include <log4cpp/OstreamAppender.hh>
 
+using namespace shibsp;
 using namespace shibtarget;
 using namespace shibboleth;
 using namespace saml;
 using namespace log4cpp;
 using namespace std;
 
-using xmltooling::TemplateEngine;
 using xmltooling::XMLToolingConfig;
 
 namespace {
@@ -69,12 +68,6 @@ ShibTargetConfig& ShibTargetConfig::getConfig()
 
 bool STConfig::init(const char* schemadir)
 {
-    // Chain this to XMLTooling for now...
-    const char* loglevel=getenv("SHIB_LOGGING");
-    if (!loglevel)
-        loglevel = SHIB_LOGGING;
-    XMLToolingConfig::getConfig().log_config(loglevel);
 #ifdef _DEBUG
     xmltooling::NDC ndc("init");
 #endif
@@ -90,30 +83,14 @@ bool STConfig::init(const char* schemadir)
     SAMLConfig& samlConf=SAMLConfig::getConfig();
     if (schemadir)
         samlConf.schema_dir = schemadir;
-    try {
-        if (!samlConf.init() || !opensaml::SAMLConfig::getConfig().init()) {
-            log.fatal("Failed to initialize SAML Library");
-            return false;
-        }
-    }
-    catch (...) {
-        log.fatal("Died initializing SAML Library");
+    if (!samlConf.init() || !SPConfig::getConfig().init(NULL)) {
+        log.fatal("failed to initialize SP library");
         return false;
     }
 
-    XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine());
-    XMLToolingConfig::getConfig().getTemplateEngine()->setTagPrefix("shibmlp");
-    
     ShibConfig& shibConf=ShibConfig::getConfig();
-    try { 
-        if (!shibConf.init()) {
-            log.fatal("Failed to initialize Shib library");
-            samlConf.term();
-            return false;
-        }
-    }
-    catch (...) {
-        log.fatal("Died initializing Shib library.");
+    if (!shibConf.init()) {
+        log.fatal("Failed to initialize Shib library");
         samlConf.term();
         return false;
     }
@@ -175,7 +152,7 @@ bool STConfig::load(const char* config)
         pair<bool,unsigned int> skew=m_ini->getUnsignedInt("clockSkew");
         SAMLConfig::getConfig().clock_skew_secs=skew.first ? skew.second : 180;
         if (skew.first)
-            xmltooling::XMLToolingConfig::getConfig().clock_skew_secs=skew.second;
+            XMLToolingConfig::getConfig().clock_skew_secs=skew.second;
         
         m_tranLog=new FixedContextCategory(SHIBTRAN_LOGCAT);
         m_tranLog->info("opened transaction log");
@@ -211,7 +188,7 @@ void STConfig::shutdown()
     delete m_ini;
     m_ini = NULL;
     ShibConfig::getConfig().term();
-    opensaml::SAMLConfig::getConfig().term();
     SAMLConfig::getConfig().term();
+    SPConfig::getConfig().term();
     log.info("library shutdown complete");
 }
index afe59e3..5d752b3 100644 (file)
  */
 
 #include "internal.h"
+
 #include <ctime>
 #include <saml/util/CommonDomainCookie.h>
+#include <shibsp/SPConfig.h>
 
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+using namespace shibsp;
 using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
 using namespace log4cpp;
+using namespace std;
 
 using opensaml::CommonDomainCookie;
 
@@ -234,7 +237,7 @@ SAML1Consumer::SAML1Consumer(const DOMElement* e)
     m_address += "::SAML1Consumer::run";
 
     // Register for remoted messages.
-    if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess)) {
+    if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
         IListener* listener=ShibTargetConfig::getConfig().getINI()->getListener();
         if (listener)
             listener->regListener(m_address.c_str(),this);
@@ -246,7 +249,7 @@ SAML1Consumer::SAML1Consumer(const DOMElement* e)
 SAML1Consumer::~SAML1Consumer()
 {
     IListener* listener=ShibTargetConfig::getConfig().getINI()->getListener();
-    if (listener && ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess))
+    if (listener && SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess))
         listener->unregListener(m_address.c_str(),this);
     counter--;
 }
index 1c487cc..06f8207 100644 (file)
 
 #include "internal.h"
 
+#include <shibsp/SPConfig.h>
 #include <log4cpp/Category.hh>
 #include <log4cpp/PropertyConfigurator.hh>
 #include <algorithm>
 #include <sys/types.h>
 #include <sys/stat.h>
 
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+using namespace shibsp;
 using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
 using namespace log4cpp;
+using namespace std;
 
 namespace shibtarget {
 
@@ -211,7 +213,7 @@ XMLPropertySet::~XMLPropertySet()
 {
     for (map<string,pair<char*,const XMLCh*> >::iterator i=m_map.begin(); i!=m_map.end(); i++)
         XMLString::release(&(i->second.first));
-    for_each(m_nested.begin(),m_nested.end(),shibtarget::cleanup_pair<string,IPropertySet>());
+    for_each(m_nested.begin(),m_nested.end(),xmltooling::cleanup_pair<string,IPropertySet>());
 }
 
 void XMLPropertySet::load(
@@ -418,7 +420,7 @@ XMLApplication::XMLApplication(
         m_hash+=getString("providerId").second;
         m_hash=SAMLArtifact::toHex(SAMLArtifactType0001::generateSourceId(m_hash.c_str()));
 
-        ShibTargetConfig& conf=ShibTargetConfig::getConfig();
+        SPConfig& conf=SPConfig::getConfig();
         SAMLConfig& shibConf=SAMLConfig::getConfig();
 
         // Process handlers.
@@ -562,7 +564,7 @@ XMLApplication::XMLApplication(
         // Always include our own providerId as an audience.
         m_audiences.push_back(getXMLString("providerId").second);
 
-        if (conf.isEnabled(ShibTargetConfig::AAP)) {
+        if (conf.isEnabled(SPConfig::AAP)) {
             nlist=e->getElementsByTagNameNS(shibtarget::XML::SHIBTARGET_NS,SHIBT_L(AAPProvider));
             for (i=0; nlist && i<nlist->getLength(); i++) {
                 if (nlist->item(i)->getParentNode()->isSameNode(e)) {
@@ -585,7 +587,7 @@ XMLApplication::XMLApplication(
             }
         }
 
-        if (conf.isEnabled(ShibTargetConfig::Metadata)) {
+        if (conf.isEnabled(SPConfig::Metadata)) {
             nlist=e->getElementsByTagNameNS(shibtarget::XML::SHIBTARGET_NS,SHIBT_L(MetadataProvider));
             for (i=0; nlist && i<nlist->getLength(); i++) {
                 if (nlist->item(i)->getParentNode()->isSameNode(e)) {
@@ -628,7 +630,7 @@ XMLApplication::XMLApplication(
             }
         }
 
-        if (conf.isEnabled(ShibTargetConfig::Trust)) {
+        if (conf.isEnabled(SPConfig::Trust)) {
             nlist=e->getElementsByTagNameNS(shibtarget::XML::SHIBTARGET_NS,SHIBT_L(TrustProvider));
             for (i=0; nlist && i<nlist->getLength(); i++) {
                 if (nlist->item(i)->getParentNode()->isSameNode(e)) {
@@ -665,7 +667,7 @@ XMLApplication::XMLApplication(
             }
         }
         
-        if (conf.isEnabled(ShibTargetConfig::OutOfProcess)) {
+        if (conf.isEnabled(SPConfig::OutOfProcess)) {
             // Really finally, build local browser profile and binding objects.
             m_profile=new ShibBrowserProfile(
                 this,
@@ -704,18 +706,18 @@ void XMLApplication::cleanup()
     delete m_bindingHook;
     delete m_binding;
     delete m_profile;
-    for_each(m_handlers.begin(),m_handlers.end(),shibtarget::cleanup<IHandler>());
+    for_each(m_handlers.begin(),m_handlers.end(),xmltooling::cleanup<IHandler>());
         
     delete m_credDefault;
 #ifdef HAVE_GOOD_STL
-    for_each(m_credMap.begin(),m_credMap.end(),shibtarget::cleanup_pair<xstring,XMLPropertySet>());
+    for_each(m_credMap.begin(),m_credMap.end(),xmltooling::cleanup_pair<xstring,XMLPropertySet>());
 #else
-    for_each(m_credMap.begin(),m_credMap.end(),shibtarget::cleanup_pair<const XMLCh*,XMLPropertySet>());
+    for_each(m_credMap.begin(),m_credMap.end(),xmltooling::cleanup_pair<const XMLCh*,XMLPropertySet>());
 #endif
-    for_each(m_designators.begin(),m_designators.end(),shibtarget::cleanup<SAMLAttributeDesignator>());
-    for_each(m_aaps.begin(),m_aaps.end(),shibtarget::cleanup<IAAP>());
-    for_each(m_metadatas.begin(),m_metadatas.end(),shibtarget::cleanup<IMetadata>());
-    for_each(m_trusts.begin(),m_trusts.end(),shibtarget::cleanup<ITrust>());
+    for_each(m_designators.begin(),m_designators.end(),xmltooling::cleanup<SAMLAttributeDesignator>());
+    for_each(m_aaps.begin(),m_aaps.end(),xmltooling::cleanup<IAAP>());
+    for_each(m_metadatas.begin(),m_metadatas.end(),xmltooling::cleanup<IMetadata>());
+    for_each(m_trusts.begin(),m_trusts.end(),xmltooling::cleanup<ITrust>());
 }
 
 short XMLApplication::acceptNode(const DOMNode* node) const
@@ -1000,7 +1002,7 @@ void XMLConfigImpl::init(bool first)
         }
 
         SAMLConfig& shibConf=SAMLConfig::getConfig();
-        ShibTargetConfig& conf=ShibTargetConfig::getConfig();
+        SPConfig& conf=SPConfig::getConfig();
         const DOMElement* SHAR=saml::XML::getFirstChildElement(ReloadableXMLFileImpl::m_root,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(SHAR));
         if (!SHAR)
             SHAR=saml::XML::getFirstChildElement(ReloadableXMLFileImpl::m_root,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Global));
@@ -1013,11 +1015,11 @@ void XMLConfigImpl::init(bool first)
             SHIRE=saml::XML::getFirstChildElement(ReloadableXMLFileImpl::m_root,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(InProcess));
 
         // Initialize log4cpp manually in order to redirect log messages as soon as possible.
-        if (conf.isEnabled(ShibTargetConfig::Logging)) {
+        if (conf.isEnabled(SPConfig::Logging)) {
             const XMLCh* logger=NULL;
-            if (conf.isEnabled(ShibTargetConfig::OutOfProcess))
+            if (conf.isEnabled(SPConfig::OutOfProcess))
                 logger=SHAR->getAttributeNS(NULL,SHIBT_L(logger));
-            else if (conf.isEnabled(ShibTargetConfig::InProcess))
+            else if (conf.isEnabled(SPConfig::InProcess))
                 logger=SHIRE->getAttributeNS(NULL,SHIBT_L(logger));
             if (!logger || !*logger)
                 logger=ReloadableXMLFileImpl::m_root->getAttributeNS(NULL,SHIBT_L(logger));
@@ -1067,7 +1069,7 @@ void XMLConfigImpl::init(bool first)
                 }
             }
             
-            if (conf.isEnabled(ShibTargetConfig::OutOfProcess)) {
+            if (conf.isEnabled(SPConfig::OutOfProcess)) {
                 exts=saml::XML::getFirstChildElement(SHAR,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Extensions));
                 if (exts) {
                     exts=saml::XML::getFirstChildElement(exts,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Library));
@@ -1091,7 +1093,7 @@ void XMLConfigImpl::init(bool first)
                 }
             }
 
-            if (conf.isEnabled(ShibTargetConfig::InProcess)) {
+            if (conf.isEnabled(SPConfig::InProcess)) {
                 exts=saml::XML::getFirstChildElement(SHIRE,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Extensions));
                 if (exts) {
                     exts=saml::XML::getFirstChildElement(exts,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Library));
@@ -1116,7 +1118,7 @@ void XMLConfigImpl::init(bool first)
             }
             
             // Instantiate the Listener and SessionCache objects.
-            if (conf.isEnabled(ShibTargetConfig::Listener)) {
+            if (conf.isEnabled(SPConfig::Listener)) {
                 IPlugIn* plugin=NULL;
                 exts=saml::XML::getFirstChildElement(SHAR,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(UnixListener));
                 if (exts) {
@@ -1154,9 +1156,9 @@ void XMLConfigImpl::init(bool first)
                 }
             }
 
-            if (conf.isEnabled(ShibTargetConfig::Caching)) {
+            if (conf.isEnabled(SPConfig::Caching)) {
                 IPlugIn* plugin=NULL;
-                const DOMElement* container=conf.isEnabled(ShibTargetConfig::OutOfProcess) ? SHAR : SHIRE;
+                const DOMElement* container=conf.isEnabled(SPConfig::OutOfProcess) ? SHAR : SHIRE;
                 exts=saml::XML::getFirstChildElement(container,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(MemorySessionCache));
                 if (exts) {
                     log.info("building Session Cache of type %s...",shibtarget::XML::MemorySessionCacheType);
@@ -1200,7 +1202,7 @@ void XMLConfigImpl::init(bool first)
                 }
                 
                 // Replay cache.
-                container=conf.isEnabled(ShibTargetConfig::OutOfProcess) ? SHAR : SHIRE;
+                container=conf.isEnabled(SPConfig::OutOfProcess) ? SHAR : SHIRE;
                 exts=saml::XML::getFirstChildElement(container,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(ODBCReplayCache));
                 if (exts) {
                     log.info("building Replay Cache of type %s...",shibtarget::XML::ODBCReplayCacheType);
@@ -1230,7 +1232,7 @@ void XMLConfigImpl::init(bool first)
         }
         
         // Back to the fully dynamic stuff...next up is the Request Mapper.
-        if (conf.isEnabled(ShibTargetConfig::RequestMapper)) {
+        if (conf.isEnabled(SPConfig::RequestMapper)) {
             const DOMElement* child=saml::XML::getFirstChildElement(SHIRE,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(RequestMapProvider));
             if (child) {
                 auto_ptr_char type(child->getAttributeNS(NULL,SHIBT_L(type)));
@@ -1255,7 +1257,7 @@ void XMLConfigImpl::init(bool first)
         
         // Now we load any credentials providers.
         DOMNodeList* nlist;
-        if (conf.isEnabled(ShibTargetConfig::Credentials)) {
+        if (conf.isEnabled(SPConfig::Credentials)) {
             nlist=ReloadableXMLFileImpl::m_root->getElementsByTagNameNS(shibtarget::XML::SHIBTARGET_NS,SHIBT_L(CredentialsProvider));
             for (unsigned int i=0; nlist && i<nlist->getLength(); i++) {
                 auto_ptr_char type(static_cast<DOMElement*>(nlist->item(i))->getAttributeNS(NULL,SHIBT_L(type)));
@@ -1341,8 +1343,8 @@ void XMLConfigImpl::init(bool first)
 XMLConfigImpl::~XMLConfigImpl()
 {
     delete m_requestMapper;
-    for_each(m_appmap.begin(),m_appmap.end(),cleanup_pair<string,IApplication>());
-    for_each(m_creds.begin(),m_creds.end(),cleanup<ICredentials>());
+    for_each(m_appmap.begin(),m_appmap.end(),xmltooling::cleanup_pair<string,IApplication>());
+    for_each(m_creds.begin(),m_creds.end(),xmltooling::cleanup<ICredentials>());
     ShibConfig::getConfig().clearAttributeMappings();
-    for_each(m_attrFactories.begin(),m_attrFactories.end(),cleanup<IAttributeFactory>());
+    for_each(m_attrFactories.begin(),m_attrFactories.end(),xmltooling::cleanup<IAttributeFactory>());
 }
index 9cefe6e..a30898d 100644 (file)
@@ -362,36 +362,19 @@ namespace shibtarget {
     class SHIBTARGET_EXPORTS ShibTargetConfig
     {
     public:
-        ShibTargetConfig() : m_ini(NULL), m_features(0) {}
+        ShibTargetConfig() : m_ini(NULL) {}
         virtual ~ShibTargetConfig() {}
         
         virtual bool init(const char* schemadir) = 0;
         virtual bool load(const char* config) = 0;
         virtual void shutdown() = 0;
 
-        enum components_t {
-            Listener = 1,
-            Caching = 2,
-            Metadata = 4,
-            Trust = 8,
-            Credentials = 16,
-            AAP = 32,
-            RequestMapper = 64,
-            OutOfProcess = 128,
-            InProcess = 256,
-            Logging = 512
-        };
-        void setFeatures(long enabled) {m_features = enabled;}
-        bool isEnabled(components_t feature) {return (m_features & feature)>0;}
         virtual IConfig* getINI() const {return m_ini;}
 
         static ShibTargetConfig& getConfig();
 
     protected:
         IConfig* m_ini;
-        
-    private:
-        unsigned long m_features;
     };
 
     class ShibTargetPriv;
@@ -681,19 +664,6 @@ namespace shibtarget {
             static const XMLCh UnixListener[];
         };
     };
-
-
-    // Template cleanup functors for use with for_each algorithm
-    template<class T> struct cleanup
-    {
-        void operator()(T* ptr) {delete ptr;}
-        void operator()(const T* ptr) {delete const_cast<T*>(ptr);}
-    };
-
-    template<class A,class B> struct cleanup_pair
-    {
-        void operator()(std::pair<A,B*> p) {delete p.second;}
-    };
 }
 
 #endif /* SHIB_TARGET_H */
index d7a4d4d..157a69d 100644 (file)
@@ -1 +1,2 @@
 /*.user
+/Debug
diff --git a/shibsp/Makefile.am b/shibsp/Makefile.am
new file mode 100644 (file)
index 0000000..5e8fc11
--- /dev/null
@@ -0,0 +1,39 @@
+AUTOMAKE_OPTIONS = foreign
+
+pkgsysconfdir = $(sysconfdir)/@PACKAGE@
+xmldir = $(datadir)/xml
+
+lib_LTLIBRARIES = libshibsp.la
+
+libshibspincludedir = $(includedir)/shibsp
+
+libshibspinclude_HEADERS = \
+       base.h \
+       exceptions.h \
+       paths.h \
+       version.h \
+       SPConfig.h
+
+noinst_HEADERS = \
+       internal.h
+
+libshibsp_la_SOURCES = \
+       SPConfig.cpp
+
+# this is different from the project version
+# http://sources.redhat.com/autobook/autobook/autobook_91.html
+libshibsp_la_LDFLAGS = -version-info 1:0:0
+
+paths.h: ${srcdir}/paths.h.in Makefile ${top_builddir}/config.status
+       rm -f $@.tmp
+       sed < ${srcdir}/$@.in > $@.tmp \
+           -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:' \
+           -e 's:@-XMLDIR-@:${xmldir}:'
+       cmp -s $@ $@.tmp || mv $@.tmp $@
+       rm -f $@.tmp
+
+install-exec-hook:
+       for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done
+
+EXTRA_DIST = shibsp.vcproj paths.h.in
+BUILT_SOURCES = paths.h
diff --git a/shibsp/SPConfig.cpp b/shibsp/SPConfig.cpp
new file mode 100644 (file)
index 0000000..125c995
--- /dev/null
@@ -0,0 +1,105 @@
+
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * SPConfig.cpp
+ * 
+ * Library configuration 
+ */
+
+#include "internal.h"
+#include "exceptions.h"
+#include "SPConfig.h"
+
+#include <log4cpp/Category.hh>
+#include <saml/SAMLConfig.h>
+#include <xmltooling/util/NDC.h>
+#include <xmltooling/util/TemplateEngine.h>
+
+using namespace shibsp;
+using namespace opensaml;
+using namespace xmltooling;
+using namespace log4cpp;
+
+DECL_XMLTOOLING_EXCEPTION_FACTORY(ConfigurationException,shibsp);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
+
+namespace shibsp {
+   SPInternalConfig g_config;
+}
+
+SPConfig& SPConfig::getConfig()
+{
+    return g_config;
+}
+
+SPInternalConfig& SPInternalConfig::getInternalConfig()
+{
+    return g_config;
+}
+
+void SPConfig::setServiceProvider(ServiceProvider* serviceProvider)
+{
+    //delete m_serviceProvider;
+    m_serviceProvider = serviceProvider;
+}
+
+bool SPInternalConfig::init(const char* catalog_path)
+{
+#ifdef _DEBUG
+    NDC ndc("init");
+#endif
+    Category& log=Category::getInstance(SHIBSP_LOGCAT".Config");
+    log.debug("library initialization started");
+
+    const char* loglevel=getenv("SHIBSP_LOGGING");
+    if (!loglevel)
+        loglevel = SHIBSP_LOGGING;
+    XMLToolingConfig::getConfig().log_config(loglevel);
+
+    if (catalog_path)
+        XMLToolingConfig::getConfig().catalog_path = catalog_path;
+
+    if (!SAMLConfig::getConfig().init()) {
+        log.fatal("failed to initialize OpenSAML library");
+        return false;
+    }
+
+    XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine());
+    XMLToolingConfig::getConfig().getTemplateEngine()->setTagPrefix("shibmlp");
+    
+    REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ConfigurationException,shibsp);
+    REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
+
+    log.info("library initialization complete");
+    return true;
+}
+
+void SPInternalConfig::term()
+{
+#ifdef _DEBUG
+    NDC ndc("term");
+#endif
+    Category& log=Category::getInstance(SHIBSP_LOGCAT".Config");
+    log.info("shutting down the library");
+
+    //delete m_serviceProvider;
+    m_serviceProvider = NULL;
+
+    SAMLConfig::getConfig().term();
+    log.info("library shutdown complete");
+}
diff --git a/shibsp/SPConfig.h b/shibsp/SPConfig.h
new file mode 100644 (file)
index 0000000..44d32cc
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file shibsp/SPConfig.h
+ * 
+ * Library configuration 
+ */
+
+#ifndef __shibsp_config_h__
+#define __shibsp_config_h__
+
+#include <shibsp/base.h>
+
+/**
+ * @namespace shibsp
+ * Shibboleth Service Provider Library
+ */
+namespace shibsp {
+
+    class SHIBSP_API ServiceProvider;
+
+    /**
+     * Singleton object that manages library startup/shutdown.
+     */
+    class SHIBSP_API SPConfig
+    {
+    MAKE_NONCOPYABLE(SPConfig);
+    public:
+        virtual ~SPConfig() {}
+
+        /**
+         * Returns the global configuration object for the library.
+         * 
+         * @return reference to the global library configuration object
+         */
+        static SPConfig& getConfig();
+
+        /**
+         * Bitmask values representing subsystems of the library.
+         */
+        enum components_t {
+            Listener = 1,
+            Caching = 2,
+            Metadata = 4,
+            Trust = 8,
+            Credentials = 16,
+            AAP = 32,
+            RequestMapper = 64,
+            OutOfProcess = 128,
+            InProcess = 256,
+            Logging = 512
+        };
+        
+        /**
+         * Set a bitmask of subsystems to activate.
+         * 
+         * @param enabled   bitmask of component constants
+         */
+        void setFeatures(unsigned long enabled) {
+            m_features = enabled;
+        }
+
+        /**
+         * Test whether a subsystem is enabled.
+         * 
+         * @param feature   subsystem/component to test
+         * @return true iff feature is enabled
+         */
+        bool isEnabled(components_t feature) {
+            return (m_features & feature)>0;
+        }
+        
+        /**
+         * Initializes library
+         * 
+         * Each process using the library MUST call this function exactly once
+         * before using any library classes.
+         * 
+         * @param catalog_path  delimited set of schema catalog files to load
+         * @return true iff initialization was successful 
+         */
+        virtual bool init(const char* catalog_path)=0;
+        
+        /**
+         * Shuts down library
+         * 
+         * Each process using the library SHOULD call this function exactly once
+         * before terminating itself.
+         */
+        virtual void term()=0;
+        
+        /**
+         * Sets the global ServiceProvider instance.
+         * This method must be externally synchronized with any code that uses the object.
+         * Any previously set object is destroyed.
+         * 
+         * @param serviceProvider   new ServiceProvider instance to store
+         */
+        void setServiceProvider(ServiceProvider* serviceProvider);
+        
+        /**
+         * Returns the global ServiceProvider instance.
+         * 
+         * @return  global ServiceProvider or NULL
+         */
+        ServiceProvider* getServiceProvider() const {
+            return m_serviceProvider;
+        }
+
+    protected:
+        SPConfig() : m_serviceProvider(NULL) {}
+        
+        /** Global ServiceProvider instance. */
+        ServiceProvider* m_serviceProvider;
+
+    private:
+        unsigned long m_features;
+    };
+
+};
+
+#endif /* __shibsp_config_h__ */
diff --git a/shibsp/base.h b/shibsp/base.h
new file mode 100644 (file)
index 0000000..774d7a1
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file shibsp/base.h
+ * 
+ * Base header file definitions
+ * Must be included prior to including any other header
+ */
+
+#ifndef __shibsp_base_h__
+#define __shibsp_base_h__
+
+#include <saml/base.h>
+
+// Windows and GCC4 Symbol Visibility Macros
+#ifdef WIN32
+  #define SHIBSP_IMPORT __declspec(dllimport)
+  #define SHIBSP_EXPORT __declspec(dllexport)
+  #define SHIBSP_DLLLOCAL
+  #define SHIBSP_DLLPUBLIC
+#else
+  #define SHIBSP_IMPORT
+  #ifdef GCC_HASCLASSVISIBILITY
+    #define SHIBSP_EXPORT __attribute__ ((visibility("default")))
+    #define SHIBSP_DLLLOCAL __attribute__ ((visibility("hidden")))
+    #define SHIBSP_DLLPUBLIC __attribute__ ((visibility("default")))
+  #else
+    #define SHIBSP_EXPORT
+    #define SHIBSP_DLLLOCAL
+    #define SHIBSP_DLLPUBLIC
+  #endif
+#endif
+
+// Define SHIBSP_API for DLL builds
+#ifdef SHIBSP_EXPORTS
+  #define SHIBSP_API SHIBSP_EXPORT
+#else
+  #define SHIBSP_API SHIBSP_IMPORT
+#endif
+
+// Throwable classes must always be visible on GCC in all binaries
+#ifdef WIN32
+  #define SHIBSP_EXCEPTIONAPI(api) api
+#elif defined(GCC_HASCLASSVISIBILITY)
+  #define SHIBSP_EXCEPTIONAPI(api) SHIBSP_EXPORT
+#else
+  #define SHIBSP_EXCEPTIONAPI(api)
+#endif
+
+#ifdef WIN32
+
+/**
+ * Default catalog path on Windows.
+ */
+# define SHIBSP_SCHEMAS "/opt/shibboleth-sp/share/xml/xmltooling/catalog.xml;/opt/shibboleth-sp/share/xml/opensaml/catalog.xml;/opt/shibboleth-sp/share/xml/shibboleth/catalog.xml"
+
+/**
+ * Default path to configuration file on Windows.
+ */
+# define SHIBSP_CONFIG "/opt/shibboleth-sp/etc/shibboleth/shibboleth.xml"
+
+#else
+# include <shibsp/paths.h>
+#endif
+
+/**
+ * Logging category for Service Provider functions.
+ */
+#define SHIBSP_LOGCAT "Shibboleth.SP"
+
+/**
+ * Logging category for Service Provider auditing.
+ */
+#define SHIBSP_TX_LOGCAT "Shibboleth-TRANSACTION"
+
+/**
+ * Controls default logging level of console tools and other situations
+ * where fully-configured logging isn't used.
+ */
+#define SHIBSP_LOGGING "WARN"
+
+#endif /* __shibsp_base_h__ */
diff --git a/shibsp/exceptions.h b/shibsp/exceptions.h
new file mode 100644 (file)
index 0000000..536ec80
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file shibsp/exceptions.h
+ * 
+ * Exception classes
+ */
+#ifndef __shibsp_exceptions_h__
+#define __shibsp_exceptions_h__
+
+#include <shibsp/base.h>
+#include <saml/exceptions.h>
+
+namespace shibsp {
+    
+    DECL_XMLTOOLING_EXCEPTION(ConfigurationException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,xmltooling::XMLToolingException,Exceptions during configuration.);
+    DECL_XMLTOOLING_EXCEPTION(ListenerException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,xmltooling::XMLToolingException,Exceptions during inter-process communication.);
+
+};
+
+#endif /* __shibsp_exceptions_h__ */
diff --git a/shibsp/internal.h b/shibsp/internal.h
new file mode 100644 (file)
index 0000000..13f2598
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ *  Copyright 2001-2005 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *  internal.h - internally visible classes
+ */
+
+#ifndef __shibsp_internal_h__
+#define __shibsp_internal_h__
+
+#ifdef WIN32
+# define _CRT_SECURE_NO_DEPRECATE 1
+# define _CRT_NONSTDC_NO_DEPRECATE 1
+#endif
+
+// Export public APIs
+#define SHIBSP_EXPORTS
+
+// eventually we might be able to support autoconf via cygwin...
+#if defined (_MSC_VER) || defined(__BORLANDC__)
+# include "config_win32.h"
+#else
+# include "config.h"
+#endif
+
+#include "base.h"
+#include "SPConfig.h"
+
+namespace shibsp {
+    
+    /// @cond OFF
+    class SPInternalConfig : public SPConfig
+    {
+    public:
+        SPInternalConfig() {}
+
+        static SPInternalConfig& getInternalConfig();
+
+        bool init(const char* catalog_path);
+        void term();
+
+    private:
+    };
+    /// @endcond
+
+};
+
+#endif /* __shibsp_internal_h__ */
diff --git a/shibsp/paths.h.in b/shibsp/paths.h.in
new file mode 100644 (file)
index 0000000..e6cebd3
--- /dev/null
@@ -0,0 +1,36 @@
+/*\r
+ *  Copyright 2001-2005 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @file shibsp/paths.h\r
+ * \r
+ * Default configuration paths.\r
+ */\r
+\r
+#ifndef __shibsp_paths_h__\r
+#define __shibsp_paths_h__\r
+\r
+/**\r
+ * Default schema catalogs.\r
+ */\r
+#define SHIBSP_SCHEMAS "@-XMLDIR-@/xmltooling/catalog.xml:@-XMLDIR-@/opensaml/catalog.xml:@-XMLDIR-@/shibboleth/catalog.xml"\r
+\r
+/**\r
+ * Default location of SP configuration file.\r
+ */\r
+#define SHIBSP_CONFIG "@-PKGSYSCONFDIR-@/shibboleth.xml"\r
+\r
+#endif /* __shibsp_paths_h__ */\r
index ba8a96d..803a9a2 100644 (file)
@@ -67,7 +67,7 @@
                                AdditionalLibraryDirectories="&quot;..\..\cpp-opensaml1\saml\Debug&quot;;&quot;..\..\cpp-opensaml2\Debug&quot;;&quot;..\..\cpp-xmltooling\Debug&quot;"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
-                               ImportLibrary="$(TargetDir)$(TargetName)1D.lib"\r
+                               ImportLibrary="$(TargetDir)$(ProjectName)1D.lib"\r
                                TargetMachine="1"\r
                        />\r
                        <Tool\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
-                               ImportLibrary="$(TargetDir)$(TargetName)1.lib"\r
+                               ImportLibrary="$(TargetDir)$(ProjectName)1.lib"\r
                                TargetMachine="1"\r
                        />\r
                        <Tool\r
                        Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
                        >\r
+                       <File\r
+                               RelativePath=".\SPConfig.cpp"\r
+                               >\r
+                       </File>\r
                </Filter>\r
                <Filter\r
                        Name="Header Files"\r
                        Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
                        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
                        >\r
+                       <File\r
+                               RelativePath=".\base.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\exceptions.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\internal.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\SPConfig.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\version.h"\r
+                               >\r
+                       </File>\r
                </Filter>\r
                <Filter\r
                        Name="Resource Files"\r
diff --git a/shibsp/version.h b/shibsp/version.h
new file mode 100644 (file)
index 0000000..cdb5e95
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * version.h
+ * 
+ * Library version macros and constants 
+ */
+
+#ifndef __shibsp_version_h__
+#define __shibsp_version_h__
+
+// This is all based on Xerces, on the theory it might be useful to
+// support this kind of stuff in the future. If they ever yank some
+// of this stuff, it can be copied into here.
+
+#include <xercesc/util/XercesVersion.hpp>
+
+// ---------------------------------------------------------------------------
+// V E R S I O N   S P E C I F I C A T I O N
+
+/**
+ * MODIFY THESE NUMERIC VALUES TO COINCIDE WITH OPENSAML VERSION
+ * AND DO NOT MODIFY ANYTHING ELSE IN THIS VERSION HEADER FILE
+ */
+
+#define SHIBSP_VERSION_MAJOR 1
+#define SHIBSP_VERSION_MINOR 0
+#define SHIBSP_VERSION_REVISION 0
+
+/** DO NOT MODIFY BELOW THIS LINE */
+
+/**
+ * MAGIC THAT AUTOMATICALLY GENERATES THE FOLLOWING:
+ *
+ *     gShibSPVersionStr, gShibSPFullVersionStr, gShibSPMajVersion, gShibSPMinVersion, gShibSPRevision
+ */
+
+// ---------------------------------------------------------------------------
+// V E R S I O N   I N F O R M A T I O N
+
+// ShibSP version strings; these particular macros cannot be used for
+// conditional compilation as they are not numeric constants
+
+#define SHIBSP_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION)
+#define SHIBSP_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION)
+#define SHIBSP_FULLVERSIONNUM INVK_CAT3_SEP_NIL(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION)
+#define SHIBSP_VERSIONSTR     INVK_CAT2_SEP_UNDERSCORE(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR)
+
+const char* const    gShibSPVersionStr = SHIBSP_VERSIONSTR;
+const char* const    gShibSPFullVersionStr = SHIBSP_FULLVERSIONSTR;
+const unsigned int   gShibSPMajVersion = SHIBSP_VERSION_MAJOR;
+const unsigned int   gShibSPMinVersion = SHIBSP_VERSION_MINOR;
+const unsigned int   gShibSPRevision   = SHIBSP_VERSION_REVISION;
+
+// ShibSP version numeric constants that can be used for conditional
+// compilation purposes.
+
+#define _SHIBSP_VERSION CALC_EXPANDED_FORM (SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION)
+
+#endif /* __shibsp_version_h__ */
index 3ef8143..de8051a 100644 (file)
 #endif
 
 #include <fstream>
-#include "../shib-target/shib-target.h"
+#include <shib-target/shib-target.h>
 
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+#include <shibsp/SPConfig.h>
+
+using namespace shibsp;
 using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
+using namespace std;
 
 int main(int argc,char* argv[])
 {
@@ -65,11 +68,11 @@ int main(int argc,char* argv[])
         a_param="default";
 
     ShibTargetConfig& conf=ShibTargetConfig::getConfig();
-    conf.setFeatures(
-        ShibTargetConfig::Listener |
-        ShibTargetConfig::Metadata |
-        ShibTargetConfig::Trust |
-        ShibTargetConfig::OutOfProcess
+    SPConfig::getConfig().setFeatures(
+        SPConfig::Listener |
+        SPConfig::Metadata |
+        SPConfig::Trust |
+        SPConfig::OutOfProcess
         );
     if (!conf.init(path) || !conf.load(config))
         return -10;
index f7eb72e..1c8724f 100644 (file)
 # define _CRT_SECURE_NO_DEPRECATE 1
 #endif
 
-#include "../shib-target/shib-target.h"
+#include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
 
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+using namespace shibsp;
 using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
+using namespace std;
 
 int main(int argc,char* argv[])
 {
@@ -67,13 +69,13 @@ int main(int argc,char* argv[])
         a_param="default";
 
     ShibTargetConfig& conf=ShibTargetConfig::getConfig();
-    conf.setFeatures(
-        ShibTargetConfig::Metadata |
-        ShibTargetConfig::Trust |
-        ShibTargetConfig::Credentials |
-        ShibTargetConfig::AAP |
-        ShibTargetConfig::OutOfProcess |
-        ShibTargetConfig::Caching
+    SPConfig::getConfig().setFeatures(
+        SPConfig::Metadata |
+        SPConfig::Trust |
+        SPConfig::Credentials |
+        SPConfig::AAP |
+        SPConfig::OutOfProcess |
+        SPConfig::Caching
         );
     if (!conf.init(path) || !conf.load(config))
         return -10;
index cd1f099..89608d9 100644 (file)
@@ -327,7 +327,7 @@ FileResolver::FileResolver(const DOMElement* e)
 FileResolver::~FileResolver()
 {
     for_each(m_certs.begin(),m_certs.end(),X509_free);
-    for_each(m_xseccerts.begin(),m_xseccerts.end(),shibtarget::cleanup<XSECCryptoX509>());
+    for_each(m_xseccerts.begin(),m_xseccerts.end(),xmltooling::cleanup<XSECCryptoX509>());
 }
 
 void FileResolver::attach(void* ctx) const
index a656355..b7c1b93 100644 (file)
@@ -216,9 +216,9 @@ void XMLAAPImpl::init()
 XMLAAPImpl::~XMLAAPImpl()
 {
 #ifdef HAVE_GOOD_STL
-    for_each(m_attrMap.begin(),m_attrMap.end(),shibtarget::cleanup_pair<xstring,AttributeRule>());
+    for_each(m_attrMap.begin(),m_attrMap.end(),xmltooling::cleanup_pair<xstring,AttributeRule>());
 #else
-    for_each(m_attrMap.begin(),m_attrMap.end(),shibtarget::cleanup_pair<string,AttributeRule>());
+    for_each(m_attrMap.begin(),m_attrMap.end(),xmltooling::cleanup_pair<string,AttributeRule>());
 #endif
 }
 
index 6e451bf..04b466a 100644 (file)
@@ -212,7 +212,7 @@ Operator::Operator(const DOMElement* e)
 
 Operator::~Operator()
 {
-    for_each(m_operands.begin(),m_operands.end(),shibtarget::cleanup<IAuthz>());
+    for_each(m_operands.begin(),m_operands.end(),xmltooling::cleanup<IAuthz>());
 }
 
 bool Operator::authorized(ShibTarget* st, ISessionCacheEntry* entry) const
index ed91254..7b5ac5f 100644 (file)
@@ -146,7 +146,7 @@ void XMLCredentialsImpl::init()
 
 XMLCredentialsImpl::~XMLCredentialsImpl()
 {
-    for_each(m_resolverMap.begin(),m_resolverMap.end(),shibtarget::cleanup_pair<string,ICredResolver>());
+    for_each(m_resolverMap.begin(),m_resolverMap.end(),xmltooling::cleanup_pair<string,ICredResolver>());
 }
 
 const ICredResolver* XMLCredentials::lookup(const char* id) const
index 23afb62..9016456 100644 (file)
@@ -598,7 +598,7 @@ XMLMetadataImpl::KeyDescriptor::KeyDescriptor(const DOMElement* e) : m_root(e),
 
 XMLMetadataImpl::KeyDescriptor::~KeyDescriptor()
 {
-    for_each(m_methods.begin(),m_methods.end(),shibtarget::cleanup<XENCEncryptionMethod>());
+    for_each(m_methods.begin(),m_methods.end(),xmltooling::cleanup<XENCEncryptionMethod>());
     delete m_klist;
 }
 
@@ -643,7 +643,7 @@ XMLMetadataImpl::KeyAuthority::KeyAuthority(const DOMElement* e) : m_depth(1)
 
 XMLMetadataImpl::KeyAuthority::~KeyAuthority()
 {
-    for_each(m_klists.begin(),m_klists.end(),shibtarget::cleanup<DSIGKeyInfoList>());
+    for_each(m_klists.begin(),m_klists.end(),xmltooling::cleanup<DSIGKeyInfoList>());
 }
 
 XMLMetadataImpl::Role::Role(const EntityDescriptor* provider, time_t validUntil, const DOMElement* e)
@@ -696,8 +696,8 @@ XMLMetadataImpl::Role::~Role()
     delete m_org;
     delete m_errorURL;
     if (m_protocolEnumCopy) XMLString::release(&m_protocolEnumCopy);
-    for_each(m_keys.begin(),m_keys.end(),shibtarget::cleanup<IKeyDescriptor>());
-    for_each(m_contacts.begin(),m_contacts.end(),shibtarget::cleanup<IContactPerson>());
+    for_each(m_keys.begin(),m_keys.end(),xmltooling::cleanup<IKeyDescriptor>());
+    for_each(m_contacts.begin(),m_contacts.end(),xmltooling::cleanup<IContactPerson>());
 }
 
 bool XMLMetadataImpl::Role::hasSupport(const XMLCh* protocol) const
@@ -827,7 +827,7 @@ XMLMetadataImpl::IDPRole::IDPRole(const EntityDescriptor* provider, time_t valid
 
 XMLMetadataImpl::IDPRole::~IDPRole()
 {
-    for_each(m_attrs.begin(),m_attrs.end(),shibtarget::cleanup<SAMLAttribute>());
+    for_each(m_attrs.begin(),m_attrs.end(),xmltooling::cleanup<SAMLAttribute>());
 }
 
 XMLMetadataImpl::AARole::AARole(const EntityDescriptor* provider, time_t validUntil, const DOMElement* e)
@@ -911,7 +911,7 @@ XMLMetadataImpl::AARole::AARole(const EntityDescriptor* provider, time_t validUn
 
 XMLMetadataImpl::AARole::~AARole()
 {
-    for_each(m_attrs.begin(),m_attrs.end(),shibtarget::cleanup<SAMLAttribute>());
+    for_each(m_attrs.begin(),m_attrs.end(),xmltooling::cleanup<SAMLAttribute>());
 }
 
 XMLMetadataImpl::EntityDescriptor::EntityDescriptor(
@@ -1053,9 +1053,9 @@ const IAttributeAuthorityDescriptor* XMLMetadataImpl::EntityDescriptor::getAttri
 XMLMetadataImpl::EntityDescriptor::~EntityDescriptor()
 {
     delete m_org;
-    for_each(m_contacts.begin(),m_contacts.end(),shibtarget::cleanup<IContactPerson>());
-    for_each(m_roles.begin(),m_roles.end(),shibtarget::cleanup<IRoleDescriptor>());
-    for_each(m_keyauths.begin(),m_keyauths.end(),shibtarget::cleanup<IKeyAuthority>());
+    for_each(m_contacts.begin(),m_contacts.end(),xmltooling::cleanup<IContactPerson>());
+    for_each(m_roles.begin(),m_roles.end(),xmltooling::cleanup<IRoleDescriptor>());
+    for_each(m_keyauths.begin(),m_keyauths.end(),xmltooling::cleanup<IKeyAuthority>());
 }
 
 XMLMetadataImpl::EntitiesDescriptor::EntitiesDescriptor(
@@ -1114,9 +1114,9 @@ XMLMetadataImpl::EntitiesDescriptor::EntitiesDescriptor(
 
 XMLMetadataImpl::EntitiesDescriptor::~EntitiesDescriptor()
 {
-    for_each(m_providers.begin(),m_providers.end(),shibtarget::cleanup<IEntityDescriptor>());
-    for_each(m_groups.begin(),m_groups.end(),shibtarget::cleanup<IEntitiesDescriptor>());
-    for_each(m_keyauths.begin(),m_keyauths.end(),shibtarget::cleanup<IKeyAuthority>());
+    for_each(m_providers.begin(),m_providers.end(),xmltooling::cleanup<IEntityDescriptor>());
+    for_each(m_groups.begin(),m_groups.end(),xmltooling::cleanup<IEntitiesDescriptor>());
+    for_each(m_keyauths.begin(),m_keyauths.end(),xmltooling::cleanup<IKeyAuthority>());
 }
 
 void XMLMetadataImpl::init()
index 63a36c2..ef697da 100644 (file)
@@ -344,8 +344,8 @@ void XMLTrustImpl::init()
 
 XMLTrustImpl::~XMLTrustImpl()
 {
-    for_each(m_keyauths.begin(),m_keyauths.end(),shibtarget::cleanup<KeyAuthority>());
-    for_each(m_keybinds.begin(),m_keybinds.end(),shibtarget::cleanup<DSIGKeyInfoList>());
+    for_each(m_keyauths.begin(),m_keyauths.end(),xmltooling::cleanup<KeyAuthority>());
+    for_each(m_keybinds.begin(),m_keybinds.end(),xmltooling::cleanup<DSIGKeyInfoList>());
 }
 
 XMLTrust::XMLTrust(const DOMElement* e) : ReloadableXMLFile(e), m_delegate(NULL)
@@ -401,7 +401,7 @@ XMLTrust::XMLTrust(const DOMElement* e) : ReloadableXMLFile(e), m_delegate(NULL)
 XMLTrust::~XMLTrust()
 {
     delete m_delegate;
-    for_each(m_resolvers.begin(),m_resolvers.end(),shibtarget::cleanup<KeyInfoResolver>());
+    for_each(m_resolvers.begin(),m_resolvers.end(),xmltooling::cleanup<KeyInfoResolver>());
 }
 
 static int error_callback(int ok, X509_STORE_CTX* ctx)