[Libreoffice-commits] core.git: oox/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 22 10:53:03 UTC 2020


 oox/source/crypto/AgileEngine.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 11112bdb2d6bd411263ee65a448d33421599cbfa
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jul 22 10:38:35 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jul 22 12:52:20 2020 +0200

    ofz#24317 hash too short
    
    Change-Id: I6b2df62f0d18c6918a82a002f1e9a364c877caf1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99211
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx
index 008b29462c0d..e1ce103c5d0c 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -322,7 +322,9 @@ bool AgileEngine::decryptAndCheckVerifierHash(OUString const & rPassword)
     calculateHashFinal(rPassword, hashFinal);
 
     std::vector<sal_uInt8>& encryptedHashInput = mInfo.encryptedVerifierHashInput;
-    std::vector<sal_uInt8> hashInput(mInfo.saltSize, 0);
+    // SALT - needs to be a multiple of block size (?)
+    sal_Int32 nSaltSize = roundUp(mInfo.saltSize, mInfo.blockSize);
+    std::vector<sal_uInt8> hashInput(nSaltSize, 0);
     calculateBlock(constBlock1, hashFinal, encryptedHashInput, hashInput);
 
     std::vector<sal_uInt8>& encryptedHashValue = mInfo.encryptedVerifierHashValue;


More information about the Libreoffice-commits mailing list