From 8a9d8238bd8f903393ff1184aa37f8973c81e2ba 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 Only add the correct type to new signatures to avoid breaking the hash of old ones. Change-Id: I30f892b292f84a0575a3d4ef5ccf3eddbe0090ca Reviewed-on: https://gerrit.libreoffice.org/70424 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- include/svl/sigstruct.hxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/svl') diff --git a/include/svl/sigstruct.hxx b/include/svl/sigstruct.hxx index 3498aff008fa..ceed929752ab 100644 --- a/include/svl/sigstruct.hxx +++ b/include/svl/sigstruct.hxx @@ -48,6 +48,8 @@ struct SignatureReferenceInformation // For ODF: XAdES digests (SHA256) or the old SHA1, from css::xml::crypto::DigestID sal_Int32 nDigestID; OUString ouDigestValue; + /// Type of the reference: an URI (newer idSignedProperties references) or empty. + OUString ouType; SignatureReferenceInformation() : nType(SignatureReferenceType::SAMEDOCUMENT), @@ -57,12 +59,13 @@ struct SignatureReferenceInformation { } - SignatureReferenceInformation( SignatureReferenceType type, sal_Int32 digestID, const OUString& uri ) : + SignatureReferenceInformation( SignatureReferenceType type, sal_Int32 digestID, const OUString& uri, const OUString& rType ) : SignatureReferenceInformation() { nType = type; nDigestID = digestID; ouURI = uri; + ouType = rType; } }; -- cgit