diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-10 15:12:26 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-10 17:53:06 +0100 |
commit | d06e6505f454eeff69327b22d5a5592375d31518 (patch) | |
tree | d402f977d87eac3ef4e94e3886752aba79778811 | |
parent | a2779756374d9e71e9ed6a1d7665f64cc5eacb0f (diff) |
xmlsecurity OOXML export: write signature description
Change-Id: I29937cf6baa02bda7821b4bb44c95e5b8a278080
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.cxx | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index a4ad8604bf9a..6aec0f6d51d4 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())); |