summaryrefslogtreecommitdiff
path: root/oox/source/crypto
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-01-12 11:43:37 +0200
committerNoel Grandin <noel@peralex.com>2016-01-12 11:47:52 +0200
commit8dbfc413b1603c814cecf5306238c6144185671f (patch)
treeb47d0fe0c3499ca23871845a97590e0a7e88115a /oox/source/crypto
parente5bb67f08d4e2095affc5229e638535376ee66b4 (diff)
loplugin:unusedmethods unused return value in include/oox
Change-Id: I22acb6b94774c5944d8276827c53a419f0803f83
Diffstat (limited to 'oox/source/crypto')
-rw-r--r--oox/source/crypto/AgileEngine.cxx16
-rw-r--r--oox/source/crypto/CryptTools.cxx6
-rw-r--r--oox/source/crypto/Standard2007Engine.cxx11
3 files changed, 12 insertions, 21 deletions
diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx
index d207cf533a7f..13780868cd55 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -50,7 +50,7 @@ Crypto::CryptoType AgileEngine::cryptoType(const AgileEncryptionInfo& rInfo)
return Crypto::UNKNOWN;
}
-bool AgileEngine::calculateBlock(
+void AgileEngine::calculateBlock(
const sal_uInt8* rBlock,
sal_uInt32 aBlockSize,
vector<sal_uInt8>& rHashFinal,
@@ -75,11 +75,9 @@ bool AgileEngine::calculateBlock(
Decrypt aDecryptor(key, salt, cryptoType(mInfo));
aDecryptor.update(rOutput, rInput);
-
- return true;
}
-bool AgileEngine::calculateHashFinal(const OUString& rPassword, vector<sal_uInt8>& aHashFinal)
+void AgileEngine::calculateHashFinal(const OUString& rPassword, vector<sal_uInt8>& aHashFinal)
{
sal_Int32 saltSize = mInfo.saltSize;
vector<sal_uInt8> salt = mInfo.saltValue;
@@ -109,8 +107,6 @@ bool AgileEngine::calculateHashFinal(const OUString& rPassword, vector<sal_uInt8
}
std::copy(hash.begin(), hash.end(), aHashFinal.begin());
-
- return true;
}
bool AgileEngine::generateEncryptionKey(const OUString& rPassword)
@@ -192,18 +188,18 @@ bool AgileEngine::decrypt(
return true;
}
-bool AgileEngine::writeEncryptionInfo(
+void AgileEngine::writeEncryptionInfo(
const OUString& /*aPassword*/,
BinaryXOutputStream& /*rStream*/)
{
- return false; // Agile encrypting is not supported for now
+ // Agile encrypting is not supported for now
}
-bool AgileEngine::encrypt(
+void AgileEngine::encrypt(
BinaryXInputStream& /*aInputStream*/,
BinaryXOutputStream& /*aOutputStream*/)
{
- return false; // Agile encrypting is not supported for now
+ // Agile encrypting is not supported for now
}
} // namespace core
diff --git a/oox/source/crypto/CryptTools.cxx b/oox/source/crypto/CryptTools.cxx
index f21b0e1b7713..120487789d89 100644
--- a/oox/source/crypto/CryptTools.cxx
+++ b/oox/source/crypto/CryptTools.cxx
@@ -284,7 +284,7 @@ sal_uInt32 Digest::getLength()
return 0;
}
-bool Digest::update(std::vector<sal_uInt8>& input)
+void Digest::update(std::vector<sal_uInt8>& input)
{
#if USE_TLS_OPENSSL
EVP_DigestUpdate(mpContext, &input[0], input.size());
@@ -292,10 +292,9 @@ bool Digest::update(std::vector<sal_uInt8>& input)
#if USE_TLS_NSS
HASH_Update(mpContext, &input[0], input.size());
#endif
- return true;
}
-bool Digest::finalize(std::vector<sal_uInt8>& digest)
+void Digest::finalize(std::vector<sal_uInt8>& digest)
{
digest.clear();
@@ -311,7 +310,6 @@ bool Digest::finalize(std::vector<sal_uInt8>& digest)
digest.resize(digestLength, 0);
HASH_End(mpContext, &digest[0], &digestWrittenLength, digestLength);
#endif
- return true;
}
bool Digest::sha1(vector<sal_uInt8>& output, vector<sal_uInt8>& input)
diff --git a/oox/source/crypto/Standard2007Engine.cxx b/oox/source/crypto/Standard2007Engine.cxx
index 299d25117722..0280a174b1a1 100644
--- a/oox/source/crypto/Standard2007Engine.cxx
+++ b/oox/source/crypto/Standard2007Engine.cxx
@@ -198,7 +198,7 @@ bool Standard2007Engine::decrypt(
return true;
}
-bool Standard2007Engine::writeEncryptionInfo(const OUString& password, BinaryXOutputStream& rStream)
+void Standard2007Engine::writeEncryptionInfo(const OUString& password, BinaryXOutputStream& rStream)
{
mInfo.header.flags = ENCRYPTINFO_AES | ENCRYPTINFO_CRYPTOAPI;
mInfo.header.algId = ENCRYPT_ALGO_AES128;
@@ -213,10 +213,10 @@ bool Standard2007Engine::writeEncryptionInfo(const OUString& password, BinaryXOu
mKey.resize(keyLength, 0);
if (!calculateEncryptionKey(password))
- return false;
+ return;
if (!generateVerifier())
- return false;
+ return;
rStream.WriteUInt32(VERSION_INFO_2007_FORMAT);
@@ -234,11 +234,9 @@ bool Standard2007Engine::writeEncryptionInfo(const OUString& password, BinaryXOu
sal_uInt32 encryptionVerifierSize = static_cast<sal_uInt32>(sizeof(EncryptionVerifierAES));
rStream.writeMemory(&mInfo.verifier, encryptionVerifierSize);
-
- return true;
}
-bool Standard2007Engine::encrypt(
+void Standard2007Engine::encrypt(
BinaryXInputStream& aInputStream,
BinaryXOutputStream& aOutputStream)
{
@@ -257,7 +255,6 @@ bool Standard2007Engine::encrypt(
outputLength = aEncryptor.update(outputBuffer, inputBuffer, inputLength);
aOutputStream.writeMemory( &outputBuffer[0], outputLength );
}
- return true;
}
} // namespace core