summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-24 08:24:29 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-24 14:22:45 +0000
commit9691cea443a74885b3f81c602efdd3345de1e3f9 (patch)
tree8a8c1e797065df453c5189281f320290386a1645 /xmlsecurity
parent6eaa7a41d8ca4dd38d285799fd1920c3115f89c7 (diff)
xmlsecurity: instantiate SignatureVerifierImpl directly in XSecController
Going via UNO for a class in the same module sounds like an overkill. Change-Id: Iaa5b31d1b888c8d3f1c9b47ee787504191ce3d7d Reviewed-on: https://gerrit.libreoffice.org/31148 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/Library_xmlsecurity.mk1
-rw-r--r--xmlsecurity/Library_xsec_fw.mk4
-rw-r--r--xmlsecurity/inc/framework/securityengine.hxx (renamed from xmlsecurity/source/framework/securityengine.hxx)4
-rw-r--r--xmlsecurity/inc/framework/signatureengine.hxx (renamed from xmlsecurity/source/framework/signatureengine.hxx)7
-rw-r--r--xmlsecurity/inc/framework/signatureverifierimpl.hxx (renamed from xmlsecurity/source/framework/signatureverifierimpl.hxx)7
-rw-r--r--xmlsecurity/inc/xsecfwdllapi.h23
-rw-r--r--xmlsecurity/source/framework/encryptionengine.hxx2
-rw-r--r--xmlsecurity/source/framework/securityengine.cxx2
-rw-r--r--xmlsecurity/source/framework/signaturecreatorimpl.hxx2
-rw-r--r--xmlsecurity/source/framework/signatureengine.cxx2
-rw-r--r--xmlsecurity/source/framework/signatureverifierimpl.cxx2
-rw-r--r--xmlsecurity/source/framework/xsec_framework.cxx2
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx8
13 files changed, 46 insertions, 20 deletions
diff --git a/xmlsecurity/Library_xmlsecurity.mk b/xmlsecurity/Library_xmlsecurity.mk
index 487011f7774e..af561230c6aa 100644
--- a/xmlsecurity/Library_xmlsecurity.mk
+++ b/xmlsecurity/Library_xmlsecurity.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_libraries,xmlsecurity,\
vcl \
xo \
i18nlangtag \
+ xsec_fw \
$(gb_UWINAPI) \
))
diff --git a/xmlsecurity/Library_xsec_fw.mk b/xmlsecurity/Library_xsec_fw.mk
index fb58538eb0aa..8d75537f414a 100644
--- a/xmlsecurity/Library_xsec_fw.mk
+++ b/xmlsecurity/Library_xsec_fw.mk
@@ -16,6 +16,10 @@ $(eval $(call gb_Library_set_include,xsec_fw,\
-I$(SRCDIR)/xmlsecurity/inc \
))
+$(eval $(call gb_Library_add_defs,xsec_fw,\
+ -DXSECFW_DLLIMPLEMENTATION \
+))
+
$(eval $(call gb_Library_set_precompiled_header,xsec_fw,$(SRCDIR)/xmlsecurity/inc/pch/precompiled_xsec_fw))
$(eval $(call gb_Library_use_sdk_api,xsec_fw))
diff --git a/xmlsecurity/source/framework/securityengine.hxx b/xmlsecurity/inc/framework/securityengine.hxx
index 17fab0db39c2..964f5aeac565 100644
--- a/xmlsecurity/source/framework/securityengine.hxx
+++ b/xmlsecurity/inc/framework/securityengine.hxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SECURITYENGINE_HXX
-#define INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SECURITYENGINE_HXX
+#ifndef INCLUDED_XMLSECURITY_INC_FRAMEWORK_SECURITYENGINE_HXX
+#define INCLUDED_XMLSECURITY_INC_FRAMEWORK_SECURITYENGINE_HXX
#include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp>
#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp>
diff --git a/xmlsecurity/source/framework/signatureengine.hxx b/xmlsecurity/inc/framework/signatureengine.hxx
index 4ba5d8cb07d2..ee6c79abea98 100644
--- a/xmlsecurity/source/framework/signatureengine.hxx
+++ b/xmlsecurity/inc/framework/signatureengine.hxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SIGNATUREENGINE_HXX
-#define INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SIGNATUREENGINE_HXX
+#ifndef INCLUDED_XMLSECURITY_INC_FRAMEWORK_SIGNATUREENGINE_HXX
+#define INCLUDED_XMLSECURITY_INC_FRAMEWORK_SIGNATUREENGINE_HXX
#include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp>
#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp>
@@ -34,11 +34,12 @@
#include <cppuhelper/implbase.hxx>
+#include "xsecfwdllapi.h"
#include "securityengine.hxx"
#include <vector>
-class SignatureEngine : public cppu::ImplInheritanceHelper
+class XSECFW_DLLPUBLIC SignatureEngine : public cppu::ImplInheritanceHelper
<
SecurityEngine,
css::xml::crypto::sax::XReferenceCollector,
diff --git a/xmlsecurity/source/framework/signatureverifierimpl.hxx b/xmlsecurity/inc/framework/signatureverifierimpl.hxx
index 5159b86a837a..f31f7acda35e 100644
--- a/xmlsecurity/source/framework/signatureverifierimpl.hxx
+++ b/xmlsecurity/inc/framework/signatureverifierimpl.hxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SIGNATUREVERIFIERIMPL_HXX
-#define INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SIGNATUREVERIFIERIMPL_HXX
+#ifndef INCLUDED_XMLSECURITY_INC_FRAMEWORK_SIGNATUREVERIFIERIMPL_HXX
+#define INCLUDED_XMLSECURITY_INC_FRAMEWORK_SIGNATUREVERIFIERIMPL_HXX
#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp>
#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultBroadcaster.hpp>
@@ -29,6 +29,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase.hxx>
+#include "xsecfwdllapi.h"
#include "signatureengine.hxx"
typedef cppu::ImplInheritanceHelper
@@ -39,7 +40,7 @@ typedef cppu::ImplInheritanceHelper
css::lang::XServiceInfo
> SignatureVerifierImpl_Base;
-class SignatureVerifierImpl : public SignatureVerifierImpl_Base
+class XSECFW_DLLPUBLIC SignatureVerifierImpl : public SignatureVerifierImpl_Base
/****** SignatureVerifier.hxx/CLASS SignatureVerifierImpl *********************
*
* NAME
diff --git a/xmlsecurity/inc/xsecfwdllapi.h b/xmlsecurity/inc/xsecfwdllapi.h
new file mode 100644
index 000000000000..d6cee81fd1b5
--- /dev/null
+++ b/xmlsecurity/inc/xsecfwdllapi.h
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_XMLSECURITY_INC_XSECFWDLLAPI_H
+#define INCLUDED_XMLSECURITY_INC_XSECFWDLLAPI_H
+
+#include <sal/types.h>
+
+#if defined(XSECFW_DLLIMPLEMENTATION)
+#define XSECFW_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define XSECFW_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif // INCLUDED_XMLSECURITY_INC_XSECFWDLLAPI_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/framework/encryptionengine.hxx b/xmlsecurity/source/framework/encryptionengine.hxx
index 2fe4775c5449..7c8f164bc9b8 100644
--- a/xmlsecurity/source/framework/encryptionengine.hxx
+++ b/xmlsecurity/source/framework/encryptionengine.hxx
@@ -30,7 +30,7 @@
#include <com/sun/star/xml/crypto/XXMLEncryption.hpp>
#include <cppuhelper/implbase.hxx>
-#include "securityengine.hxx"
+#include "framework/securityengine.hxx"
namespace com { namespace sun { namespace star { namespace uno {
class XComponentContext;
diff --git a/xmlsecurity/source/framework/securityengine.cxx b/xmlsecurity/source/framework/securityengine.cxx
index 27638f7a6480..80e7ecfb8be1 100644
--- a/xmlsecurity/source/framework/securityengine.cxx
+++ b/xmlsecurity/source/framework/securityengine.cxx
@@ -18,7 +18,7 @@
*/
-#include "securityengine.hxx"
+#include "framework/securityengine.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.hxx b/xmlsecurity/source/framework/signaturecreatorimpl.hxx
index 2171738b5208..81a8fc3f2731 100644
--- a/xmlsecurity/source/framework/signaturecreatorimpl.hxx
+++ b/xmlsecurity/source/framework/signaturecreatorimpl.hxx
@@ -29,7 +29,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <cppuhelper/implbase.hxx>
-#include "signatureengine.hxx"
+#include "framework/signatureengine.hxx"
typedef cppu::ImplInheritanceHelper
<
diff --git a/xmlsecurity/source/framework/signatureengine.cxx b/xmlsecurity/source/framework/signatureengine.cxx
index 2cd8b1fc8e0f..ee7bf4551168 100644
--- a/xmlsecurity/source/framework/signatureengine.cxx
+++ b/xmlsecurity/source/framework/signatureengine.cxx
@@ -18,7 +18,7 @@
*/
-#include "signatureengine.hxx"
+#include "framework/signatureengine.hxx"
#include <com/sun/star/xml/crypto/XMLSignatureTemplate.hpp>
#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/xmlsecurity/source/framework/signatureverifierimpl.cxx b/xmlsecurity/source/framework/signatureverifierimpl.cxx
index 3d3c80d923ba..bbbef86896d2 100644
--- a/xmlsecurity/source/framework/signatureverifierimpl.cxx
+++ b/xmlsecurity/source/framework/signatureverifierimpl.cxx
@@ -18,7 +18,7 @@
*/
-#include "signatureverifierimpl.hxx"
+#include "framework/signatureverifierimpl.hxx"
#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp>
#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/xmlsecurity/source/framework/xsec_framework.cxx b/xmlsecurity/source/framework/xsec_framework.cxx
index c16170c110d0..f05b95eb2b96 100644
--- a/xmlsecurity/source/framework/xsec_framework.cxx
+++ b/xmlsecurity/source/framework/xsec_framework.cxx
@@ -25,7 +25,7 @@
#include "decryptorimpl.hxx"
#include "encryptorimpl.hxx"
#include "signaturecreatorimpl.hxx"
-#include "signatureverifierimpl.hxx"
+#include "framework/signatureverifierimpl.hxx"
#include "saxeventkeeperimpl.hxx"
#include "xmlencryptiontemplateimpl.hxx"
#include "xmlsignaturetemplateimpl.hxx"
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index db8badafd7e9..8eb227386a2d 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -21,6 +21,7 @@
#include "xsecctl.hxx"
#include "xsecparser.hxx"
#include "ooxmlsecparser.hxx"
+#include "framework/signatureverifierimpl.hxx"
#include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp>
#include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp>
@@ -38,9 +39,6 @@ namespace cssl = com::sun::star::lang;
namespace cssxc = com::sun::star::xml::crypto;
namespace cssxs = com::sun::star::xml::sax;
-/* xml security framework components */
-#define SIGNATUREVERIFIER_COMPONENT "com.sun.star.xml.crypto.sax.SignatureVerifier"
-
/* protected: for signature verify */
cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepareSignatureToRead(
sal_Int32 nSecurityId)
@@ -62,9 +60,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
* create a SignatureVerifier
*/
cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
- xReferenceResolvedListener.set(
- xMCF->createInstanceWithContext(SIGNATUREVERIFIER_COMPONENT, mxCtx),
- cssu::UNO_QUERY);
+ xReferenceResolvedListener = new SignatureVerifierImpl(mxCtx);
cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY);