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>
This commit is contained in:
Thorsten Behrens
2017-11-23 12:13:43 +01:00
committed by Thorsten Behrens
parent eeb0ea67d2
commit 43ac50dccc
6 changed files with 16 additions and 7 deletions
+3
View File
@@ -10,6 +10,9 @@
/* Configuration for gpgme++.
*/
// Defined if gpgme support is available
#define GPGME_HAVE_GPGME 0
// Defined if gpgme supports exporting minimal key.
#define GPGME_CAN_EXPORT_MINIMAL_KEY 0
+1
View File
@@ -10169,6 +10169,7 @@ if test "$_os" = "Linux" -o "$_os" = "Darwin" \
LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
fi
fi
AC_DEFINE([GPGME_HAVE_GPGME])
fi
AC_SUBST(SYSTEM_GPGMEPP)
AC_SUBST(GPG_ERROR_CFLAGS)
@@ -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());
+3 -2
View File
@@ -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());
+2 -1
View File
@@ -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())
+3 -2
View File
@@ -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 ) ) ;