summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-10 15:12:26 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-07 12:21:54 +0200
commit137c8d944426c7b16e6e433993c756552cff1dc5 (patch)
tree1c3746d807b709fca8a8c43f42776341e9205559 /xmlsecurity
parent81588a6408b6e93d772512553834e42eda3ccfd7 (diff)
xmlsecurity OOXML export: write signature description
Change-Id: I29937cf6baa02bda7821b4bb44c95e5b8a278080 (cherry picked from commit d06e6505f454eeff69327b22d5a5592375d31518)
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index afe28cd7644e..2bd8ec4d8f6a 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -1219,11 +1219,69 @@ void XSecController::exportOOXMLSignature(const uno::Reference<embed::XStorage>&
xDocumentHandler->endElement(TAG_OBJECT);
+ // idOfficeObject
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
pAttributeList->AddAttribute(ATTR_ID, "idOfficeObject");
xDocumentHandler->startElement(TAG_OBJECT, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
+ xDocumentHandler->startElement(TAG_SIGNATUREPROPERTIES, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ {
+ rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
+ pAttributeList->AddAttribute(ATTR_ID, "idOfficeV1Details");
+ pAttributeList->AddAttribute(ATTR_TARGET, "#idPackageSignature");
+ xDocumentHandler->startElement(TAG_SIGNATUREPROPERTY, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ }
+ {
+ rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
+ pAttributeList->AddAttribute(ATTR_XMLNS, "http://schemas.microsoft.com/office/2006/digsig");
+ xDocumentHandler->startElement("SignatureInfoV1", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ }
+ xDocumentHandler->startElement("SetupId", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->endElement("SetupId");
+ xDocumentHandler->startElement("SignatureText", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->endElement("SignatureText");
+ xDocumentHandler->startElement("SignatureImage", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->endElement("SignatureImage");
+ xDocumentHandler->startElement("SignatureComments", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters(rInformation.ouDescription);
+ xDocumentHandler->endElement("SignatureComments");
+ // Just hardcode something valid according to [MS-OFFCRYPTO].
+ xDocumentHandler->startElement("WindowsVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("6.1");
+ xDocumentHandler->endElement("WindowsVersion");
+ xDocumentHandler->startElement("OfficeVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("16.0");
+ xDocumentHandler->endElement("OfficeVersion");
+ xDocumentHandler->startElement("ApplicationVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("16.0");
+ xDocumentHandler->endElement("ApplicationVersion");
+ xDocumentHandler->startElement("Monitors", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("1");
+ xDocumentHandler->endElement("Monitors");
+ xDocumentHandler->startElement("HorizontalResolution", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("1280");
+ xDocumentHandler->endElement("HorizontalResolution");
+ xDocumentHandler->startElement("VerticalResolution", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("800");
+ xDocumentHandler->endElement("VerticalResolution");
+ xDocumentHandler->startElement("ColorDepth", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("32");
+ xDocumentHandler->endElement("ColorDepth");
+ xDocumentHandler->startElement("SignatureProviderId", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("{00000000-0000-0000-0000-000000000000}");
+ xDocumentHandler->endElement("SignatureProviderId");
+ xDocumentHandler->startElement("SignatureProviderUrl", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->endElement("SignatureProviderUrl");
+ xDocumentHandler->startElement("SignatureProviderDetails", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("9"); // This is what MSO 2016 writes, though [MS-OFFCRYPTO] doesn't document what the value means.
+ xDocumentHandler->endElement("SignatureProviderDetails");
+ xDocumentHandler->startElement("SignatureType", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("1");
+ xDocumentHandler->endElement("SignatureType");
+ xDocumentHandler->endElement("SignatureInfoV1");
+ xDocumentHandler->endElement(TAG_SIGNATUREPROPERTY);
+ xDocumentHandler->endElement(TAG_SIGNATUREPROPERTIES);
xDocumentHandler->endElement(TAG_OBJECT);
xDocumentHandler->startElement(TAG_OBJECT, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));