From fcc846e8f29839eaace7e1d28746abea8f4b598a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 20 Oct 2016 14:13:19 +0100 Subject: hash len isn't going to change depending on who implements it Change-Id: Iee585cba4acad74c11d083085153e2af96c8894f --- include/oox/crypto/CryptTools.hxx | 3 --- include/oox/crypto/Standard2007Engine.hxx | 9 +++++---- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'include/oox/crypto') diff --git a/include/oox/crypto/CryptTools.hxx b/include/oox/crypto/CryptTools.hxx index d963be2719c4..d4fdda2c1cfb 100644 --- a/include/oox/crypto/CryptTools.hxx +++ b/include/oox/crypto/CryptTools.hxx @@ -123,9 +123,6 @@ public: SHA512 }; - static const sal_uInt32 DIGEST_LENGTH_SHA1; - static const sal_uInt32 DIGEST_LENGTH_SHA512; - private: DigestType meType; diff --git a/include/oox/crypto/Standard2007Engine.hxx b/include/oox/crypto/Standard2007Engine.hxx index 2ee4a553a918..1650b622e9f5 100644 --- a/include/oox/crypto/Standard2007Engine.hxx +++ b/include/oox/crypto/Standard2007Engine.hxx @@ -12,6 +12,7 @@ #define INCLUDED_OOX_CRYPTO_STANDARD2007ENGINE_HXX #include +#include #include #include @@ -52,9 +53,9 @@ const sal_uInt32 VERSION_INFO_AGILE = 0x00040004; const sal_uInt32 SALT_LENGTH = 16; const sal_uInt32 ENCRYPTED_VERIFIER_LENGTH = 16; -const sal_uInt32 ENCRYPTED_SHA1_VERIFIER_HASH_LENGTH = 20; -const sal_uInt32 ENCRYPTED_SHA256_VERIFIER_HASH_LENGTH = 32; -const sal_uInt32 ENCRYPTED_SHA512_VERIFIER_HASH_LENGTH = 64; +const sal_uInt32 SHA1_HASH_LENGTH = RTL_DIGEST_LENGTH_SHA1; // 20 +const sal_uInt32 SHA256_HASH_LENGTH = 32; +const sal_uInt32 SHA512_HASH_LENGTH = 64; struct EncryptionStandardHeader { @@ -76,7 +77,7 @@ struct EncryptionVerifierAES sal_uInt8 salt[SALT_LENGTH]; // random generated salt value sal_uInt8 encryptedVerifier[ENCRYPTED_VERIFIER_LENGTH]; // randomly generated verifier value sal_uInt32 encryptedVerifierHashSize; // actually written hash size - depends on algorithm - sal_uInt8 encryptedVerifierHash[ENCRYPTED_SHA256_VERIFIER_HASH_LENGTH]; // verifier value hash - itself also encrypted + sal_uInt8 encryptedVerifierHash[SHA256_HASH_LENGTH]; // verifier value hash - itself also encrypted EncryptionVerifierAES(); }; -- cgit