[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - package/inc package/source

Michael Stahl mstahl at redhat.com
Tue Jan 16 20:54:00 UTC 2018


 package/inc/ZipPackageStream.hxx               |    4 ++--
 package/source/zippackage/ZipPackage.cxx       |    2 +-
 package/source/zippackage/ZipPackageStream.cxx |    6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 0fbc3a1a90a649bc6353aca9fe3332556961f1a5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jan 12 18:34:04 2018 +0100

    tdf#114939 package: change ODF 1.1 export to use real SHA1
    
    Change-Id: I20d4965cc467df56536ca03b773b3f0f61b1f2a3
    (cherry picked from commit 50382b9e9256d7361e3770daa654fb8d09448635)
    Reviewed-on: https://gerrit.libreoffice.org/48002
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx
index 4abb74a684da..3fc124973704 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 9a4853f439c6..087a77461d90 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1625,7 +1625,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 59efbcc33ad8..2bcdb073bf3c 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -1011,7 +1011,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& )
         {
@@ -1019,8 +1019,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&)


More information about the Libreoffice-commits mailing list