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/30 23:24:09 UTC

svn commit: r1806744 - in /santuario/xml-security-cpp/trunk: ./ xsec/dsig/ xsec/framework/ xsec/tools/xtest/ xsec/xkms/impl/

Author: scantor
Date: Wed Aug 30 23:24:09 2017
New Revision: 1806744

URL: http://svn.apache.org/viewvc?rev=1806744&view=rev
Log:
  Assume Xerces 3 - remove XSEC_XERCES_HAS_SETIDATTRIBUTE

Modified:
    santuario/xml-security-cpp/trunk/configure.ac
    santuario/xml-security-cpp/trunk/xsec/dsig/DSIGObject.cpp
    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/tools/xtest/xtest.cpp
    santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp
    santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSMessageAbstractTypeImpl.cpp

Modified: santuario/xml-security-cpp/trunk/configure.ac
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/configure.ac?rev=1806744&r1=1806743&r2=1806744&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/configure.ac (original)
+++ santuario/xml-security-cpp/trunk/configure.ac Wed Aug 30 23:24:09 2017
@@ -163,26 +163,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#in
 	AC_DEFINE([XSEC_XERCES_XMLSTRING_HAS_RELEASE],[1],[Define to 1 if Xerces XMLString has release method.])],
 	[AC_MSG_RESULT([no])])
 
