if test x_$with_xmlsec != x_no; then
if test x_$with_xmlsec != x_/usr; then
- CPPFLAGS="-I${with_xmlsec}/include"
- LDFLAGS="-L${with_xmlsec}/lib"
+ CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
+ LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
fi
XMLSEC_LIBS="-lxml-security-c"
AUTOMAKE_OPTIONS = foreign
if BUILD_XMLSEC
-lib_LTLIBRARIES = libxmltooling-lite.la
-else
lib_LTLIBRARIES = libxmltooling-lite.la libxmltooling.la
+else
+lib_LTLIBRARIES = libxmltooling-lite.la
endif
libxmltoolingincludedir = $(includedir)/xmltooling
util/URLEncoder.cpp \
util/XMLConstants.cpp \
util/XMLHelper.cpp \
- validation/ValidatorSuite.cpp \
- ${xmlsec_sources} \
+ validation/ValidatorSuite.cpp \
$(thread_sources)
libxmltooling_lite_la_SOURCES = \
${common_sources}
-
+libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE
libxmltooling_lite_la_LDFLAGS = -version-info 1:0:0
if BUILD_XMLSEC
-libxmltooling_la_CPPFLAGS = "$(CPPFLAGS) $(XMLSEC_CPPFLAGS)"
-libxmltooling_la_LDFLAGS = "$(LDFLAGS) $(XMLSEC_LDFLAGS) $(XMLSEC_LIBS)"
+libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 1:0:0
libxmltooling_la_SOURCES = \
${common_sources} \
- ${xmlsec_sources} \
- $(thread_sources)
-libxmltooling_la_LDFLAGS = -version-info 1:0:0
+ ${xmlsec_sources}
endif
install-exec-hook:
#include "internal.h"
#include "exceptions.h"
#include "XMLToolingConfig.h"
+#include "encryption/Encryption.h"
#include "encryption/Encrypter.h"
#include "impl/UnknownElement.h"
#include "security/TrustEngine.h"
namespace xmltooling {
static XMLToolingInternalConfig g_config;
+#ifndef XMLTOOLING_NO_XMLSEC
static vector<Mutex*> g_openssl_locks;
extern "C" void openssl_locking_callback(int mode,int n,const char *file,int line)
g_openssl_locks[n]->unlock();
}
- #ifndef WIN32
+# ifndef WIN32
extern "C" unsigned long openssl_thread_id(void)
{
return (unsigned long)(pthread_self());
}
- #endif
+# endif
+#endif
}
XMLToolingConfig& XMLToolingConfig::getConfig()
registerStorageServices();
m_urlEncoder = new URLEncoder();
+#ifndef XMLTOOLING_NO_XMLSEC
m_keyInfoResolver = KeyInfoResolverManager.newPlugin(INLINE_KEYINFO_RESOLVER,NULL);
+#endif
// Register xml:id as an ID attribute.
static const XMLCh xmlid[] = UNICODE_LITERAL_2(i,d);
return false;
}
+#ifndef XMLTOOLING_NO_XMLSEC
// Set up OpenSSL locking.
for (int i=0; i<CRYPTO_num_locks(); i++)
g_openssl_locks.push_back(Mutex::create());
CRYPTO_set_locking_callback(openssl_locking_callback);
-#ifndef WIN32
+# ifndef WIN32
CRYPTO_set_id_callback(openssl_thread_id);
+# endif
#endif
log.info("library initialization complete");
void XMLToolingInternalConfig::term()
{
+#ifndef XMLTOOLING_NO_XMLSEC
CRYPTO_set_locking_callback(NULL);
for_each(g_openssl_locks.begin(), g_openssl_locks.end(), xmltooling::cleanup<Mutex>());
g_openssl_locks.clear();
+#endif
SchemaValidators.destroyValidators();
XMLObjectBuilder::destroyBuilders();
StorageServiceManager.deregisterFactories();
termSOAPTransports();
SOAPTransportManager.deregisterFactories();
+
#ifndef XMLTOOLING_NO_XMLSEC
TrustEngineManager.deregisterFactories();
CredentialResolverManager.deregisterFactories();
KeyInfoResolverManager.deregisterFactories();
m_algorithmMap.clear();
-#endif
delete m_keyInfoResolver;
m_keyInfoResolver = NULL;
+#endif
delete m_replayCache;
m_replayCache = NULL;
{
MAKE_NONCOPYABLE(XMLToolingConfig);
protected:
+#ifndef XMLTOOLING_NO_XMLSEC
XMLToolingConfig() : m_keyInfoResolver(NULL), m_replayCache(NULL), m_templateEngine(NULL), m_urlEncoder(NULL), clock_skew_secs(180) {}
-
+
/** Global KeyInfoResolver instance. */
KeyInfoResolver* m_keyInfoResolver;
+#else
+ XMLToolingConfig() : m_replayCache(NULL), m_templateEngine(NULL), m_urlEncoder(NULL), clock_skew_secs(180) {}
+#endif
/** Global ReplayCache instance. */
ReplayCache* m_replayCache;
*/
virtual ParserPool& getValidatingParser() const=0;
+#ifndef XMLTOOLING_NO_XMLSEC
/**
* Sets the global KeyInfoResolver instance.
* This method must be externally synchronized with any code that uses the object.
const KeyInfoResolver* getKeyInfoResolver() const {
return m_keyInfoResolver;
}
+#endif
/**
* Sets the global ReplayCache instance.
#include <xmltooling/config_pub.h>
#endif
+#ifdef XMLTOOLING_LITE
+# define XMLTOOLING_NO_XMLSEC 1
+#endif
+
// Windows and GCC4 Symbol Visibility Macros
#ifdef WIN32
#define XMLTOOL_IMPORT __declspec(dllimport)
using namespace xmltooling;
using namespace log4cpp;
using namespace std;
+#ifndef XMLTOOLING_NO_XMLSEC
using xmlsignature::Signature;
+#endif
void UnknownElementImpl::releaseDOM() const
{
// Set request headers.
curl_easy_setopt(m_handle,CURLOPT_HTTPHEADER,m_headers);
+#ifndef XMLTOOLING_NO_XMLSEC
if (m_ssl_callback || m_cred || m_trustEngine) {
+#else
+ if (m_ssl_callback) {
+#endif
curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_FUNCTION,xml_ssl_ctx_callback);
curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_DATA,this);
#include "internal.h"
#include "util/TemplateEngine.h"
-#include <ctime>
-
using namespace xmltooling;
using namespace std;
const XMLToolingException* e
) const
{
- // Create a timestamp
- time_t now = time(NULL);
-#ifdef HAVE_CTIME_R
- char nowbuf[32];
- ctime_r(&now);
-#else
- const char* nowbuf = ctime(&now);
-#endif
-
const char* line = buf.c_str();
const char* thispos;
AUTOMAKE_OPTIONS = foreign
if BUILD_UNITTEST
+
bin_PROGRAMS = xmltoolingtest
-xmltoolingtest_CXXFLAGS = $(CXXFLAGS) $(CXXTESTFLAGS)
+xmltoolingtest_CXXFLAGS = $(CXXTESTFLAGS)
+if BUILD_XMLSEC
+xmltoolingtest_LDFLAGS = $(XMLSEC_LIBS)
+xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling.la
+else
+xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling-lite.la
+endif
+
else
+
bin_PROGRAMS =
+
endif
if BUILD_XMLSEC
$(nodist_xmltoolingtest_SOURCES): %.cpp: %.h
$(MAKE) do-cxxtestgen HFILE=$< CPPFILE=$@
-if BUILD_XMLSEC
-xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling.la
-else
-xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling-lite.la
-endif
-
EXTRA_DIST = xmltoolingtest.vcproj $(xmltoolingtest_h) data