summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-10 16:32:20 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-07 12:22:00 +0200
commit81afd36fe105ed919276eb3489f841b44cc13af6 (patch)
tree1bd0669781964c15779e9d98abd52de2225d4e86 /xmlsecurity
parent137c8d944426c7b16e6e433993c756552cff1dc5 (diff)
xmlsecurity: fix reading OOXML signature from temp storage
When reading a signature, we just take the ODF signature stream or OOXML signature storage. When writing, we write to an ODF temporary stream / OOXML temporary storage, read it back, and only the signatures dialog close handler writes the signature back to the original file. The underlying OOXML temporary storage's stream is the signature stream, so only try to load signatures from the stream if it's not OOXML, throwing a ZIP file at an XML parser is not a great idea. Change-Id: I6e42d117b9c97676aaeaad158e78e39a2c39a5e8 (cherry picked from commit f4b2e2362513e4442fe1d133302bd9b487866c6a)
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index a177eadbe9b1..0229dce60579 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -773,7 +773,7 @@ void DigitalSignaturesDialog::ImplGetSignatureInformations(bool bUseTempStream)
SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream(
css::embed::ElementModes::READ, bUseTempStream);
- if ( aStreamHelper.xSignatureStream.is() )
+ if ( aStreamHelper.nStorageFormat != embed::StorageFormats::OFOPXML && aStreamHelper.xSignatureStream.is() )
{
uno::Reference< io::XInputStream > xInputStream( aStreamHelper.xSignatureStream, uno::UNO_QUERY );
maSignatureHelper.ReadAndVerifySignature( xInputStream );
@@ -852,6 +852,8 @@ SignatureStreamHelper DigitalSignaturesDialog::ImplOpenSignatureStream(
OSL_ASSERT(mxTempSignatureStream.is());
}
aHelper.xSignatureStream = mxTempSignatureStream;
+ if (aHelper.nStorageFormat == embed::StorageFormats::OFOPXML)
+ aHelper.xSignatureStorage = mxTempSignatureStorage;
}
else
{