summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-08 14:09:45 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-08 15:34:35 +0100
commit7ff681fddaeff5cea22a1978bd4916e0c6bc28f9 (patch)
treec8c65db93b7c793fe235494c65b44df85f867b71
parent5ee943a11f46abdd1c0200925a71a8dc19d8965e (diff)
xmlsecurity: export OOXML <SignatureMethod>
Change-Id: I445a50d5c7d12609e4043bfedc41cdea456fa52f
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx15
-rw-r--r--xmlsecurity/source/helper/xsecctl.hxx1
2 files changed, 16 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index fcbd8284247a..81b8d97bcf59 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -978,6 +978,21 @@ void XSecController::exportSignature(
void XSecController::exportOOXMLSignature(const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler, const SignatureInformation& /*rInformation*/)
{
xDocumentHandler->startElement(TAG_SIGNEDINFO, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+
+ {
+ std::unique_ptr<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
+ pAttributeList->AddAttribute(ATTR_ALGORITHM, ALGO_C14N);
+ xDocumentHandler->startElement(TAG_CANONICALIZATIONMETHOD, uno::Reference<xml::sax::XAttributeList>(pAttributeList.release()));
+ xDocumentHandler->endElement(TAG_CANONICALIZATIONMETHOD);
+ }
+
+ {
+ std::unique_ptr<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
+ pAttributeList->AddAttribute(ATTR_ALGORITHM, ALGO_RSASHA256);
+ xDocumentHandler->startElement(TAG_SIGNATUREMETHOD, uno::Reference<xml::sax::XAttributeList>(pAttributeList.release()));
+ xDocumentHandler->endElement(TAG_SIGNATUREMETHOD);
+ }
+
xDocumentHandler->endElement(TAG_SIGNEDINFO);
}
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index 967e6036e5e7..589183d4d10c 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -95,6 +95,7 @@
#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"
+#define ALGO_RSASHA256 "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
#define ALGO_XMLDSIGSHA1 "http://www.w3.org/2000/09/xmldsig#sha1"
#define ALGO_RELATIONSHIP "http://schemas.openxmlformats.org/package/2006/RelationshipTransform"