summaryrefslogtreecommitdiff
path: root/include/comphelper
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2018-01-12 16:58:00 +0100
committerMichael Stahl <mstahl@redhat.com>2018-01-12 23:31:43 +0100
commit9188ea83c346fdc2f668178ae7538665a1b09c02 (patch)
tree2919ed5dd5ea276dd0395c7596a4efe0e11f46e8 /include/comphelper
parent64592a19e5d512fb5cd09bf0a1726b9c78481e65 (diff)
tdf#114939 package,comphelper: Try both real SHA1 and StarOffice SHA1
... when importing ODF documents. In CreatePackageEncryptionData(), add a 3rd SHA1 password hash, PackageSHA1CorrectEncryptionKey, to EncryptionData. Use it in ZipPackageStream::getDataStream(), which has 3 fall-backs for SHA1 bugs now. Also add a CorrectSHA1DigestContext, to be used together with PackageSHA1CorrectEncryptionKey, and rename the existing one to StarOfficeSHA1DigestContext, to be used together with the existing 2 PackageSHA1{UTF8,MS1252}EncryptionKey. The fallback won't be used very often anyway: for the password SHA1 to be wrong, you need a password between 52 and 55 bytes long, and for the SHA1/1K checksum to be wrong, you need a file smaller than 1K with compressed size mod 64 between 52 and 55; all XML files have enough random "chaff" added to be too large. Test that we can read both correct SHA1 and StarOffice SHA1. Change-Id: I988fa489b5e40c7657f404f18538f637d54d28f1
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/storagehelper.hxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/comphelper/storagehelper.hxx b/include/comphelper/storagehelper.hxx
index 1f5e22cb14e3..778fb1c8ea25 100644
--- a/include/comphelper/storagehelper.hxx
+++ b/include/comphelper/storagehelper.hxx
@@ -32,6 +32,7 @@
#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 "PackageSHA256UTF8EncryptionKey"
#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8 "PackageSHA1UTF8EncryptionKey"
#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 "PackageSHA1MS1252EncryptionKey"
+#define PACKAGE_ENCRYPTIONDATA_SHA1CORRECT "PackageSHA1CorrectEncryptionKey"
namespace com { namespace sun { namespace star {
namespace beans { struct NamedValue; }