aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/openssl
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-01-17 19:02:13 -0500
committerJack Lloyd <[email protected]>2016-01-17 19:10:33 -0500
commit6fcbd57915d7870c2782bd6e098903353e8756b0 (patch)
treec40505fbf8021819dc15d8a632a2d6fb5557f2aa /src/lib/prov/openssl
parentde22a9eda8bfb087b690feb962fae8313ee526d4 (diff)
Add missing overrides and fix -Wpedantic 'extra ;' warnings
Remove -Wsuggest-attribute=noreturn from maintainer mode flags as it seems like outside of the assertion failure macro any other suggestion would always be a false positive (an unimplemented function or the like). Or at least, if such a function needing noreturn to assist with static analysis is added in the future it will be obvious, by virtue of the static analyzer warnings which occur due to the missing noreturn preventing the analyzer from understanding code flow.
Diffstat (limited to 'src/lib/prov/openssl')
-rw-r--r--src/lib/prov/openssl/openssl_block.cpp28
-rw-r--r--src/lib/prov/openssl/openssl_hash.cpp16
-rw-r--r--src/lib/prov/openssl/openssl_rc4.cpp12
3 files changed, 28 insertions, 28 deletions
diff --git a/src/lib/prov/openssl/openssl_block.cpp b/src/lib/prov/openssl/openssl_block.cpp
index b7d9ba7c8..c868e8977 100644
--- a/src/lib/prov/openssl/openssl_block.cpp
+++ b/src/lib/prov/openssl/openssl_block.cpp
@@ -17,34 +17,34 @@ namespace {
class OpenSSL_BlockCipher : public BlockCipher
{
public:
- void clear();
- std::string name() const { return m_cipher_name; }
- BlockCipher* clone() const;
-
- size_t block_size() const { return m_block_sz; }
-
OpenSSL_BlockCipher(const EVP_CIPHER*, const std::string&);
OpenSSL_BlockCipher(const EVP_CIPHER*, const std::string&,
size_t, size_t, size_t);
- Key_Length_Specification key_spec() const { return m_cipher_key_spec; }
-
~OpenSSL_BlockCipher();
- private:
- void encrypt_n(const byte in[], byte out[], size_t blocks) const
+
+ void clear() override;
+ std::string name() const override { return m_cipher_name; }
+ BlockCipher* clone() const override;
+
+ size_t block_size() const override { return m_block_sz; }
+
+ Key_Length_Specification key_spec() const override { return m_cipher_key_spec; }
+
+ void encrypt_n(const byte in[], byte out[], size_t blocks) const override
{
int out_len = 0;
EVP_EncryptUpdate(&m_encrypt, out, &out_len, in, blocks * m_block_sz);
}
- void decrypt_n(const byte in[], byte out[], size_t blocks) const
+ void decrypt_n(const byte in[], byte out[], size_t blocks) const override
{
int out_len = 0;
EVP_DecryptUpdate(&m_decrypt, out, &out_len, in, blocks * m_block_sz);
}
- void key_schedule(const byte[], size_t);
+ void key_schedule(const byte key[], size_t key_len) override;
size_t m_block_sz;
Key_Length_Specification m_cipher_key_spec;
@@ -169,12 +169,12 @@ make_evp_block_maker_keylen(const EVP_CIPHER* cipher, const char* algo,
#define BOTAN_REGISTER_OPENSSL_EVP_BLOCK(NAME, EVP) \
BOTAN_REGISTER_TYPE(BlockCipher, EVP_BlockCipher ## EVP, NAME, \
- make_evp_block_maker(EVP(), NAME), "openssl", BOTAN_OPENSSL_BLOCK_PRIO);
+ make_evp_block_maker(EVP(), NAME), "openssl", BOTAN_OPENSSL_BLOCK_PRIO)
#define BOTAN_REGISTER_OPENSSL_EVP_BLOCK_KEYLEN(NAME, EVP, KMIN, KMAX, KMOD) \
BOTAN_REGISTER_TYPE(BlockCipher, OpenSSL_BlockCipher ## EVP, NAME, \
make_evp_block_maker_keylen(EVP(), NAME, KMIN, KMAX, KMOD), \
- "openssl", BOTAN_OPENSSL_BLOCK_PRIO);
+ "openssl", BOTAN_OPENSSL_BLOCK_PRIO)
#if !defined(OPENSSL_NO_AES)
BOTAN_REGISTER_OPENSSL_EVP_BLOCK("AES-128", EVP_aes_128_ecb);
diff --git a/src/lib/prov/openssl/openssl_hash.cpp b/src/lib/prov/openssl/openssl_hash.cpp
index c89dd777d..574cfed91 100644
--- a/src/lib/prov/openssl/openssl_hash.cpp
+++ b/src/lib/prov/openssl/openssl_hash.cpp
@@ -17,26 +17,26 @@ namespace {
class OpenSSL_HashFunction : public HashFunction
{
public:
- void clear()
+ void clear() override
{
const EVP_MD* algo = EVP_MD_CTX_md(&m_md);
EVP_DigestInit_ex(&m_md, algo, nullptr);
}
- std::string name() const { return m_name; }
+ std::string name() const override { return m_name; }
- HashFunction* clone() const
+ HashFunction* clone() const override
{
const EVP_MD* algo = EVP_MD_CTX_md(&m_md);
return new OpenSSL_HashFunction(algo, name());
}
- size_t output_length() const
+ size_t output_length() const override
{
return EVP_MD_size(EVP_MD_CTX_md(&m_md));
}
- size_t hash_block_size() const
+ size_t hash_block_size() const override
{
return EVP_MD_block_size(EVP_MD_CTX_md(&m_md));
}
@@ -53,12 +53,12 @@ class OpenSSL_HashFunction : public HashFunction
}
private:
- void add_data(const byte input[], size_t length)
+ void add_data(const byte input[], size_t length) override
{
EVP_DigestUpdate(&m_md, input, length);
}
- void final_result(byte output[])
+ void final_result(byte output[]) override
{
EVP_DigestFinal_ex(&m_md, output, nullptr);
const EVP_MD* algo = EVP_MD_CTX_md(&m_md);
@@ -80,7 +80,7 @@ make_evp_hash_maker(const EVP_MD* md, const char* algo)
#define BOTAN_REGISTER_OPENSSL_EVP_HASH(NAME, EVP) \
BOTAN_REGISTER_TYPE(HashFunction, OpenSSL_HashFunction ## EVP, NAME, \
- make_evp_hash_maker(EVP(), NAME), "openssl", BOTAN_OPENSSL_HASH_PRIO);
+ make_evp_hash_maker(EVP(), NAME), "openssl", BOTAN_OPENSSL_HASH_PRIO)
#if !defined(OPENSSL_NO_SHA)
BOTAN_REGISTER_OPENSSL_EVP_HASH("SHA-160", EVP_sha1);
diff --git a/src/lib/prov/openssl/openssl_rc4.cpp b/src/lib/prov/openssl/openssl_rc4.cpp
index 84d739c91..79ad98ca4 100644
--- a/src/lib/prov/openssl/openssl_rc4.cpp
+++ b/src/lib/prov/openssl/openssl_rc4.cpp
@@ -21,9 +21,9 @@ namespace {
class OpenSSL_RC4 : public StreamCipher
{
public:
- void clear() { clear_mem(&m_rc4, 1); }
+ void clear() override { clear_mem(&m_rc4, 1); }
- std::string name() const
+ std::string name() const override
{
switch(m_skip)
{
@@ -36,9 +36,9 @@ class OpenSSL_RC4 : public StreamCipher
}
}
- StreamCipher* clone() const { return new OpenSSL_RC4; }
+ StreamCipher* clone() const override { return new OpenSSL_RC4; }
- Key_Length_Specification key_spec() const
+ Key_Length_Specification key_spec() const override
{
return Key_Length_Specification(1, 32);
}
@@ -46,12 +46,12 @@ class OpenSSL_RC4 : public StreamCipher
OpenSSL_RC4(size_t skip = 0) : m_skip(skip) { clear(); }
~OpenSSL_RC4() { clear(); }
private:
- void cipher(const byte in[], byte out[], size_t length)
+ void cipher(const byte in[], byte out[], size_t length) override
{
::RC4(&m_rc4, length, in, out);
}
- void key_schedule(const byte key[], size_t length)
+ void key_schedule(const byte key[], size_t length) override
{
::RC4_set_key(&m_rc4, length, key);
byte d = 0;