[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/Library_xmlsecurity.mk xmlsecurity/Library_xsec_fw.mk xmlsecurity/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Nov 24 14:23:12 UTC 2016


 xmlsecurity/Library_xmlsecurity.mk                     |    1 
 xmlsecurity/Library_xsec_fw.mk                         |    4 
 xmlsecurity/inc/framework/securityengine.hxx           |  150 +++++++++++++++++
 xmlsecurity/inc/framework/signatureengine.hxx          |  127 ++++++++++++++
 xmlsecurity/inc/framework/signatureverifierimpl.hxx    |  104 +++++++++++
 xmlsecurity/inc/xsecfwdllapi.h                         |   23 ++
 xmlsecurity/source/framework/encryptionengine.hxx      |    2 
 xmlsecurity/source/framework/securityengine.cxx        |    2 
 xmlsecurity/source/framework/securityengine.hxx        |  150 -----------------
 xmlsecurity/source/framework/signaturecreatorimpl.hxx  |    2 
 xmlsecurity/source/framework/signatureengine.cxx       |    2 
 xmlsecurity/source/framework/signatureengine.hxx       |  126 --------------
 xmlsecurity/source/framework/signatureverifierimpl.cxx |    2 
 xmlsecurity/source/framework/signatureverifierimpl.hxx |  103 -----------
 xmlsecurity/source/framework/xsec_framework.cxx        |    2 
 xmlsecurity/source/helper/xsecverify.cxx               |    8 
 16 files changed, 417 insertions(+), 391 deletions(-)

New commits:
commit 9691cea443a74885b3f81c602efdd3345de1e3f9
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Nov 24 08:24:29 2016 +0100

    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 at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/xmlsecurity/Library_xmlsecurity.mk b/xmlsecurity/Library_xmlsecurity.mk
index 487011f..af56123 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 fb58538..8d75537 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
similarity index 97%
rename from xmlsecurity/source/framework/securityengine.hxx
rename to xmlsecurity/inc/framework/securityengine.hxx
index 17fab0d..964f5ae 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
similarity index 95%
rename from xmlsecurity/source/framework/signatureengine.hxx
rename to xmlsecurity/inc/framework/signatureengine.hxx
index 4ba5d8c..ee6c79a 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
similarity index 94%
rename from xmlsecurity/source/framework/signatureverifierimpl.hxx
rename to xmlsecurity/inc/framework/signatureverifierimpl.hxx
index 5159b86..f31f7ac 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 0000000..d6cee81
--- /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 2fe4775..7c8f164 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 27638f7..80e7ecf 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 2171738..81a8fc3 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 2cd8b1f..ee7bf45 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 3d3c80d..bbbef86 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 c16170c..f05b95e 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 db8bada..8eb2273 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);
 


More information about the Libreoffice-commits mailing list