summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/component/documentdigitalsignatures.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2005-04-08 15:19:50 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2005-04-08 15:19:50 +0000
commitfec0cdadefe460288d4eebde991c88a1c5eed66e (patch)
tree6c75485652a9d6894132d7ac5f56abf5e535f165 /xmlsecurity/source/component/documentdigitalsignatures.cxx
parent09302ad8e24918103a36d5bf42a4c9f33cf3fdf4 (diff)
INTEGRATION: CWS xmlsec11 (1.18.6); FILE MERGED
2005/04/06 06:35:37 mt 1.18.6.4: #i46696# KEY_NOT_FOUND can also happen if certificate is not attached... 2005/04/05 10:16:36 mt 1.18.6.3: #i46696# wrong broken declaration... 2005/04/04 10:24:23 mt 1.18.6.2: RESYNC: (1.18-1.19); FILE MERGED 2005/03/31 15:49:56 mt 1.18.6.1: #i45295# Raise macro security dialog even without security environment
Diffstat (limited to 'xmlsecurity/source/component/documentdigitalsignatures.cxx')
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx31
1 files changed, 20 insertions, 11 deletions
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index a5464e68e441..9db49ba87b76 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: documentdigitalsignatures.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: rt $ $Date: 2005-03-29 13:18:24 $
+ * last change: $Author: hr $ $Date: 2005-04-08 16:19:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -248,7 +248,7 @@ Sequence< ::com::sun::star::security::DocumentSignaturesInformation > DocumentDi
{
const SignatureInformation& rInfo = aSignInfos[n];
aInfos[n].Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName, numericStringToBigInteger( rInfo.ouX509SerialNumber ) );
- if ( !aInfos[n].Signer.is() )
+ if ( !aInfos[n].Signer.is() && rInfo.ouX509Certificate.getLength() )
aInfos[n].Signer = xSecEnv->createCertificateFromAscii( rInfo.ouX509Certificate ) ;
// --> PB 2004-12-14 #i38744# time support again
@@ -263,6 +263,13 @@ Sequence< ::com::sun::star::security::DocumentSignaturesInformation > DocumentDi
aInfos[n].SignatureIsValid = ( rInfo.nStatus == ::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED );
+ // HACK for #i46696#
+ // Should only happen because of author or issuer certificates are missing in keystore.
+ // We always have the key from authors certificate, because it's attached.
+ // This is a question of trust, not of a *broken* signature.
+ if ( ( rInfo.nStatus == ::com::sun::star::xml::crypto::SecurityOperationStatus_KEY_NOT_FOUND ) && rInfo.ouX509Certificate.getLength() )
+ aInfos[n].SignatureIsValid = sal_True;
+
if ( aInfos[n].SignatureIsValid )
{
// Can only be valid if ALL streams are signed, which means real stream count == signed stream count
@@ -285,17 +292,19 @@ Sequence< ::com::sun::star::security::DocumentSignaturesInformation > DocumentDi
void DocumentDigitalSignatures::manageTrustedSources( ) throw (RuntimeException)
{
- XMLSignatureHelper aSignatureHelper( mxMSF );
+ // MT: i45295
+ // SecEnv is only needed to display certificate information from trusted sources.
+ // Macro Security also has some options where no security environment is needed, so raise dialog anyway.
+ // Later I should change the code so the Dialog creates the SecEnv on demand...
- bool bInit = aSignatureHelper.Init( rtl::OUString() );
+ cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > xSecEnv;
- DBG_ASSERT( bInit, "Error initializing security context!" );
+ XMLSignatureHelper aSignatureHelper( mxMSF );
+ if ( aSignatureHelper.Init( rtl::OUString() ) )
+ xSecEnv = aSignatureHelper.GetSecurityEnvironment();
- if ( bInit )
- {
- MacroSecurity aDlg( NULL, aSignatureHelper.GetSecurityEnvironment() );
- aDlg.Execute();
- }
+ MacroSecurity aDlg( NULL, xSecEnv );
+ aDlg.Execute();
}
void DocumentDigitalSignatures::showCertificate( const Reference< ::com::sun::star::security::XCertificate >& _Certificate ) throw (RuntimeException)