summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-06-07 09:41:19 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-06-07 10:11:36 +0200
commit576f899811a22e83b6fb6a120c8da303b1f4cac1 (patch)
tree9a1c9da1d458ea99cc7a1b720fc3da39d75b9a92 /xmlsecurity
parent0083269c3cbdb3de2ec92dafaecae5911c30fa04 (diff)
Fix CppunitTest_xmlsecurity_signing with system-xmlsec 1.2.26
Swap the order of the default and custom callback registration, since the order of lookup is now reversed since <https://github.com/lsh123/xmlsec/commit/968646fb9b8428174a112fce2f08b1ec89d0ed97>. Thanks Tomas Chvatal for reporting this. Change-Id: I60a347454701a679db4ccd8924a723a236d5edff Reviewed-on: https://gerrit.libreoffice.org/55404 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Tomáš Chvátal <tchvatal@suse.cz>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/xmlsec/xmlstreamio.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
index de32f8286c1b..83dd83e66a25 100644
--- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx
+++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
@@ -157,6 +157,25 @@ XSECXMLSEC_DLLPUBLIC int xmlEnableStreamInputCallbacks()
//Notes: all none default callbacks will lose.
xmlSecIOCleanupCallbacks() ;
+ // Newer xmlsec wants the callback order in the opposite direction.
+#if XMLSEC_VERSION_MAJOR > 1 || (XMLSEC_VERSION_MAJOR == 1 && XMLSEC_VERSION_MINOR > 2) || (XMLSEC_VERSION_MAJOR == 1 && XMLSEC_VERSION_MINOR == 2 && XMLSEC_VERSION_SUBMINOR >= 26)
+ //Register the default callbacks.
+ //Notes: the error will cause xmlsec working problems.
+ int cbs = xmlSecIORegisterDefaultCallbacks() ;
+ if( cbs < 0 ) {
+ return -1 ;
+ }
+
+ //Register my classbacks.
+ cbs = xmlSecIORegisterCallbacks(
+ xmlStreamMatch,
+ xmlStreamOpen,
+ xmlStreamRead,
+ xmlStreamClose ) ;
+ if( cbs < 0 ) {
+ return -1 ;
+ }
+#else
//Register my classbacks.
int cbs = xmlSecIORegisterCallbacks(
xmlStreamMatch,
@@ -173,6 +192,7 @@ XSECXMLSEC_DLLPUBLIC int xmlEnableStreamInputCallbacks()
if( cbs < 0 ) {
return -1 ;
}
+#endif
enableXmlStreamIO |= XMLSTREAMIO_INITIALIZED ;
}