From f82e3b03162bff8ecd0409be21744f2c2b2c9144 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 8 Apr 2019 21:37:23 +0200 Subject: tdf#123747 xmlsecurity, ODF sign roundtrip: preserve invalid reference type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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Ă­ Reviewed-by: Michael Stahl --- xmlsecurity/source/helper/xsecparser.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xmlsecurity/source/helper/xsecparser.cxx') 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 { -- cgit