From e89610dad647ea5c77805ff06af1ea9870ae9f15 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 4 Mar 2016 10:49:12 +0100 Subject: xmlsecurity OOXML export: only cache existing signatures, not our temp. one When adding a signature, first we export it to a temp. storage, then read it back, show the verification to the user, and then later we do or do not write the temp. storage back to the original one. This means the signature gets exported two times, and MSO only considers the final result valid. So when caching signatures (to avoid a real export based on our data model), don't cache the one we just added to the temp. storage, but do a real export second time as well. With this, MSO considers our appended signature (next to an existing one) valid, too. Change-Id: I4d615298463e037ea4e654ff5c3addcef8b0a094 --- xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xmlsecurity/source/dialogs') diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 77d058d0a7e2..8e7806e12453 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -413,7 +413,7 @@ IMPL_LINK_NOARG_TYPED(DigitalSignaturesDialog, AddButtonHdl, Button*, void) // will not contain // SecurityOperationStatus_OPERATION_SUCCEEDED mbVerifySignatures = true; - ImplGetSignatureInformations(true); + ImplGetSignatureInformations(true, /*bCacheLastSignature=*/false); ImplFillSignaturesBox(); } } @@ -422,7 +422,7 @@ IMPL_LINK_NOARG_TYPED(DigitalSignaturesDialog, AddButtonHdl, Button*, void) { OSL_FAIL( "Exception while adding a signature!" ); // Don't keep invalid entries... - ImplGetSignatureInformations(true); + ImplGetSignatureInformations(true, /*bCacheLastSignature=*/false); ImplFillSignaturesBox(); } } @@ -624,9 +624,9 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() //If bUseTempStream is true then the temporary signature stream is used. //Otherwise the real signature stream is used. -void DigitalSignaturesDialog::ImplGetSignatureInformations(bool bUseTempStream) +void DigitalSignaturesDialog::ImplGetSignatureInformations(bool bUseTempStream, bool bCacheLastSignature) { - maSignatureManager.read(bUseTempStream); + maSignatureManager.read(bUseTempStream, bCacheLastSignature); mbVerifySignatures = false; } -- cgit