summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/helper/xmlsignaturehelper.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-11 09:20:24 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-11 11:00:44 +0100
commit67785148837b4ba5ebef1b2cdf249a8f8cad8b9d (patch)
tree5c516b128e2899ea901267efcc466dc39719f1c8 /xmlsecurity/source/helper/xmlsignaturehelper.cxx
parent85d18c4ed044da60e9d6d180937ac8e3a3a9c6fa (diff)
xmlsecurity: export OOXML signature relations to persistent storage
With this, _xmlsignatures/_rels/origin.sigs.rels and _xmlsignatures/origin.sigs is written to the destination file. Change-Id: I8d63a182e7cf05ed20195f88c90fba2a9a05379e
Diffstat (limited to 'xmlsecurity/source/helper/xmlsignaturehelper.cxx')
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 5ed47a83fbd4..b778d9aec460 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -377,6 +377,13 @@ bool XMLSignatureHelper::ReadAndVerifySignatureStorage(const uno::Reference<embe
std::vector<beans::StringPair>::iterator it = std::find_if(aRelation.begin(), aRelation.end(), [](const beans::StringPair& rPair) { return rPair.First == "Target"; });
if (it != aRelation.end())
{
+ uno::Reference<container::XNameAccess> xNameAccess(xStorage, uno::UNO_QUERY);
+ if (xNameAccess.is() && !xNameAccess->hasByName(it->Second))
+ {
+ SAL_WARN("xmlsecurity.helper", "expected stream, but not found: " << it->Second);
+ continue;
+ }
+
uno::Reference<io::XInputStream> xInputStream(xStorage->openStreamElement(it->Second, nOpenMode), uno::UNO_QUERY);
if (!ReadAndVerifySignatureStorageStream(xInputStream))
return false;