summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-22 10:38:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-22 12:52:20 +0200
commit11112bdb2d6bd411263ee65a448d33421599cbfa (patch)
treec1edf402d31b856177357c55969dfe4d6a9cda1b /oox
parentc213e05d04f100199052ba7c781823101e3f8aa6 (diff)
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@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/crypto/AgileEngine.cxx4
1 files changed, 3 insertions, 1 deletions
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;