summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-29 11:51:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-29 17:02:31 +0100
commit2aaea1473962c5d0f62852a627ec0e5f0307f7bc (patch)
treefb5862812b273c4cc3d362789203a9fd537967ad /oox
parenta16eb857f3497a5ac65a7c7e89d0d6b8614aeb5e (diff)
ofz: avoid invalid short hashValues
Change-Id: Ib7cd63351f4e5ed053e55fe9c5875ad92c81d762 Reviewed-on: https://gerrit.libreoffice.org/45490 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/crypto/AgileEngine.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx
index 502b66a0a062..ef1440f5c96e 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -130,7 +130,7 @@ bool AgileEngine::generateEncryptionKey(const OUString& rPassword)
std::vector<sal_uInt8> hash(mInfo.hashSize, 0);
hashCalc(hash, hashInput, mInfo.hashAlgorithm);
- if (std::equal (hash.begin(), hash.end(), hashValue.begin()) )
+ if (hash.size() <= hashValue.size() && std::equal(hash.begin(), hash.end(), hashValue.begin()))
{
std::vector<sal_uInt8>& encryptedKeyValue = mInfo.encryptedKeyValue;
calculateBlock(constBlock3, hashFinal, encryptedKeyValue, mKey);