summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-11 10:25:36 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-11 11:00:44 +0100
commit5c5ad2e2decb9af6005419a34db2bd0f4e9bcfd3 (patch)
treebeaec3be06fadb8d44d4375e324ef5aae4d0b1b3 /xmlsecurity
parent5cd3c87d5dfed9707f00dcebdd4c15642febbe12 (diff)
xmlsecurity OOXML export: fix double-char-fragment of same-document references
The problem was that the final export lacked the "#" prefix in the same-document reference names. Fix this by doing what the ODF export does: don't let the signature informations (data model) contain the "#", just prepend it right before writing the name out. This way it won't matter if the source of the name is an import (which doesn't keep the "#") or a new signature (which did, previously), we'll always write exactly one "#". Change-Id: I18b6a5ba55b7e79ace537b7ecf575a7abc71e281
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx6
-rw-r--r--xmlsecurity/source/helper/xsecsign.cxx6
2 files changed, 6 insertions, 6 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index 6aec0f6d51d4..756d80e919bc 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -1046,14 +1046,14 @@ void XSecController::exportOOXMLSignature(const uno::Reference<embed::XStorage>&
{
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
- if (rReference.ouURI != "#idSignedProperties")
+ if (rReference.ouURI != "idSignedProperties")
pAttributeList->AddAttribute("Type", "http://www.w3.org/2000/09/xmldsig#Object");
else
pAttributeList->AddAttribute("Type", "http://uri.etsi.org/01903#SignedProperties");
- pAttributeList->AddAttribute(ATTR_URI, rReference.ouURI);
+ pAttributeList->AddAttribute(ATTR_URI, CHAR_FRAGMENT + rReference.ouURI);
xDocumentHandler->startElement(TAG_REFERENCE, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
- if (rReference.ouURI == "#idSignedProperties")
+ if (rReference.ouURI == "idSignedProperties")
{
xDocumentHandler->startElement(TAG_TRANSFORMS, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx
index cacdfcb7cc78..a0aa8dc5563c 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -182,11 +182,11 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
}
else
{
- internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, "#idPackageObject", -1);
+ internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, "idPackageObject", -1);
size++;
- internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, "#idOfficeObject", -1);
+ internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, "idOfficeObject", -1);
size++;
- internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, "#idSignedProperties", -1);
+ internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, "idSignedProperties", -1);
size++;
}