summaryrefslogtreecommitdiff
path: root/xmlsecurity/source
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-11-29 23:07:47 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-12-07 16:14:31 +0100
commitc7fa2da1532d9f140cb9018b0a62c62228c67ba1 (patch)
tree9abcad0b4f3f49bcf082709c4d9d6fa743403454 /xmlsecurity/source
parentbfe2fb8ceed6643574010bf7b40f04d149f0fd6d (diff)
Restore GPG SEInitializer service
user config now needs it to collect user's private GPG keys Change-Id: Ia4ad4133b621160cf37281750cafa9f3c5c3c231 Reviewed-on: https://gerrit.libreoffice.org/45562 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 1c58b047d117bb087abc571b74c06cdf7499b1a0)
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r--xmlsecurity/source/gpg/SEInitializer.cxx39
-rw-r--r--xmlsecurity/source/xmlsec/xsec_xmlsec.cxx7
2 files changed, 45 insertions, 1 deletions
diff --git a/xmlsecurity/source/gpg/SEInitializer.cxx b/xmlsecurity/source/gpg/SEInitializer.cxx
index 667e9ce355c7..93e2ab263d33 100644
--- a/xmlsecurity/source/gpg/SEInitializer.cxx
+++ b/xmlsecurity/source/gpg/SEInitializer.cxx
@@ -9,6 +9,8 @@
#include <config_gpgme.h>
+#include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <gpg/SEInitializer.hxx>
#include "SecurityEnvironment.hxx"
#include "XMLSecurityContext.hxx"
@@ -56,4 +58,41 @@ void SAL_CALL SEInitializerGpg::freeSecurityContext( const uno::Reference< XXMLS
{
}
+
+
+uno::Reference< uno::XInterface > SAL_CALL SEInitializerGpg::impl_createInstance( const uno::Reference< lang::XMultiServiceFactory > & /*rxMSF*/)
+{
+ return static_cast<cppu::OWeakObject*>(new SEInitializerGpg());
+}
+
+uno::Reference< XSingleServiceFactory > SEInitializerGpg::impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) {
+ return cppu::createSingleFactory( aServiceManager, impl_getImplementationName(), impl_createInstance, impl_getSupportedServiceNames() ) ;
+}
+
+/* XServiceInfo */
+OUString SAL_CALL SEInitializerGpg::impl_getImplementationName()
+{
+ return OUString("com.sun.star.xml.security.SEInitializer_Gpg");
+}
+
+uno::Sequence< OUString > SAL_CALL SEInitializerGpg::impl_getSupportedServiceNames()
+{
+ return {"com.sun.star.xml.crypto.GPGSEInitializer"};
+}
+
+sal_Bool SAL_CALL SEInitializerGpg::supportsService( const OUString& rServiceName )
+{
+ return cppu::supportsService(this, rServiceName);
+}
+
+uno::Sequence< OUString > SAL_CALL SEInitializerGpg::getSupportedServiceNames()
+{
+ return impl_getSupportedServiceNames();
+}
+
+OUString SAL_CALL SEInitializerGpg::getImplementationName()
+{
+ return impl_getImplementationName();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
index 265ab2f8f960..d65d92eb1374 100644
--- a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
+++ b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
@@ -29,7 +29,8 @@
#include <config_gpgme.h>
#if GPGME_HAVE_GPGME
-# include <gpg/xmlsignature_gpgimpl.hxx>
+#include <gpg/xmlsignature_gpgimpl.hxx>
+#include <gpg/SEInitializer.hxx>
#endif
using namespace ::cppu;
@@ -50,6 +51,10 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL xsec_xmlsec_component_getFactory( const sal_
{
xFactory = XMLSignature_GpgImpl::impl_createFactory( static_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
}
+ else if( SEInitializerGpg::impl_getImplementationName().equalsAscii( pImplName ) )
+ {
+ xFactory = SEInitializerGpg::impl_createFactory( static_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
+ }
else
#endif
if( XMLElementWrapper_XmlSecImpl_getImplementationName().equalsAscii( pImplName ) )