summaryrefslogtreecommitdiff
path: root/oox/source/crypto/AgileEngine.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source/crypto/AgileEngine.cxx')
-rw-r--r--oox/source/crypto/AgileEngine.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx
index 9c1095a01f4d..72539509c965 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -13,6 +13,8 @@
#include <oox/helper/binaryinputstream.hxx>
#include <oox/helper/binaryoutputstream.hxx>
+#include <comphelper/hash.hxx>
+
namespace oox {
namespace core {
@@ -25,9 +27,17 @@ bool hashCalc(std::vector<sal_uInt8>& output,
const OUString& sAlgorithm )
{
if (sAlgorithm == "SHA1")
- return Digest::sha1(output, input);
+ {
+ std::vector<unsigned char> out = comphelper::Hash::calculateHash(input.data(), input.size(), comphelper::HashType::SHA1);
+ output = out;
+ return true;
+ }
else if (sAlgorithm == "SHA512")
- return Digest::sha512(output, input);
+ {
+ std::vector<unsigned char> out = comphelper::Hash::calculateHash(input.data(), input.size(), comphelper::HashType::SHA512);
+ output = out;
+ return true;
+ }
return false;
}