diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-08 14:10:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-08 14:50:56 +0000 |
commit | a69873d212c903ea8a1f0d5ca40ae3f08b83a871 (patch) | |
tree | f1554b070e0525da09eaf482908780901b1ee324 /xmlsecurity/source/dialogs | |
parent | 2573f6bba6b3033143b776650f03fd4813669e5b (diff) |
xmlsecurity: move the sec context from the format helpers to the sign manager
The signature manager always creates an XML helper, and optionally creates a
PDF helper as well. Both of them initialize xmlsec, and when the signature
manager is deleted, there are two de-inits, leading to an assertion failure in
xmlsec.
Fix the problem by moving the duplicated xmlsec init to the signature manager.
This has the additional benefit that general security-related code no longer
has to talk to the XML helper, it can use the signature manager, which feels
more natural. (What viewing a certificate had to do with XML?)
Change-Id: If6a6bc433636445f3782849a367d4a7ac0be7688
Reviewed-on: https://gerrit.libreoffice.org/30695
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'xmlsecurity/source/dialogs')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 5d8ab1d38849..19ea5d04d2b3 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -212,7 +212,7 @@ void DigitalSignaturesDialog::dispose() bool DigitalSignaturesDialog::Init() { - bool bInit = maSignatureManager.maSignatureHelper.Init(); + bool bInit = maSignatureManager.init(); SAL_WARN_IF( !bInit, "xmlsecurity.dialogs", "Error initializing security context!" ); @@ -384,7 +384,7 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, AddButtonHdl, Button*, void) return; try { - uno::Reference<css::xml::crypto::XSecurityEnvironment> xSecEnv = maSignatureManager.maSignatureHelper.GetSecurityEnvironment(); + uno::Reference<xml::crypto::XSecurityEnvironment> xSecEnv = maSignatureManager.getSecurityEnvironment(); ScopedVclPtrInstance< CertificateChooser > aChooser( this, mxCtx, xSecEnv ); if ( aChooser->Execute() == RET_OK ) @@ -457,7 +457,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() { m_pSignaturesLB->Clear(); - uno::Reference< css::xml::crypto::XSecurityEnvironment > xSecEnv = maSignatureManager.maSignatureHelper.GetSecurityEnvironment(); + uno::Reference<xml::crypto::XSecurityEnvironment> xSecEnv = maSignatureManager.getSecurityEnvironment(); uno::Reference<css::security::XSerialNumberAdapter> xSerialNumberAdapter = css::security::SerialNumberAdapter::create(mxCtx); @@ -618,8 +618,7 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails() { sal_uInt16 nSelected = (sal_uInt16) reinterpret_cast<sal_uIntPtr>( m_pSignaturesLB->FirstSelected()->GetUserData() ); const SignatureInformation& rInfo = maSignatureManager.maCurrentSignatureInformations[ nSelected ]; - css::uno::Reference<css::xml::crypto::XSecurityEnvironment > xSecEnv = - maSignatureManager.maSignatureHelper.GetSecurityEnvironment(); + uno::Reference<xml::crypto::XSecurityEnvironment> xSecEnv = maSignatureManager.getSecurityEnvironment(); css::uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter = css::security::SerialNumberAdapter::create(mxCtx); // Use Certificate from doc, not from key store @@ -633,7 +632,7 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails() SAL_WARN_IF( !xCert.is(), "xmlsecurity.dialogs", "Error getting Certificate!" ); if ( xCert.is() ) { - ScopedVclPtrInstance< CertificateViewer > aViewer( this, maSignatureManager.maSignatureHelper.GetSecurityEnvironment(), xCert, false ); + ScopedVclPtrInstance<CertificateViewer> aViewer(this, maSignatureManager.getSecurityEnvironment(), xCert, false); aViewer->Execute(); } } |