You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by bl...@apache.org on 2006/09/27 03:47:52 UTC
svn commit: r450286 - in /xml/security/trunk/c/src: dsig/ framework/
samples/ tools/cipher/ tools/templatesign/ tools/xklient/ tools/xtest/ utils/
Author: blautenb
Date: Tue Sep 26 18:47:51 2006
New Revision: 450286
URL: http://svn.apache.org/viewvc?view=rev&rev=450286
Log:
Build against current Xerces 3.0 svn src
Modified:
xml/security/trunk/c/src/dsig/DSIGObject.cpp
xml/security/trunk/c/src/framework/XSECConfig.hpp.in
xml/security/trunk/c/src/framework/XSECDefs.hpp
xml/security/trunk/c/src/samples/IOStreamOutputter.cpp
xml/security/trunk/c/src/tools/cipher/cipher.cpp
xml/security/trunk/c/src/tools/templatesign/templatesign.cpp
xml/security/trunk/c/src/tools/xklient/xklient.cpp
xml/security/trunk/c/src/tools/xtest/xtest.cpp
xml/security/trunk/c/src/utils/XSECSOAPRequestorSimple.cpp
Modified: xml/security/trunk/c/src/dsig/DSIGObject.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/dsig/DSIGObject.cpp?view=diff&rev=450286&r1=450285&r2=450286
==============================================================================
--- xml/security/trunk/c/src/dsig/DSIGObject.cpp (original)
+++ xml/security/trunk/c/src/dsig/DSIGObject.cpp Tue Sep 26 18:47:51 2006
@@ -216,6 +216,10 @@
// Mark as an ID
#if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE)
((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id);
+#else
+# if defined (XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE)
+ ((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id, true);
+# endif
#endif
mp_idAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_Id);
Modified: xml/security/trunk/c/src/framework/XSECConfig.hpp.in
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/framework/XSECConfig.hpp.in?view=diff&rev=450286&r1=450285&r2=450286
==============================================================================
--- xml/security/trunk/c/src/framework/XSECConfig.hpp.in (original)
+++ xml/security/trunk/c/src/framework/XSECConfig.hpp.in Tue Sep 26 18:47:51 2006
@@ -57,6 +57,25 @@
#undef XSEC_XERCES_REQUIRES_MEMMGR
+/* Is it possible to setIdAttributes? - DOM level 3 call */
+
+#undef XSEC_XERCES_HAS_SETIDATTRIBUTE
+
+/* Is it possible to setIdAttributes? - DOM level 3 call. V3.x
+ API Version */
+
+#undef XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE
+
+/* 3.0 no longer supports DOMWriter, must use DOMLSSerializer instead
+*/
+
+#undef XSEC_XERCES_DOMLSSERIALIZER
+
+/* 3.0 now uses getInputEncoding rather than getEncoding to determine
+ encoding that was found in input document */
+
+#undef XSEC_XERCES_DOMENTITYINPUTENCODING
+
/*
* Find out the idiosyncracies of the version of Xalan we are using
*/
@@ -86,10 +105,6 @@
#undef XSEC_XERCES_XMLSTRING_HAS_RELEASE
-/* Is it possible to setIdAttributes? - DOM level 3 call */
-
-#undef XSEC_XERCES_HAS_SETIDATTRIBUTE
-
/*
* Define presence of cryptographic providers
*/
@@ -118,6 +133,11 @@
#undef XSEC_HAVE__STRDUP
#undef XSEC_HAVE__STRICMP
+
+/* How do we handle stricmp style requirements? */
+
+#undef XSEC_HAVE_STRICMP
+#undef XSEC_HAVE_STRCASECMP
/*
* Macros used to determine what header files exist on this
Modified: xml/security/trunk/c/src/framework/XSECDefs.hpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/framework/XSECDefs.hpp?view=diff&rev=450286&r1=450285&r2=450286
==============================================================================
--- xml/security/trunk/c/src/framework/XSECDefs.hpp (original)
+++ xml/security/trunk/c/src/framework/XSECDefs.hpp Tue Sep 26 18:47:51 2006
@@ -87,18 +87,26 @@
// Project Library Handling
// --------------------------------------------------------------------------------
+#if defined (PLATFORM_EXPORT)
+# define XSEC_PLATFORM_EXPORT PLATFORM_EXPORT
+# define XSEC_PLATFORM_IMPORT PLATFORM_IMPORT
+#else
+# define XSEC_PLATFORM_EXPORT XERCES_PLATFORM_EXPORT
+# define XSEC_PLATFORM_IMPORT XERCES_PLATFORM_IMPORT
+#endif
+
#if defined (PROJ_CANON)
-#define CANON_EXPORT PLATFORM_EXPORT
+#define CANON_EXPORT XSEC_PLATFORM_EXPORT
#else
-#define CANON_EXPORT PLATFORM_IMPORT
+#define CANON_EXPORT XSEC_PLATFORM_IMPORT
#endif
#if defined (PROJ_DSIG)
-#define DSIG_EXPORT PLATFORM_EXPORT
+#define DSIG_EXPORT XSEC_PLATFORM_EXPORT
#else
-#define DSIG_EXPORT PLATFORM_IMPORT
+#define DSIG_EXPORT XSEC_PLATFORM_IMPORT
#endif
// Platform includes. Much of this is taken from Xalan
@@ -159,7 +167,13 @@
# endif
# ifndef XSEC_HAVE__STRICMP
-# define _stricmp(x,y) stricmp(x,y)
+# ifdef XSEC_HAVE_STRICMP
+# define _stricmp(x,y) stricmp(x,y)
+# else
+# ifdef XSEC_HAVE_STRCASECMP
+# define _stricmp(x,y) strcasecmp(x,y)
+# endif
+# endif
# endif
# ifndef XSEC_HAVE__GETCWD
Modified: xml/security/trunk/c/src/samples/IOStreamOutputter.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/samples/IOStreamOutputter.cpp?view=diff&rev=450286&r1=450285&r2=450286
==============================================================================
--- xml/security/trunk/c/src/samples/IOStreamOutputter.cpp (original)
+++ xml/security/trunk/c/src/samples/IOStreamOutputter.cpp Tue Sep 26 18:47:51 2006
@@ -908,7 +908,13 @@
DOMNode *aNode = doc->getFirstChild();
if (aNode->getNodeType() == DOMNode::ENTITY_NODE)
{
- const XMLCh* aStr = ((DOMEntity *)aNode)->getEncoding();
+ const XMLCh* aStr = ((DOMEntity *)aNode)->
+#if defined XSEC_XERCES_DOMENTITYINPUTENCODING
+ getInputEncoding();
+#else
+ getEncoding();
+#endif
+
if (!strEquals(aStr, ""))
{
encNameStr = aStr;
Modified: xml/security/trunk/c/src/tools/cipher/cipher.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/tools/cipher/cipher.cpp?view=diff&rev=450286&r1=450285&r2=450286
==============================================================================
--- xml/security/trunk/c/src/tools/cipher/cipher.cpp (original)
+++ xml/security/trunk/c/src/tools/cipher/cipher.cpp Tue Sep 26 18:47:51 2006
@@ -743,7 +743,27 @@
XERCES_CPP_NAMESPACE_QUALIFIER chNull
};
- DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(core);
+ DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(core);
+
+#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+ // DOM L3 version as per Xerces 3.0 API
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+ Janitor<DOMLSSerializer> j_theSerializer(theSerializer);
+
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
+
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
+
+ theSerializer->write(doc, theOutput);
+
+#else
DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
Janitor<DOMWriter> j_theSerializer(theSerializer);
@@ -752,7 +772,7 @@
theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
theSerializer->writeNode(formatTarget, *doc);
-
+#endif
cout << endl;
}
Modified: xml/security/trunk/c/src/tools/templatesign/templatesign.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/tools/templatesign/templatesign.cpp?view=diff&rev=450286&r1=450285&r2=450286
==============================================================================
--- xml/security/trunk/c/src/tools/templatesign/templatesign.cpp (original)
+++ xml/security/trunk/c/src/tools/templatesign/templatesign.cpp Tue Sep 26 18:47:51 2006
@@ -1316,7 +1316,12 @@
DOMNode *aNode = doc->getFirstChild();
if (aNode->getNodeType() == DOMNode::ENTITY_NODE)
{
- const XMLCh* aStr = ((DOMEntity *)aNode)->getEncoding();
+ const XMLCh* aStr =
+#if defined XSEC_XERCES_DOMENTITYINPUTENCODING
+ ((DOMEntity *)aNode)->getInputEncoding();
+#else
+ ((DOMEntity *)aNode)->getEncoding();
+#endif
if (!strEquals(aStr, ""))
{
encNameStr = aStr;
Modified: xml/security/trunk/c/src/tools/xklient/xklient.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/tools/xklient/xklient.cpp?view=diff&rev=450286&r1=450285&r2=450286
==============================================================================
--- xml/security/trunk/c/src/tools/xklient/xklient.cpp (original)
+++ xml/security/trunk/c/src/tools/xklient/xklient.cpp Tue Sep 26 18:47:51 2006
@@ -208,6 +208,29 @@
XMLCh tempStr[100];
XMLString::transcode("Core", tempStr, 99);
DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
+ XMLFormatTarget *formatTarget = new StdOutFormatTarget();
+
+ cerr << endl;
+
+#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+
+ // DOM L3 version as per Xerces 3.0 API
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
+
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
+
+ theSerializer->write(doc, theOutput);
+
+#else
DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
@@ -215,13 +238,10 @@
if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- XMLFormatTarget *formatTarget = new StdOutFormatTarget();
-
- cerr << endl;
-
theSerializer->writeNode(formatTarget, *doc);
+#endif
+
cout << endl;
cerr << endl;
@@ -4414,7 +4434,6 @@
// Schema handling
if (doValidate) {
parser->setDoSchema(true);
- parser->setDoValidation(true);
parser->setExternalSchemaLocation("http://www.w3.org/2002/03/xkms# http://www.w3.org/TR/xkms2/Schemas/xkms.xsd");
}
Modified: xml/security/trunk/c/src/tools/xtest/xtest.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/tools/xtest/xtest.cpp?view=diff&rev=450286&r1=450285&r2=450286
==============================================================================
--- xml/security/trunk/c/src/tools/xtest/xtest.cpp (original)
+++ xml/security/trunk/c/src/tools/xtest/xtest.cpp Tue Sep 26 18:47:51 2006
@@ -422,18 +422,41 @@
if (g_printDocs == false)
return;
+ XMLFormatTarget *formatTarget = new StdOutFormatTarget();
+
+#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+
+ // DOM L3 version as per Xerces 3.0 API
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
+
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
+
+#else
+
DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- XMLFormatTarget *formatTarget = new StdOutFormatTarget();
+#endif
cerr << endl;
+#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+ theSerializer->write(doc, theOutput);
+#else
theSerializer->writeNode(formatTarget, *doc);
+#endif
cout << endl;
@@ -454,6 +477,26 @@
try {
+ MemBufFormatTarget *formatTarget = new MemBufFormatTarget();
+#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+
+ // DOM L3 version as per Xerces 3.0 API
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
+
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
+
+ theSerializer->write(inDoc,theOutput);
+#else
+
DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
@@ -461,10 +504,11 @@
if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
- MemBufFormatTarget *formatTarget = new MemBufFormatTarget();
theSerializer->writeNode(formatTarget, *inDoc);
+#endif
+
// Copy to a new buffer
int len = formatTarget->getLen();
char * mbuf = new char [len + 1];
@@ -1157,16 +1201,35 @@
cerr << "Serialising the document to a memory buffer ... ";
+ MemBufFormatTarget *formatTarget = new MemBufFormatTarget();
+
+#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+
+ // DOM L3 version as per Xerces 3.0 API
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
+
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
+
+ theSerializer->write(doc,theOutput);
+#else
+
DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- MemBufFormatTarget *formatTarget = new MemBufFormatTarget();
-
theSerializer->writeNode(formatTarget, *doc);
+#endif
// Copy to a new buffer
len = formatTarget->getLen();
Modified: xml/security/trunk/c/src/utils/XSECSOAPRequestorSimple.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/utils/XSECSOAPRequestorSimple.cpp?view=diff&rev=450286&r1=450285&r2=450286
==============================================================================
--- xml/security/trunk/c/src/utils/XSECSOAPRequestorSimple.cpp (original)
+++ xml/security/trunk/c/src/utils/XSECSOAPRequestorSimple.cpp Tue Sep 26 18:47:51 2006
@@ -106,6 +106,25 @@
XMLCh tempStr[100];
XMLString::transcode("Core", tempStr, 99);
DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
+#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+ // DOM L3 version as per Xerces 3.0 API
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+ Janitor<DOMLSSerializer> j_theSerializer(theSerializer);
+
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
+ MemBufFormatTarget *formatTarget = new MemBufFormatTarget;
+ Janitor<MemBufFormatTarget> j_formatTarget(formatTarget);
+
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
+
+#else
DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
Janitor<DOMWriter> j_theSerializer(theSerializer);
@@ -116,6 +135,8 @@
MemBufFormatTarget *formatTarget = new MemBufFormatTarget;
Janitor<MemBufFormatTarget> j_formatTarget(formatTarget);
+#endif
+
if (m_envelopeType != ENVELOPE_NONE) {
// Create a new document to wrap the request in
@@ -166,12 +187,20 @@
// OK - Now we have the SOAP request as a document, we serialise to a string buffer
// and return
+#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+ theSerializer->write(doc, theOutput);
+#else
theSerializer->writeNode(formatTarget, *doc);
+#endif
doc->release();
}
else {
+#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+ theSerializer->write(request, theOutput);
+#else
theSerializer->writeNode(formatTarget, *request);
+#endif
}
// Now replicate the buffer