summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/helper/documentsignaturemanager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlsecurity/source/helper/documentsignaturemanager.cxx')
-rw-r--r--xmlsecurity/source/helper/documentsignaturemanager.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index 042b5d7065a8..041c3f2a0113 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -37,6 +37,8 @@
#include <certificate.hxx>
#include <biginteger.hxx>
+#include <xmlsec/xmlsec_init.hxx>
+
using namespace css;
DocumentSignatureManager::DocumentSignatureManager(const uno::Reference<uno::XComponentContext>& xContext, DocumentSignatureMode eMode)
@@ -46,7 +48,10 @@ DocumentSignatureManager::DocumentSignatureManager(const uno::Reference<uno::XCo
{
}
-DocumentSignatureManager::~DocumentSignatureManager() = default;
+DocumentSignatureManager::~DocumentSignatureManager()
+{
+ deInitXmlSec();
+}
bool DocumentSignatureManager::init()
{
@@ -54,6 +59,9 @@ bool DocumentSignatureManager::init()
SAL_WARN_IF(mxSecurityContext.is(), "xmlsecurity.helper", "DocumentSignatureManager::Init - mxSecurityContext already set!");
SAL_WARN_IF(mxGpgSEInitializer.is(), "xmlsecurity.helper", "DocumentSignatureManager::Init - mxGpgSEInitializer already set!");
+ // xmlsec is needed by both services, so init before those
+ initXmlSec();
+
mxSEInitializer = xml::crypto::SEInitializer::create(mxContext);
#if !defined(MACOSX) && !defined(WNT)
mxGpgSEInitializer.set(new SEInitializerGpg(mxContext));