Kaydet (Commit) 9691cea4 authored tarafından Miklos Vajna's avatar Miklos Vajna

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/31148Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 6eaa7a41
......@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_libraries,xmlsecurity,\
vcl \
xo \
i18nlangtag \
xsec_fw \
$(gb_UWINAPI) \
))
......
......@@ -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))
......
......@@ -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>
......
......@@ -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,
......
......@@ -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
......
/* -*- 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: */
......@@ -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;
......
......@@ -18,7 +18,7 @@
*/
#include "securityengine.hxx"
#include "framework/securityengine.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
......
......@@ -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
<
......
......@@ -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>
......
......@@ -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>
......
......@@ -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"
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment