From 7a6083cf2a96b15d660fd0f5e35164726ab2fd6b Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Thu, 22 Jul 2004 09:34:22 +0000 Subject: #i21596# Digital Signatures... --- xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 15 +++++++++++---- xmlsecurity/source/helper/xmlsignaturehelper.cxx | 10 +++++----- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'xmlsecurity') diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index dbfec8d4a5f9..e773404d7736 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: digitalsignaturesdialog.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: mt $ $Date: 2004-07-19 06:45:40 $ + * last change: $Author: mt $ $Date: 2004-07-22 10:34:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -213,11 +213,18 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG ) CertificateChooser aChooser( this, xSecEnv, aCurrentSignatureInformations ); if( aChooser.Execute() ) { + uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser.GetSelectedCertificate(); + rtl::OUString aCertSerial = bigIntegerToNumericString( xCert->getSerialNumber() ); + if ( !aCertSerial.getLength() ) + { + DBG_ERROR( "Error in Certificate, problem with serial number!" ); + return -1; + } + maSignatureHelper.StartMission(); sal_Int32 nSecurityId = maSignatureHelper.GetNewSecurityId(); - uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser.GetSelectedCertificate(); - maSignatureHelper.SetX509Certificate( nSecurityId, xCert->getIssuerName(), bigIntegerToNumericString( xCert->getSerialNumber() ) ); + maSignatureHelper.SetX509Certificate( nSecurityId, xCert->getIssuerName(), aCertSerial ); std::vector< rtl::OUString > aElements = DocumentSignatureHelper::CreateElementList( mxStore, rtl::OUString(), meSignatureMode ); diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx index c0f05769ad9d..3809ff3bc13c 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlsignaturehelper.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: mt $ $Date: 2004-07-21 14:31:25 $ + * last change: $Author: mt $ $Date: 2004-07-22 10:34:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,6 +72,8 @@ #include #include #include +#include + #include #include @@ -98,10 +100,8 @@ XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< lang::XMultiServic XMLSignatureHelper::~XMLSignatureHelper() { - if (mxSEInitializer.is()) - { + if ( mxSEInitializer.is() && mxSecurityContext.is() ) mxSEInitializer->freeSecurityContext( mxSecurityContext ); - } } bool XMLSignatureHelper::Init( const rtl::OUString& rTokenPath ) -- cgit v1.2.3