-AC_MSG_CHECKING([whether Xerces XMLElement has ::setIdAttribute(XMLCh*)])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]], [[using namespace XERCES_CPP_NAMESPACE;
-		DOMElement * elt;
-		elt->setIdAttribute(NULL);
-	]])],[AC_MSG_RESULT([yes])
-    xerces_has_setidattribute=yes
-	AC_DEFINE([XSEC_XERCES_HAS_SETIDATTRIBUTE],[1],[Define to 1 if Xerces has legacy setIdAttribute.])],
-	[AC_MSG_RESULT([no])])
-
-if test -z "$xerces_has_setidattribute" ; then
-  AC_MSG_CHECKING([whether Xerces XMLElement has ::setIdAttribute(XMLCh*, bool)])
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]], [[using namespace XERCES_CPP_NAMESPACE;
-		  DOMElement * elt;
-		  elt->setIdAttribute(NULL, false);
-	  ]])],[AC_MSG_RESULT([yes])
-      xerces_has_setidattribute=yes
-	  AC_DEFINE([XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE],[1],[Define to 1 if Xerces DOM ID methods take extra parameter.])],
-	  [AC_MSG_RESULT([no])])
-fi
-
 # For Xerces 3.x we now have a stricter DOM L3 implementation
 AC_MSG_CHECKING([whether Xerces DOMImplementationLS has DOMLSSerializer])
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]], [[using namespace XERCES_CPP_NAMESPACE;

Modified: santuario/xml-security-cpp/trunk/xsec/dsig/DSIGObject.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/dsig/DSIGObject.cpp?rev=1806744&r1=1806743&r2=1806744&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/dsig/DSIGObject.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/dsig/DSIGObject.cpp Wed Aug 30 23:24:09 2017
@@ -136,11 +136,7 @@ void DSIGObject::load(void) {
 
 	mp_idAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_Id);
 	if (mp_idAttr) {
-#if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE)
-	    ((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id);
-#elif defined (XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE)
 		((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id, true);
-#endif
 	}
 
 	mp_mimeTypeAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_MimeType);
@@ -225,11 +221,7 @@ void DSIGObject::setId(const XMLCh * id)
 
 		((DOMElement *) mp_objectNode)->setAttributeNS(NULL, s_Id, id);
 		// Mark as an ID
-#if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE)
-		((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id);
-#elif defined (XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE)
 		((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id, true);
-#endif
 		mp_idAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_Id);
 
 	}

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=1806744&r1=1806743&r2=1806744&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in (original)
+++ santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in Wed Aug 30 23:24:09 2017
@@ -54,12 +54,6 @@
 /* Define to 1 if Xerces XMLFormatter requires version. */
 #undef XSEC_XERCES_FORMATTER_REQUIRES_VERSION
 
-/* Define to 1 if Xerces DOM ID methods take extra parameter. */
-#undef XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE
-
-/* Define to 1 if Xerces has legacy setIdAttribute. */
-#undef XSEC_XERCES_HAS_SETIDATTRIBUTE
-
 /* Define to 1 if Xerces InputStream class requires getContentType. */
 #undef XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE
 

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=1806744&r1=1806743&r2=1806744&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp Wed Aug 30 23:24:09 2017
@@ -39,10 +39,6 @@
 
 #if (XERCES_VERSION_MAJOR >= 3)
 
-/* Is it possible to setIdAttributes? - DOM level 3 call.  V3.x
-   API Version */
-
-#	define XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE 1
 
 /* 3.0 no longer supports DOMWriter, must use DOMLSSerializer instead
 */
@@ -76,13 +72,6 @@
 
 #	define XSEC_XERCES_XMLSTRING_HAS_RELEASE 1
 
-#	if (XERCES_VERSION_MAJOR < 3)
-		/* Is it possible to setIdAttributes? - DOM level 3 call.  V2.x API */
-
-#		define XSEC_XERCES_HAS_SETIDATTRIBUTE 1
-
-#	endif
-
 #else
 /*
  * In version 2.2, the XMLUri class was broken for relative URI de-referencing

Modified: santuario/xml-security-cpp/trunk/xsec/tools/xtest/xtest.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/tools/xtest/xtest.cpp?rev=1806744&r1=1806743&r2=1806744&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/tools/xtest/xtest.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/tools/xtest/xtest.cpp Wed Aug 30 23:24:09 2017
@@ -709,9 +709,7 @@ void unitTestBase64NodeSignature(DOMImpl
 		sig = prov.newSignature();
 		sig->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds"));
 		sig->setPrettyPrint(true);
-#if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE)
 		sig->setIdByAttributeName(false);		// Do not search by name
-#endif
 		sigNode = sig->createBlankSignature(doc, 
 			DSIGConstants::s_unicodeStrURIC14N_COM,
 			DSIGConstants::s_unicodeStrURIHMAC_SHA1);
@@ -1629,9 +1627,7 @@ void unitTestCipherReference(DOMImplemen
 		DOMElement * cipherVal = doc->createElement(MAKE_UNICODE_STRING("MyCipherValue"));
 		rootElem->appendChild(cipherVal);
 		cipherVal->setAttributeNS(NULL, MAKE_UNICODE_STRING("Id"), MAKE_UNICODE_STRING("CipherText"));
-#if defined(XSEC_XERCES_HAS_SETIDATTRIBUTE)
-		cipherVal->setIdAttribute(MAKE_UNICODE_STRING("Id"));
-#endif
+		cipherVal->setIdAttributeNS(NULL, MAKE_UNICODE_STRING("Id"), true);
 
 		cipherVal->appendChild(doc->createTextNode(MAKE_UNICODE_STRING((char *) s_tstBase64EncodedString)));
 

Modified: santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp?rev=1806744&r1=1806743&r2=1806744&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp Wed Aug 30 23:24:09 2017
@@ -375,9 +375,7 @@ void XKMSKeyBindingAbstractTypeImpl::set
 	mp_keyBindingAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagId, id ? id : myId);
 	if (id == NULL)
 	    XSEC_RELEASE_XMLCH(myId);
-#if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE)
-	mp_keyBindingAbstractTypeElement->setIdAttributeNS(NULL, XKMSConstants::s_tagId);
-#endif
+	mp_keyBindingAbstractTypeElement->setIdAttributeNS(NULL, XKMSConstants::s_tagId, true);
 	mp_idAttr = 
 		mp_keyBindingAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagId);
 

Modified: santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSMessageAbstractTypeImpl.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSMessageAbstractTypeImpl.cpp?rev=1806744&r1=1806743&r2=1806744&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSMessageAbstractTypeImpl.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xkms/impl/XKMSMessageAbstractTypeImpl.cpp Wed Aug 30 23:24:09 2017
@@ -225,9 +225,7 @@ DOMElement * XKMSMessageAbstractTypeImpl
 	mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagId, id ? id : myId);
 	if (id == NULL)
 	    XSEC_RELEASE_XMLCH(myId);
-#if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE)
-	mp_messageAbstractTypeElement->setIdAttributeNS(NULL, XKMSConstants::s_tagId);
-#endif
+	mp_messageAbstractTypeElement->setIdAttributeNS(NULL, XKMSConstants::s_tagId, true);
 	mp_idAttr = 
 		mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagId);
 
@@ -295,9 +293,7 @@ void XKMSMessageAbstractTypeImpl::setId(
 	}
 
 	mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagId, id);
-#if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE)	
-	mp_messageAbstractTypeElement->setIdAttributeNS(NULL, XKMSConstants::s_tagId);
-#endif
+	mp_messageAbstractTypeElement->setIdAttributeNS(NULL, XKMSConstants::s_tagId, true);
 	mp_idAttr = 
 		mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagId);