summaryrefslogtreecommitdiff
path: root/package/source/manifest
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-12-14 11:51:37 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-12-14 15:41:08 +0100
commita44a6ab7a51f35997a5a4d0b12cd0c8eae421397 (patch)
tree2da61fffb8859b1a955638cd0e07c3bcf134491c /package/source/manifest
parent91f35f22f0447769c08ca89e27a39b40df18fffa (diff)
OFFICE-3708: package: produce correct SHA256 URL
Old versions of LO or other consumers can't read wholesome ODF encrypted documents anyway, so start using the correct W3C SHA256 URL (see commit 1015d35f2362953f415804476037d4f162eb49b5). Change-Id: Id82ab2c9f605eb2084ff01a26e8186223dd46763 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160764 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'package/source/manifest')
-rw-r--r--package/source/manifest/ManifestExport.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx
index cf60614ccd58..a15ae0118277 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -453,7 +453,14 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
*pStartKeyAlg >>= nStartKeyAlgID;
if ( nStartKeyAlgID == xml::crypto::DigestID::SHA256 )
{
- sStartKeyAlg = sSHA256_URL_ODF12; // TODO use SHA256_URL
+ if (nEncAlgID == xml::crypto::CipherID::AES_GCM_W3C)
+ { // new encryption is incompatible anyway, use W3C URL
+ sStartKeyAlg = SHA256_URL;
+ }
+ else // to interop with ODF <= 1.4 consumers use bad ODF URL
+ {
+ sStartKeyAlg = sSHA256_URL_ODF12;
+ }
aBuffer.append( sal_Int32(32) );
sStartKeySize = aBuffer.makeStringAndClear();
}