[Libreoffice-commits] core.git: xmlsecurity/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Feb 15 10:12:36 UTC 2016
xmlsecurity/source/helper/xmlsignaturehelper.cxx | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
New commits:
commit 24c20f1e1689fcae39c1b9809f107e8f7425944e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Feb 15 10:51:12 2016 +0100
xmlsecurity OOXML export: fix missing rels content-type
This wasn't a problem when we signed MSO-produced documents that have
these all the time, but it was a problem for LO-produced documents.
We don't add an explicit content type for _xmlsignatures/origin.sigs, so
need a default for the .sigs extension.
Change-Id: Ic5d0647991c42f9f1ef3519986a4bd1b56de396d
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 056a187..59f2cac 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -525,18 +525,23 @@ void XMLSignatureHelper::ExportSignatureContentTypes(css::uno::Reference<css::em
return;
}
- // Append sigs to defaults, if it's not there already.
+ // Append rels and sigs to defaults, if it's not there already.
uno::Sequence<beans::StringPair>& rDefaults = aContentTypeInfo[0];
+ auto aDefaults = comphelper::sequenceToContainer< std::vector<beans::StringPair> >(rDefaults);
auto it = std::find_if(rDefaults.begin(), rDefaults.end(), [](const beans::StringPair& rPair)
{
- return rPair.First == "sigs";
+ return rPair.First == "rels";
});
if (it == rDefaults.end())
+ aDefaults.push_back(beans::StringPair("rels", "application/vnd.openxmlformats-package.relationships+xml"));
+
+ it = std::find_if(rDefaults.begin(), rDefaults.end(), [](const beans::StringPair& rPair)
{
- auto aDefaults = comphelper::sequenceToContainer< std::vector<beans::StringPair> >(rDefaults);
+ return rPair.First == "sigs";
+ });
+ if (it == rDefaults.end())
aDefaults.push_back(beans::StringPair("sigs", "application/vnd.openxmlformats-package.digital-signature-origin"));
- rDefaults = comphelper::containerToSequence(aDefaults);
- }
+ rDefaults = comphelper::containerToSequence(aDefaults);
// Remove existing signature overrides.
uno::Sequence<beans::StringPair>& rOverrides = aContentTypeInfo[1];
More information about the Libreoffice-commits
mailing list