Kaydet (Commit) fec0cdad authored tarafından Jens-Heiner Rechtien's avatar Jens-Heiner Rechtien

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
üst 09302ad8
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: documentdigitalsignatures.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -248,7 +248,7 @@ Sequence< ::com::sun::star::security::DocumentSignaturesInformation > DocumentDi ...@@ -248,7 +248,7 @@ Sequence< ::com::sun::star::security::DocumentSignaturesInformation > DocumentDi
{ {
const SignatureInformation& rInfo = aSignInfos[n]; const SignatureInformation& rInfo = aSignInfos[n];
aInfos[n].Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName, numericStringToBigInteger( rInfo.ouX509SerialNumber ) ); 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 ) ; aInfos[n].Signer = xSecEnv->createCertificateFromAscii( rInfo.ouX509Certificate ) ;
// --> PB 2004-12-14 #i38744# time support again // --> PB 2004-12-14 #i38744# time support again
...@@ -263,6 +263,13 @@ Sequence< ::com::sun::star::security::DocumentSignaturesInformation > DocumentDi ...@@ -263,6 +263,13 @@ Sequence< ::com::sun::star::security::DocumentSignaturesInformation > DocumentDi
aInfos[n].SignatureIsValid = ( rInfo.nStatus == ::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED ); 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 ) if ( aInfos[n].SignatureIsValid )
{ {
// Can only be valid if ALL streams are signed, which means real stream count == signed stream count // 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 ...@@ -285,17 +292,19 @@ Sequence< ::com::sun::star::security::DocumentSignaturesInformation > DocumentDi
void DocumentDigitalSignatures::manageTrustedSources( ) throw (RuntimeException) 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, xSecEnv );
{ aDlg.Execute();
MacroSecurity aDlg( NULL, aSignatureHelper.GetSecurityEnvironment() );
aDlg.Execute();
}
} }
void DocumentDigitalSignatures::showCertificate( const Reference< ::com::sun::star::security::XCertificate >& _Certificate ) throw (RuntimeException) void DocumentDigitalSignatures::showCertificate( const Reference< ::com::sun::star::security::XCertificate >& _Certificate ) throw (RuntimeException)
......
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