summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-05 11:01:11 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-05 11:02:32 +0100
commit79d565408eabc846692a2ed027707e6fe33adba4 (patch)
treebe31c07b5ffbcec8876b3fc035cf4d61edcbc2c7 /sfx2
parent080e5f2f24513e871f2563c88a69fa8a9ecfe0eb (diff)
xmlsecurity: ensure OOXML signatures relation when adding a signature
A 'signatures relation' is kind of a pointer that says where is the list of signatures. When adding the first signature, this has to be created, in addition to the actual signature relation. This is yet another difference to ODF signing, where the signature is just another additional stream in the package, while OOXML signing first modifies the package to add the signatures relation, and then signs the streams, so the input storage of the OOXML signing can't be a read-only storage. Change-Id: I81a976c945b28ddf7f347c4a7bfd51f98a1fc225
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index af4224a1cb44..0f4ec6794ddd 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3607,7 +3607,8 @@ bool SfxMedium::SignContents_Impl( bool bScriptingContent, const OUString& aODFV
{
// OOXML.
uno::Reference<io::XStream> xStream;
- if (xSigner->signDocumentContent(GetZipStorageToSign_Impl(), xStream))
+ // We need read-write to be able to add the signature relation.
+ if (xSigner->signDocumentContent(GetZipStorageToSign_Impl(/*bReadOnly=*/false), xStream))
{
uno::Reference<embed::XTransactedObject> xTransact(xWriteableZipStor, uno::UNO_QUERY_THROW);
xTransact->commit();