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

xmlsecurity: refactor to allow multiple signature parser implementations

Change-Id: I1d1ae4a0bf41b89fe2f8db9b44d3b0b7a0dfd1cd
üst 5524754e
...@@ -56,7 +56,6 @@ XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>& ...@@ -56,7 +56,6 @@ XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>&
, m_nStatusOfSecurityComponents(UNINITIALIZED) , m_nStatusOfSecurityComponents(UNINITIALIZED)
, m_bIsSAXEventKeeperSticky(false) , m_bIsSAXEventKeeperSticky(false)
, m_pErrorMessage(nullptr) , m_pErrorMessage(nullptr)
, m_pXSecParser(nullptr)
, m_nReservedSignatureId(0) , m_nReservedSignatureId(0)
, m_bVerifyCurrentSignature(false) , m_bVerifyCurrentSignature(false)
{ {
......
...@@ -310,7 +310,7 @@ private: ...@@ -310,7 +310,7 @@ private:
/* /*
* the XSecParser which is used to parse the signature stream * 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 * the caller assigned signature id for the next signature in the
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <sal/log.hxx> #include <sal/log.hxx>
#include <unotools/datetime.hxx> #include <unotools/datetime.hxx>
using namespace com::sun::star;
namespace cssu = com::sun::star::uno; namespace cssu = com::sun::star::uno;
namespace cssl = com::sun::star::lang; namespace cssl = com::sun::star::lang;
namespace cssxc = com::sun::star::xml::crypto; namespace cssxc = com::sun::star::xml::crypto;
...@@ -371,7 +372,7 @@ void XSecController::collectToVerify( const OUString& referenceId ) ...@@ -371,7 +372,7 @@ void XSecController::collectToVerify( const OUString& referenceId )
void XSecController::addSignature( sal_Int32 nSignatureId ) 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_nReservedSignatureId = nSignatureId;
m_bVerifyCurrentSignature = true; m_bVerifyCurrentSignature = true;
...@@ -379,18 +380,18 @@ void XSecController::addSignature( sal_Int32 nSignatureId ) ...@@ -379,18 +380,18 @@ void XSecController::addSignature( sal_Int32 nSignatureId )
cssu::Reference< cssxs::XDocumentHandler > XSecController::createSignatureReader() cssu::Reference< cssxs::XDocumentHandler > XSecController::createSignatureReader()
{ {
m_pXSecParser = new XSecParser( this, nullptr ); m_xSecParser = new XSecParser( this, nullptr );
cssu::Reference< cssl::XInitialization > xInitialization = m_pXSecParser; cssu::Reference< cssl::XInitialization > xInitialization(m_xSecParser, uno::UNO_QUERY);
setSAXChainConnector(xInitialization, nullptr, nullptr); setSAXChainConnector(xInitialization, nullptr, nullptr);
return m_pXSecParser; return m_xSecParser;
} }
void XSecController::releaseSignatureReader() void XSecController::releaseSignatureReader()
{ {
clearSAXChainConnector( ); clearSAXChainConnector( );
m_pXSecParser = nullptr; m_xSecParser.clear();
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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