summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorThorsten Behrens <thorsten.behrens@cib.de>2017-11-22 19:06:26 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-11-23 12:13:43 +0100
commit43ac50dcccdf4f1954e666d6b18452b37a19d31e (patch)
treea6602d051bc3df29c249f53c82e8f0e601336af1 /xmlsecurity
parenteeb0ea67d242d77c6ec56e4601d44c9517eb381b (diff)
gpg4libre: conditional-compile gpgme code
Change-Id: I1d139a7b6df271d61bedd107c6b3a0535d233606 Reviewed-on: https://gerrit.libreoffice.org/45124 Reviewed-by: Siegmund Gorr <siegmund.gorr@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/helper/documentsignaturemanager.cxx6
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx5
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx3
-rw-r--r--xmlsecurity/source/xmlsec/xsec_xmlsec.cxx5
4 files changed, 12 insertions, 7 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index 78ce27d18dae..7cfeb2728ae8 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_gpgme.h>
+
#include <documentsignaturemanager.hxx>
#include <gpg/SEInitializer.hxx>
@@ -64,14 +66,14 @@ bool DocumentSignatureManager::init()
initXmlSec();
mxSEInitializer = xml::crypto::SEInitializer::create(mxContext);
-#if !defined(MACOSX) && !defined(WNT) && !defined(ANDROID)
+#if GPGME_HAVE_GPGME
mxGpgSEInitializer.set(new SEInitializerGpg());
#endif
if (mxSEInitializer.is())
mxSecurityContext = mxSEInitializer->createSecurityContext(OUString());
-#if !defined(MACOSX) && !defined(WNT) && !defined(ANDROID)
+#if GPGME_HAVE_GPGME
if (mxGpgSEInitializer.is())
mxGpgSecurityContext = mxGpgSEInitializer->createSecurityContext(OUString());
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index a64883d842b1..c746f8012f95 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -17,12 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_gpgme.h>
#include <xsecctl.hxx>
#include <documentsignaturehelper.hxx>
#include <framework/saxeventkeeperimpl.hxx>
#include <xmlsec/xmldocumentwrapper_xmlsecimpl.hxx>
-#if !defined(MACOSX) && !defined(WNT) && !defined(ANDROID)
+#if GPGME_HAVE_GPGME
# include <gpg/xmlsignature_gpgimpl.hxx>
#endif
@@ -160,7 +161,7 @@ void XSecController::createXSecComponent( )
cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
-#if !defined(MACOSX) && !defined(WNT) && !defined(ANDROID)
+#if GPGME_HAVE_GPGME
uno::Reference< lang::XServiceInfo > xServiceInfo( m_xSecurityContext, cssu::UNO_QUERY );
if (xServiceInfo->getImplementationName() == "com.sun.star.xml.security.gpg.XMLSecurityContext_GpgImpl")
m_xXMLSignature.set(new XMLSignature_GpgImpl());
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index 72474337a7e7..707527d3acdb 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_gpgme.h>
#include <xsecctl.hxx>
#include "xsecparser.hxx"
@@ -119,7 +120,7 @@ void XSecController::addSignature()
void XSecController::switchGpgSignature()
{
-#if !defined(MACOSX) && !defined(WNT) && !defined(ANDROID)
+#if GPGME_HAVE_GPGME
// swap signature verifier for the Gpg one
m_xXMLSignature.set(new XMLSignature_GpgImpl());
if (!m_vInternalSignatureInformations.empty())
diff --git a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
index 807eff2cddee..265ab2f8f960 100644
--- a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
+++ b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
@@ -27,7 +27,8 @@
#include <xmlsec/xmldocumentwrapper_xmlsecimpl.hxx>
#include "xsec_xmlsec.hxx"
-#if !defined(MACOSX) && !defined(WNT) && !defined(ANDROID)
+#include <config_gpgme.h>
+#if GPGME_HAVE_GPGME
# include <gpg/xmlsignature_gpgimpl.hxx>
#endif
@@ -44,7 +45,7 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL xsec_xmlsec_component_getFactory( const sal_
Reference< XInterface > xFactory ;
if( pImplName != nullptr ) {
-#if !defined(MACOSX) && !defined(WNT) && !defined(ANDROID)
+#if GPGME_HAVE_GPGME
if( XMLSignature_GpgImpl::impl_getImplementationName().equalsAscii( pImplName ) )
{
xFactory = XMLSignature_GpgImpl::impl_createFactory( static_cast< XMultiServiceFactory* >( pServiceManager ) ) ;