diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-20 14:13:19 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-10-21 11:16:11 +0100 |
commit | fcc846e8f29839eaace7e1d28746abea8f4b598a (patch) | |
tree | bb0f460a0ba682e0619f0e3d7f84cb63f28e9dca /include/oox/crypto | |
parent | 5a5731cd0587553f21b2cee2a99db9f527396406 (diff) |
hash len isn't going to change depending on who implements it
Change-Id: Iee585cba4acad74c11d083085153e2af96c8894f
Diffstat (limited to 'include/oox/crypto')
-rw-r--r-- | include/oox/crypto/CryptTools.hxx | 3 | ||||
-rw-r--r-- | include/oox/crypto/Standard2007Engine.hxx | 9 |
2 files changed, 5 insertions, 7 deletions
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 <oox/crypto/CryptoEngine.hxx> +#include <rtl/digest.h> #include <rtl/ustring.hxx> #include <sal/types.h> @@ -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(); }; |