summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-01-13 09:37:10 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-13 09:54:50 +0100
commitdbfb82b6da0f4e6d7be9a0010eb4db8e1bf92ee0 (patch)
tree21a1b2262559a022bc691fb6e5ccb6b5002b8d8b
parent5524754e9f7c936f7152f49815af0e11d9c92613 (diff)
xmlsecurity: refactor to allow multiple signature parser implementations
Change-Id: I1d1ae4a0bf41b89fe2f8db9b44d3b0b7a0dfd1cd
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx1
-rw-r--r--xmlsecurity/source/helper/xsecctl.hxx2
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx11
3 files changed, 7 insertions, 7 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index 2cdfbb1b2994..cc6a2e14cd68 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -56,7 +56,6 @@ XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>&
, m_nStatusOfSecurityComponents(UNINITIALIZED)
, m_bIsSAXEventKeeperSticky(false)
, m_pErrorMessage(nullptr)
- , m_pXSecParser(nullptr)
, m_nReservedSignatureId(0)
, m_bVerifyCurrentSignature(false)
{
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index 916fb3cac3c2..734ecdb4b75a 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -310,7 +310,7 @@ private:
/*
* the XSecParser which is used to parse the signature stream
*/
- XSecParser *m_pXSecParser;
+ css::uno::Reference<css::xml::sax::XDocumentHandler> m_xSecParser;
/*
* the caller assigned signature id for the next signature in the
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index 6f09354a1e36..ba89bad64939 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -31,6 +31,7 @@
#include <sal/log.hxx>
#include <unotools/datetime.hxx>
+using namespace com::sun::star;
namespace cssu = com::sun::star::uno;
namespace cssl = com::sun::star::lang;
namespace cssxc = com::sun::star::xml::crypto;
@@ -371,7 +372,7 @@ void XSecController::collectToVerify( const OUString& referenceId )
void XSecController::addSignature( sal_Int32 nSignatureId )
{
- DBG_ASSERT( m_pXSecParser != nullptr, "No XSecParser initialized" );
+ DBG_ASSERT( m_xSecParser.is(), "No XSecParser initialized" );
m_nReservedSignatureId = nSignatureId;
m_bVerifyCurrentSignature = true;
@@ -379,18 +380,18 @@ void XSecController::addSignature( sal_Int32 nSignatureId )
cssu::Reference< cssxs::XDocumentHandler > XSecController::createSignatureReader()
{
- m_pXSecParser = new XSecParser( this, nullptr );
- cssu::Reference< cssl::XInitialization > xInitialization = m_pXSecParser;
+ m_xSecParser = new XSecParser( this, nullptr );
+ cssu::Reference< cssl::XInitialization > xInitialization(m_xSecParser, uno::UNO_QUERY);
setSAXChainConnector(xInitialization, nullptr, nullptr);
- return m_pXSecParser;
+ return m_xSecParser;
}
void XSecController::releaseSignatureReader()
{
clearSAXChainConnector( );
- m_pXSecParser = nullptr;
+ m_xSecParser.clear();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */