summaryrefslogtreecommitdiffstats
path: root/xmlsecurity/source/helper/xsecparser.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-04-08 21:37:23 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2019-04-09 14:37:47 +0200
commitf82e3b03162bff8ecd0409be21744f2c2b2c9144 (patch)
treec3cc5678c72b8d37cab607201965d6ebe47fb29b /xmlsecurity/source/helper/xsecparser.cxx
parentResolves: tdf#123550 allow returning to TRISTATE_INDET (diff)
downloadcore-f82e3b03162bff8ecd0409be21744f2c2b2c9144.tar.gz
core-f82e3b03162bff8ecd0409be21744f2c2b2c9144.zip
tdf#123747 xmlsecurity, ODF sign roundtrip: preserve invalid reference type
Only add the correct type to new signatures to avoid breaking the hash of old ones. (cherry picked from commit 8a9d8238bd8f903393ff1184aa37f8973c81e2ba) Conflicts: xmlsecurity/qa/unit/signing/signing.cxx Change-Id: I30f892b292f84a0575a3d4ef5ccf3eddbe0090ca Reviewed-on: https://gerrit.libreoffice.org/70451 Tested-by: Jenkins Tested-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'xmlsecurity/source/helper/xsecparser.cxx')
-rw-r--r--xmlsecurity/source/helper/xsecparser.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx
index d24f5f5c5ec8..532ba07a0298 100644
--- a/xmlsecurity/source/helper/xsecparser.cxx
+++ b/xmlsecurity/source/helper/xsecparser.cxx
@@ -129,12 +129,14 @@ void SAL_CALL XSecParser::startElement(
{
OUString ouUri = xAttribs->getValueByName("URI");
SAL_WARN_IF( ouUri.isEmpty(), "xmlsecurity.helper", "URI is empty" );
+ // Remember the type of this reference.
+ OUString ouType = xAttribs->getValueByName("Type");
if (ouUri.startsWith("#"))
{
/*
* remove the first character '#' from the attribute value
*/
- m_pXSecController->addReference( ouUri.copy(1), m_nReferenceDigestID );
+ m_pXSecController->addReference( ouUri.copy(1), m_nReferenceDigestID, ouType );
}
else
{