diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-10 16:32:20 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-10 17:53:06 +0100 |
commit | f4b2e2362513e4442fe1d133302bd9b487866c6a (patch) | |
tree | 0593b2959ef62250d604cbf00490ba0a220b61cd /xmlsecurity/source | |
parent | d06e6505f454eeff69327b22d5a5592375d31518 (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
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 41834d7f7b98..d3262bb5bb88 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 { |