summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/helper/documentsignaturehelper.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-01-13 09:34:01 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-13 09:54:50 +0100
commite62ba5bb3f032e7064bf1f643bae449b0e612787 (patch)
treeadd297b5ef12875ca658b15a7a97911d843e52bf /xmlsecurity/source/helper/documentsignaturehelper.cxx
parentfaf636b09fdc634bd1ec136cc29c0a146469e289 (diff)
xmlsecurity: don't assume the signature is always a single stream
Change-Id: I07ce23d698fea9338a85b086a5a3c3418e8c8290
Diffstat (limited to 'xmlsecurity/source/helper/documentsignaturehelper.cxx')
-rw-r--r--xmlsecurity/source/helper/documentsignaturehelper.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx
index fd916c651a4e..6150492fa96d 100644
--- a/xmlsecurity/source/helper/documentsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -330,6 +331,18 @@ SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
DBG_ASSERT( nOpenMode == css::embed::ElementModes::READ, "Error creating signature stream..." );
}
}
+ else if(xNameAccess->hasByName("_xmlsignatures"))
+ {
+ try
+ {
+ aHelper.xSignatureStorage = rxStore->openStorageElement("_xmlsignatures", nSubStorageOpenMode);
+ aHelper.nStorageFormat = embed::StorageFormats::OFOPXML;
+ }
+ catch (const io::IOException& rException)
+ {
+ SAL_WARN("xmlsecurity.helper", "DocumentSignatureHelper::OpenSignatureStream: " << rException.Message);
+ }
+ }
return aHelper;
}