summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2018-01-12 18:34:04 +0100
committerMichael Stahl <mstahl@redhat.com>2018-01-12 23:31:44 +0100
commit50382b9e9256d7361e3770daa654fb8d09448635 (patch)
treef2666f1e8f92a52f59228fae2d5984b1743e0b8c /package
parent9188ea83c346fdc2f668178ae7538665a1b09c02 (diff)
tdf#114939 package: change ODF 1.1 export to use real SHA1
Change-Id: I20d4965cc467df56536ca03b773b3f0f61b1f2a3
Diffstat (limited to 'package')
-rw-r--r--package/inc/ZipPackageStream.hxx4
-rw-r--r--package/source/zippackage/ZipPackage.cxx2
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx6
3 files changed, 6 insertions, 6 deletions
diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx
index 67428c086948..b691370bf7e0 100644
--- a/package/inc/ZipPackageStream.hxx
+++ b/package/inc/ZipPackageStream.hxx
@@ -84,9 +84,9 @@ public:
void SetFromManifest( bool bValue ) { m_bFromManifest = bValue; }
enum class Bugs { None, WinEncodingWrongSHA1, WrongSHA1 };
- ::rtl::Reference<EncryptionData> GetEncryptionData(Bugs bugs = Bugs::WrongSHA1);
+ ::rtl::Reference<EncryptionData> GetEncryptionData(Bugs bugs = Bugs::None);
- css::uno::Sequence<sal_Int8> GetEncryptionKey(Bugs bugs = Bugs::WrongSHA1);
+ css::uno::Sequence<sal_Int8> GetEncryptionKey(Bugs bugs = Bugs::None);
sal_Int32 GetStartKeyGenID();
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index ffb9cf1e8775..a6eb5f6af97e 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1574,7 +1574,7 @@ const uno::Sequence< sal_Int8 > ZipPackage::GetEncryptionKey()
if ( m_nStartKeyGenerationID == xml::crypto::DigestID::SHA256 )
aNameToFind = PACKAGE_ENCRYPTIONDATA_SHA256UTF8;
else if ( m_nStartKeyGenerationID == xml::crypto::DigestID::SHA1 )
- aNameToFind = PACKAGE_ENCRYPTIONDATA_SHA1UTF8;
+ aNameToFind = PACKAGE_ENCRYPTIONDATA_SHA1CORRECT;
else
throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" );
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index c9e987aec1bd..55ebae82ee48 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -1012,7 +1012,7 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getDataStream()
uno::Reference< io::XInputStream > xResult;
try
{
- xResult = m_rZipPackage.getZipFile().getDataStream( aEntry, GetEncryptionData(Bugs::WrongSHA1), m_bIsEncrypted, m_rZipPackage.GetSharedMutexRef() );
+ xResult = m_rZipPackage.getZipFile().getDataStream( aEntry, GetEncryptionData(Bugs::None), m_bIsEncrypted, m_rZipPackage.GetSharedMutexRef() );
}
catch( const packages::WrongPasswordException& )
{
@@ -1020,8 +1020,8 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getDataStream()
{
SAL_WARN("package", "ZipPackageStream::getDataStream(): SHA1 mismatch, trying fallbacks...");
try
- { // tdf#114939 try without legacy StarOffice SHA1 bug
- xResult = m_rZipPackage.getZipFile().getDataStream( aEntry, GetEncryptionData(Bugs::None), m_bIsEncrypted, m_rZipPackage.GetSharedMutexRef() );
+ { // tdf#114939 try with legacy StarOffice SHA1 bug
+ xResult = m_rZipPackage.getZipFile().getDataStream( aEntry, GetEncryptionData(Bugs::WrongSHA1), m_bIsEncrypted, m_rZipPackage.GetSharedMutexRef() );
return xResult;
}
catch (const packages::WrongPasswordException&)