diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-01-22 22:26:41 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-01-30 11:25:21 +0000 |
commit | 5b30a94842388d136f645ed7d16a6941da86b760 (patch) | |
tree | 2c99b5da56310d5ec371397939c06119f934dff2 /include | |
parent | 93a49ee2a2d44d10a5d83c7c46c165400d14cbc5 (diff) |
oox: clean-up crypto classes, use c++11 features
- remove "using namespace std;"
- &vector[0] to vector.data()
- use nullptr in OPENSSL
Change-Id: Ib4067b0256801f94d448bc8d3faf5a2902d694e5
Reviewed-on: https://gerrit.libreoffice.org/33629
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/oox/crypto/AgileEngine.hxx | 28 | ||||
-rw-r--r-- | include/oox/crypto/Standard2007Engine.hxx | 3 |
2 files changed, 13 insertions, 18 deletions
diff --git a/include/oox/crypto/AgileEngine.hxx b/include/oox/crypto/AgileEngine.hxx index 57a3084dd526..22233b051011 100644 --- a/include/oox/crypto/AgileEngine.hxx +++ b/include/oox/crypto/AgileEngine.hxx @@ -26,25 +26,23 @@ namespace oox { namespace oox { namespace core { -const sal_uInt32 SEGMENT_LENGTH = 4096; - struct AgileEncryptionInfo { - sal_Int32 spinCount; - sal_Int32 saltSize; - sal_Int32 keyBits; - sal_Int32 hashSize; - sal_Int32 blockSize; + sal_Int32 spinCount; + sal_Int32 saltSize; + sal_Int32 keyBits; + sal_Int32 hashSize; + sal_Int32 blockSize; OUString cipherAlgorithm; OUString cipherChaining; OUString hashAlgorithm; - std::vector<sal_uInt8> keyDataSalt; - std::vector<sal_uInt8> saltValue; - std::vector<sal_uInt8> encryptedVerifierHashInput; - std::vector<sal_uInt8> encryptedVerifierHashValue; - std::vector<sal_uInt8> encryptedKeyValue; + std::vector<sal_uInt8> keyDataSalt; + std::vector<sal_uInt8> saltValue; + std::vector<sal_uInt8> encryptedVerifierHashInput; + std::vector<sal_uInt8> encryptedVerifierHashValue; + std::vector<sal_uInt8> encryptedKeyValue; }; class AgileEngine : public CryptoEngine @@ -54,8 +52,7 @@ class AgileEngine : public CryptoEngine void calculateHashFinal(const OUString& rPassword, std::vector<sal_uInt8>& aHashFinal); void calculateBlock( - const sal_uInt8* rBlock, - sal_uInt32 aBlockSize, + std::vector<sal_uInt8> const & rBlock, std::vector<sal_uInt8>& rHashFinal, std::vector<sal_uInt8>& rInput, std::vector<sal_uInt8>& rOutput); @@ -63,8 +60,7 @@ class AgileEngine : public CryptoEngine static Crypto::CryptoType cryptoType(const AgileEncryptionInfo& rInfo); public: - AgileEngine(); - virtual ~AgileEngine() override; + AgileEngine() = default; AgileEncryptionInfo& getInfo() { return mInfo;} diff --git a/include/oox/crypto/Standard2007Engine.hxx b/include/oox/crypto/Standard2007Engine.hxx index 42998b492760..40aba8137161 100644 --- a/include/oox/crypto/Standard2007Engine.hxx +++ b/include/oox/crypto/Standard2007Engine.hxx @@ -33,8 +33,7 @@ class Standard2007Engine : public CryptoEngine bool calculateEncryptionKey(const OUString& rPassword); public: - Standard2007Engine(); - virtual ~Standard2007Engine() override; + Standard2007Engine() = default; msfilter::StandardEncryptionInfo& getInfo() { return mInfo;} |