diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-09 12:28:56 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-09 13:34:18 +0100 |
commit | 52c60fac3672476a0260248d3eb6f9ac7b96667f (patch) | |
tree | 44ecfe435cd95a5a1a62980ed8c79f716ca87f5e /xmlsecurity | |
parent | 4dcee42b44f56fec0b90ee6f7edcaaaa87adecdc (diff) |
xmlsecurity: OOXML export of idSignedProperties stub
If the signature refers to an XML element with that id, we must export
at least a stub, otherwise xmlSecDSigCtxSign() will refuse to do
anything with the signature template.
With this, at least some calculated hashes and signature values appear
in the OOXML output.
Change-Id: Iff26c6ae0b97bf3509144a66a2c23070100a5974
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.cxx | 14 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.hxx | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index 13c09af072da..b4c3031f5f1f 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -1109,7 +1109,21 @@ void XSecController::exportOOXMLSignature(const uno::Reference<xml::sax::XDocume xDocumentHandler->endElement(TAG_OBJECT); xDocumentHandler->startElement(TAG_OBJECT, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + { + rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + pAttributeList->AddAttribute(ATTR_XMLNS ":" NSTAG_XD, NS_XD); + pAttributeList->AddAttribute(ATTR_TARGET, "#idPackageSignature"); + xDocumentHandler->startElement(NSTAG_XD ":" TAG_QUALIFYINGPROPERTIES, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get())); + } + { + rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + pAttributeList->AddAttribute(ATTR_ID, "idSignedProperties"); + xDocumentHandler->startElement(NSTAG_XD ":" TAG_SIGNEDPROPERTIES, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get())); + } + xDocumentHandler->endElement(NSTAG_XD ":" TAG_SIGNEDPROPERTIES); + xDocumentHandler->endElement(NSTAG_XD ":" TAG_QUALIFYINGPROPERTIES); xDocumentHandler->endElement(TAG_OBJECT); + xDocumentHandler->endElement(TAG_SIGNATURE); } diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx index c7f5647f361c..ea436e3e2efe 100644 --- a/xmlsecurity/source/helper/xsecctl.hxx +++ b/xmlsecurity/source/helper/xsecctl.hxx @@ -81,6 +81,8 @@ #define TAG_TIMESTAMP "timestamp" #define TAG_DATE "date" #define TAG_DESCRIPTION "description" +#define TAG_QUALIFYINGPROPERTIES "QualifyingProperties" +#define TAG_SIGNEDPROPERTIES "SignedProperties" #define ATTR_XMLNS "xmlns" #define ATTR_ALGORITHM "Algorithm" @@ -89,10 +91,12 @@ #define ATTR_TARGET "Target" #define NSTAG_DC "dc" +#define NSTAG_XD "xd" #define NS_XMLDSIG "http://www.w3.org/2000/09/xmldsig#" //#define NS_DATETIME "http://www.ietf.org/rfcXXXX.txt" #define NS_DC "http://purl.org/dc/elements/1.1/" +#define NS_XD "http://uri.etsi.org/01903/v1.3.2#" #define ALGO_C14N "http://www.w3.org/TR/2001/REC-xml-c14n-20010315" #define ALGO_RSASHA1 "http://www.w3.org/2000/09/xmldsig#rsa-sha1" |