You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by sc...@apache.org on 2017/08/31 15:53:44 UTC
svn commit: r1806816 - in /santuario/xml-security-cpp/trunk: ./
xsec/framework/ xsec/samples/ xsec/tools/cipher/ xsec/tools/templatesign/
xsec/utils/
Author: scantor
Date: Thu Aug 31 15:53:43 2017
New Revision: 1806816
URL: http://svn.apache.org/viewvc?rev=1806816&view=rev
Log:
Assume Xerces 3 - remove XSEC_XERCES_REQUIRES_MEMMGR and XSEC_XERCES_FORMATTER_REQUIRES_VERSION
Modified:
santuario/xml-security-cpp/trunk/configure.ac
santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in
santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp
santuario/xml-security-cpp/trunk/xsec/samples/IOStreamOutputter.cpp
santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp
santuario/xml-security-cpp/trunk/xsec/tools/templatesign/templatesign.cpp
santuario/xml-security-cpp/trunk/xsec/utils/XSECDOMUtils.cpp
santuario/xml-security-cpp/trunk/xsec/utils/XSECSafeBufferFormatter.cpp
Modified: santuario/xml-security-cpp/trunk/configure.ac
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/configure.ac?rev=1806816&r1=1806815&r2=1806816&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/configure.ac (original)
+++ santuario/xml-security-cpp/trunk/configure.ac Thu Aug 31 15:53:43 2017
@@ -128,23 +128,6 @@ CFLAGS="${CFLAGS} -DXSEC_LIBRARY_BUILD"
CXXFLAGS="${CXXFLAGS} -DXSEC_LIBRARY_BUILD"
# Find out some properties of the version of Xerces we have
-
-AC_MSG_CHECKING([whether Xerces XMLFormatter requires a version])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xercesc/framework/XMLFormatter.hpp>
- #include <xercesc/util/XercesDefs.hpp>
- #include <xercesc/util/XMLUniDefs.hpp>]], [[using namespace XERCES_CPP_NAMESPACE;
- XMLCh s_encoding[] = {
- chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_8, chNull
- };
- XMLFormatter f(s_encoding,
- NULL,
- NULL,
- XMLFormatter::NoEscapes,
- XMLFormatter::UnRep_CharRef);
- ]])],[AC_MSG_RESULT([yes])
- AC_DEFINE([XSEC_XERCES_REQUIRES_MEMMGR],[1],[Define to 1 if Xerces XMLFormatter requires MemoryManager.])
- AC_DEFINE([XSEC_XERCES_FORMATTER_REQUIRES_VERSION],[1],[Define to 1 if Xerces XMLFormatter requires version.])],
- [AC_MSG_RESULT([no])])
AC_MSG_CHECKING([whether Xerces XMLString has ::release])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]], [[using namespace XERCES_CPP_NAMESPACE;
Modified: santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in?rev=1806816&r1=1806815&r2=1806816&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in (original)
+++ santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in Thu Aug 31 15:53:43 2017
@@ -45,12 +45,6 @@
/* Define to 1 if Xalan XercesParserLiaison ctor takes XercesDOMSupport. */
#undef XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT
-/* Define to 1 if Xerces XMLFormatter requires version. */
-#undef XSEC_XERCES_FORMATTER_REQUIRES_VERSION
-
-/* Define to 1 if Xerces XMLFormatter requires MemoryManager. */
-#undef XSEC_XERCES_REQUIRES_MEMMGR
-
/* Define to 1 if Xerces XMLString has release method. */
#undef XSEC_XERCES_XMLSTRING_HAS_RELEASE
Modified: santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp?rev=1806816&r1=1806815&r2=1806816&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp Thu Aug 31 15:53:43 2017
@@ -38,17 +38,6 @@
*/
#if (XERCES_VERSION_MAJOR == 3) || ((XERCES_VERSION_MAJOR == 2) && (XERCES_VERSION_MINOR >= 3))
-/*
- * As of version 2.3, xerces requires a version parameter in XMLFormatter
- * constructors
- */
-# define XSEC_XERCES_FORMATTER_REQUIRES_VERSION 1
-
- /* 2.3 and above use a user defined Memory Manager. In some cases, this
- actually needs to be passed to functions
-*/
-
-# define XSEC_XERCES_REQUIRES_MEMMGR 1
/* Does XMLString::release() exist */
Modified: santuario/xml-security-cpp/trunk/xsec/samples/IOStreamOutputter.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/samples/IOStreamOutputter.cpp?rev=1806816&r1=1806815&r2=1806816&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/samples/IOStreamOutputter.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/samples/IOStreamOutputter.cpp Thu Aug 31 15:53:43 2017
@@ -924,13 +924,8 @@ void docSetup(DOMDocument *doc) {
-#if defined(XSEC_XERCES_FORMATTER_REQUIRES_VERSION)
- gFormatter = new XMLFormatter("UTF-8", 0, formatTarget,
- XMLFormatter::NoEscapes, gUnRepFlags);
-#else
- gFormatter = new XMLFormatter("UTF-8", formatTarget,
- XMLFormatter::NoEscapes, gUnRepFlags);
-#endif
+ gFormatter = new XMLFormatter("UTF-8", 0, formatTarget,
+ XMLFormatter::NoEscapes, gUnRepFlags);
}
// --------------------------------------------------------------------------------
Modified: santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp?rev=1806816&r1=1806815&r2=1806816&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp Thu Aug 31 15:53:43 2017
@@ -728,11 +728,7 @@ int evaluate(int argc, char ** argv) {
if (encryptFileAsData) {
// Create a BinInputStream
-#if defined(XSEC_XERCES_REQUIRES_MEMMGR)
BinFileInputStream * is = new BinFileInputStream(filename, XMLPlatformUtils::fgMemoryManager);
-#else
- BinFileInputStream * is = new BinFileInputStream(filename);
-#endif
xenc = cipher->encryptBinInputStream(is, keyAlg);
// Replace the document element
Modified: santuario/xml-security-cpp/trunk/xsec/tools/templatesign/templatesign.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/tools/templatesign/templatesign.cpp?rev=1806816&r1=1806815&r2=1806816&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/tools/templatesign/templatesign.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/tools/templatesign/templatesign.cpp Thu Aug 31 15:53:43 2017
@@ -1364,15 +1364,8 @@ int main(int argc, char **argv) {
XMLString::copyNString(gEncodingName, encNameStr, lent);
gEncodingName[lent] = 0;
-
-
-#if defined(XSEC_XERCES_FORMATTER_REQUIRES_VERSION)
gFormatter = new XMLFormatter("UTF-8", 0, formatTarget,
XMLFormatter::NoEscapes, gUnRepFlags);
-#else
- gFormatter = new XMLFormatter("UTF-8", formatTarget,
- XMLFormatter::NoEscapes, gUnRepFlags);
-#endif
cout << doc;
Modified: santuario/xml-security-cpp/trunk/xsec/utils/XSECDOMUtils.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/utils/XSECDOMUtils.cpp?rev=1806816&r1=1806815&r2=1806816&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/utils/XSECDOMUtils.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/utils/XSECDOMUtils.cpp Thu Aug 31 15:53:43 2017
@@ -355,23 +355,16 @@ XMLCh * transcodeFromUTF8(const unsigned
// Grab a transcoder
XMLTransService::Codes failReason;
-#if defined(XSEC_XERCES_REQUIRES_MEMMGR)
XMLTranscoder* t =
XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF-8",
- failReason,
- 2*1024,
- XMLPlatformUtils::fgMemoryManager);
-#else
- XMLTranscoder* t =
- XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF-8",
- failReason,
- 2*1024);
-#endif
+ failReason,
+ 2*1024,
+ XMLPlatformUtils::fgMemoryManager);
Janitor<XMLTranscoder> j_t(t);
// Need to loop through, 2K at a time
xsecsize_t bytesEaten, bytesEatenCounter;
- xsecsize_t charactersEaten;
+ xsecsize_t charactersEaten;
xsecsize_t totalBytesEaten = 0;
xsecsize_t bytesToEat = XMLString::stringLen((char *) src);
@@ -417,18 +410,11 @@ char DSIG_EXPORT * transcodeToUTF8(const
// Grab a transcoder
XMLTransService::Codes failReason;
-#if defined(XSEC_XERCES_REQUIRES_MEMMGR)
- XMLTranscoder* t =
- XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF-8",
- failReason,
- 2*1024,
- XMLPlatformUtils::fgMemoryManager);
-#else
XMLTranscoder* t =
XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF-8",
- failReason,
- 2*1024);
-#endif
+ failReason,
+ 2*1024,
+ XMLPlatformUtils::fgMemoryManager);
Janitor<XMLTranscoder> j_t(t);
// Need to loop through, 2K at a time
@@ -438,7 +424,7 @@ char DSIG_EXPORT * transcodeToUTF8(const
while (totalCharsEaten < charsToEat) {
- xsecsize_t toEat = charsToEat - totalCharsEaten;
+ xsecsize_t toEat = charsToEat - totalCharsEaten;
if (toEat > 2048)
toEat = 2048;
Modified: santuario/xml-security-cpp/trunk/xsec/utils/XSECSafeBufferFormatter.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/utils/XSECSafeBufferFormatter.cpp?rev=1806816&r1=1806815&r2=1806816&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/utils/XSECSafeBufferFormatter.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/utils/XSECSafeBufferFormatter.cpp Thu Aug 31 15:53:43 2017
@@ -43,18 +43,11 @@ XSECSafeBufferFormatter::XSECSafeBufferF
sbf = new sbFormatTarget();
sbf->setBuffer(&formatBuffer);
-#if defined(XSEC_XERCES_FORMATTER_REQUIRES_VERSION)
formatter = new XMLFormatter(outEncoding,
- 0,
- sbf,
- escapeFlags,
- unrepFlags);
-#else
- XSECnew(formatter, XMLFormatter(outEncoding,
- sbf,
- escapeFlags,
- unrepFlags));
-#endif
+ 0,
+ sbf,
+ escapeFlags,
+ unrepFlags);
}
@@ -62,26 +55,18 @@ XSECSafeBufferFormatter::XSECSafeBufferF
XSECSafeBufferFormatter::XSECSafeBufferFormatter(
- const char * const outEncoding,
+ const char * const outEncoding,
const XMLFormatter::EscapeFlags escapeFlags,
const XMLFormatter::UnRepFlags unrepFlags) {
sbf = new sbFormatTarget();
sbf->setBuffer(&formatBuffer);
-#if defined(XSEC_XERCES_FORMATTER_REQUIRES_VERSION)
formatter = new XMLFormatter(outEncoding,
- 0,
- sbf,
- escapeFlags,
- unrepFlags);
-#else
- XSECnew(formatter, XMLFormatter(outEncoding,
- sbf,
- escapeFlags,
- unrepFlags));
-#endif
-
+ 0,
+ sbf,
+ escapeFlags,
+ unrepFlags);
}
// Destructor