aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-15 11:28:06 -0400
committerJack Lloyd <[email protected]>2017-10-15 11:28:06 -0400
commit96ed1bf7f001e8302bdaa42ab37555ee5c0f9edb (patch)
treec27a5e1a6875062a8b55f1a54129d84ef8ad1373
parentd52dece3876df6d19681fb16cb607325aee01052 (diff)
Additional final annotations
-rw-r--r--src/cli/cli.h2
-rw-r--r--src/cli/encryption.cpp2
-rw-r--r--src/cli/speed.cpp10
-rw-r--r--src/cli/timing_tests.cpp10
-rw-r--r--src/cli/tls_proxy.cpp5
-rw-r--r--src/cli/tls_utils.cpp2
-rw-r--r--src/lib/asn1/der_enc.h2
-rw-r--r--src/lib/block/aes/aes.cpp6
-rw-r--r--src/lib/block/cast/cast128.cpp2
-rw-r--r--src/lib/math/numbertheory/dsa_gen.cpp2
-rw-r--r--src/lib/pubkey/mce/code_based_key_gen.cpp2
-rw-r--r--src/lib/pubkey/newhope/newhope.h2
-rw-r--r--src/lib/pubkey/xmss/atomic.h2
-rw-r--r--src/lib/pubkey/xmss/xmss_address.h2
-rw-r--r--src/lib/pubkey/xmss/xmss_hash.h2
-rw-r--r--src/lib/pubkey/xmss/xmss_index_registry.h2
-rw-r--r--src/lib/pubkey/xmss/xmss_signature.h2
-rw-r--r--src/lib/pubkey/xmss/xmss_tools.h2
-rw-r--r--src/lib/pubkey/xmss/xmss_verification_operation.h5
-rw-r--r--src/lib/pubkey/xmss/xmss_wots_addressed_privatekey.h6
-rw-r--r--src/lib/pubkey/xmss/xmss_wots_parameters.h2
-rw-r--r--src/lib/pubkey/xmss/xmss_wots_publickey.h2
-rw-r--r--src/lib/tls/tls_messages.h4
-rw-r--r--src/lib/utils/http_util/http_util.h2
-rw-r--r--src/lib/utils/mutex.h4
-rw-r--r--src/tests/test_hash_id.cpp2
-rw-r--r--src/tests/test_tls_cbc.cpp2
27 files changed, 44 insertions, 44 deletions
diff --git a/src/cli/cli.h b/src/cli/cli.h
index fc27e1d83..1e81c2ff6 100644
--- a/src/cli/cli.h
+++ b/src/cli/cli.h
@@ -554,7 +554,7 @@ class Command
return r;
}
- class Registration
+ class Registration final
{
public:
Registration(const std::string& name, cmd_maker_fn maker_fn)
diff --git a/src/cli/encryption.cpp b/src/cli/encryption.cpp
index 9c9279901..e8d5622c2 100644
--- a/src/cli/encryption.cpp
+++ b/src/cli/encryption.cpp
@@ -74,7 +74,7 @@ secure_vector<byte> do_crypt(const std::string &cipher,
}
-class Encryption : public Command
+class Encryption final : public Command
{
public:
Encryption() : Command("encryption --buf-size=4096 --decrypt --mode= --key= --iv= --ad=") {}
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index 9e1430668..3bb4f9279 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -132,7 +132,7 @@ namespace Botan_CLI {
namespace {
-class Timer
+class Timer final
{
public:
Timer(const std::string& name,
@@ -211,7 +211,7 @@ class Timer
return (milliseconds() < msec.count());
}
- class Timer_Scope
+ class Timer_Scope final
{
public:
explicit Timer_Scope(Timer& timer)
@@ -465,7 +465,7 @@ std::vector<std::string> default_benchmark_list()
}
-class Summary
+class Summary final
{
public:
Summary() {}
@@ -591,7 +591,7 @@ class Summary
}
private:
- class EntryBps
+ class EntryBps final
{
public:
EntryBps(const std::string& algo
@@ -618,7 +618,7 @@ class Summary
std::map<size_t, double> m_bps;
};
- class EntryOps
+ class EntryOps final
{
public:
EntryOps(const std::string& algo
diff --git a/src/cli/timing_tests.cpp b/src/cli/timing_tests.cpp
index 9600f2a5e..258780845 100644
--- a/src/cli/timing_tests.cpp
+++ b/src/cli/timing_tests.cpp
@@ -89,7 +89,7 @@ class Timing_Test
#if defined(BOTAN_HAS_RSA) && defined(BOTAN_HAS_EME_PKCS1v15) && defined(BOTAN_HAS_EME_RAW)
-class Bleichenbacker_Timing_Test : public Timing_Test
+class Bleichenbacker_Timing_Test final : public Timing_Test
{
public:
Bleichenbacker_Timing_Test(size_t keysize)
@@ -133,7 +133,7 @@ class Bleichenbacker_Timing_Test : public Timing_Test
* Padding (OAEP) as Standardized in PKCS #1 v2.0" James Manger
* http://archiv.infsec.ethz.ch/education/fs08/secsem/Manger01.pdf
*/
-class Manger_Timing_Test : public Timing_Test
+class Manger_Timing_Test final : public Timing_Test
{
public:
Manger_Timing_Test(size_t keysize)
@@ -181,7 +181,7 @@ class Manger_Timing_Test : public Timing_Test
/*
* Test handling of countermeasure to the Lucky13 attack
*/
-class Lucky13_Timing_Test : public Timing_Test
+class Lucky13_Timing_Test final : public Timing_Test
{
public:
Lucky13_Timing_Test(const std::string& mac_name, size_t mac_keylen)
@@ -240,7 +240,7 @@ ticks Lucky13_Timing_Test::measure_critical_function(std::vector<uint8_t> input)
#if defined(BOTAN_HAS_ECDSA)
-class ECDSA_Timing_Test : public Timing_Test
+class ECDSA_Timing_Test final : public Timing_Test
{
public:
ECDSA_Timing_Test(std::string ecgroup);
@@ -337,7 +337,7 @@ std::vector<std::vector<ticks>> Timing_Test::execute_evaluation(
return all_results;
}
-class Timing_Test_Command : public Command
+class Timing_Test_Command final : public Command
{
public:
Timing_Test_Command()
diff --git a/src/cli/tls_proxy.cpp b/src/cli/tls_proxy.cpp
index 25ffabdb8..2c5f6889d 100644
--- a/src/cli/tls_proxy.cpp
+++ b/src/cli/tls_proxy.cpp
@@ -60,7 +60,8 @@ void log_text_message(const char* where, const uint8_t buf[], size_t buf_len)
//std::cout << where << ' ' << std::string(c, c + buf_len) << std::endl;
}
-class tls_proxy_session : public boost::enable_shared_from_this<tls_proxy_session>, public Botan::TLS::Callbacks
+class tls_proxy_session final : public boost::enable_shared_from_this<tls_proxy_session>,
+ public Botan::TLS::Callbacks
{
public:
enum { readbuf_size = 4 * 1024 };
@@ -337,7 +338,7 @@ class tls_proxy_session : public boost::enable_shared_from_this<tls_proxy_sessio
std::vector<uint8_t> m_p2s_pending;
};
-class tls_proxy_server
+class tls_proxy_server final
{
public:
typedef tls_proxy_session session;
diff --git a/src/cli/tls_utils.cpp b/src/cli/tls_utils.cpp
index 96be073db..f62781af9 100644
--- a/src/cli/tls_utils.cpp
+++ b/src/cli/tls_utils.cpp
@@ -16,7 +16,7 @@
namespace Botan_CLI {
-class TLS_All_Policy : public Botan::TLS::Policy
+class TLS_All_Policy final : public Botan::TLS::Policy
{
public:
std::vector<std::string> allowed_ciphers() const override
diff --git a/src/lib/asn1/der_enc.h b/src/lib/asn1/der_enc.h
index 7ffa824e6..f1e85101c 100644
--- a/src/lib/asn1/der_enc.h
+++ b/src/lib/asn1/der_enc.h
@@ -115,7 +115,7 @@ class BOTAN_PUBLIC_API(2,0) DER_Encoder final
uint8_t val);
private:
- class DER_Sequence
+ class DER_Sequence final
{
public:
ASN1_Tag tag_of() const;
diff --git a/src/lib/block/aes/aes.cpp b/src/lib/block/aes/aes.cpp
index 268e0804d..6afa5133a 100644
--- a/src/lib/block/aes/aes.cpp
+++ b/src/lib/block/aes/aes.cpp
@@ -119,7 +119,7 @@ inline uint32_t SE_word(uint32_t x)
const uint32_t* AES_TE()
{
- class TE_Table
+ class TE_Table final
{
public:
TE_Table()
@@ -137,7 +137,7 @@ const uint32_t* AES_TE()
return reinterpret_cast<const uint32_t*>(data);
}
private:
- std::aligned_storage<sizeof(uint32_t), 1024>::type data[256];
+ std::aligned_storage<256*sizeof(uint32_t), 64>::type data[256];
};
static TE_Table table;
@@ -146,7 +146,7 @@ const uint32_t* AES_TE()
const uint32_t* AES_TD()
{
- class TD_Table
+ class TD_Table final
{
public:
TD_Table()
diff --git a/src/lib/block/cast/cast128.cpp b/src/lib/block/cast/cast128.cpp
index d54d0614e..5ad732eb3 100644
--- a/src/lib/block/cast/cast128.cpp
+++ b/src/lib/block/cast/cast128.cpp
@@ -320,7 +320,7 @@ void CAST_128::cast_ks(secure_vector<uint32_t>& K,
0xA466BB1E, 0xF8DA0A82, 0x04F19130, 0xBA6E4EC0, 0x99265164, 0x1EE7230D,
0x50B2AD80, 0xEAEE6801, 0x8DB2A283, 0xEA8BF59E };
- class ByteReader
+ class ByteReader final
{
public:
uint8_t operator()(size_t i) const
diff --git a/src/lib/math/numbertheory/dsa_gen.cpp b/src/lib/math/numbertheory/dsa_gen.cpp
index 55190d60b..30be0eaab 100644
--- a/src/lib/math/numbertheory/dsa_gen.cpp
+++ b/src/lib/math/numbertheory/dsa_gen.cpp
@@ -56,7 +56,7 @@ bool generate_dsa_primes(RandomNumberGenerator& rng,
const size_t HASH_SIZE = hash->output_length();
- class Seed
+ class Seed final
{
public:
explicit Seed(const std::vector<uint8_t>& s) : m_seed(s) {}
diff --git a/src/lib/pubkey/mce/code_based_key_gen.cpp b/src/lib/pubkey/mce/code_based_key_gen.cpp
index 01650af26..b655b543b 100644
--- a/src/lib/pubkey/mce/code_based_key_gen.cpp
+++ b/src/lib/pubkey/mce/code_based_key_gen.cpp
@@ -19,7 +19,7 @@ namespace Botan {
namespace {
-class binary_matrix
+class binary_matrix final
{
public:
binary_matrix(uint32_t m_rown, uint32_t m_coln);
diff --git a/src/lib/pubkey/newhope/newhope.h b/src/lib/pubkey/newhope/newhope.h
index 070652db9..3b6df1c21 100644
--- a/src/lib/pubkey/newhope/newhope.h
+++ b/src/lib/pubkey/newhope/newhope.h
@@ -25,7 +25,7 @@ class RandomNumberGenerator;
*/
// TODO: change to just a secure_vector
-class newhope_poly
+class newhope_poly final
{
public:
uint16_t coeffs[1024];
diff --git a/src/lib/pubkey/xmss/atomic.h b/src/lib/pubkey/xmss/atomic.h
index 760ffddc3..d2e65c104 100644
--- a/src/lib/pubkey/xmss/atomic.h
+++ b/src/lib/pubkey/xmss/atomic.h
@@ -20,7 +20,7 @@ template <typename T>
* std::vector. The construction of instances of this wrapper is NOT atomic
* and needs to be properly guarded.
**/
-class Atomic
+class Atomic final
{
public:
Atomic() = default;
diff --git a/src/lib/pubkey/xmss/xmss_address.h b/src/lib/pubkey/xmss/xmss_address.h
index 3838ed48f..f00343ca3 100644
--- a/src/lib/pubkey/xmss/xmss_address.h
+++ b/src/lib/pubkey/xmss/xmss_address.h
@@ -18,7 +18,7 @@ namespace Botan {
* OTS-Hash-Address can be called depending on the type currently
* assigned to the XMSS address using set_type().
**/
-class XMSS_Address
+class XMSS_Address final
{
public:
/**
diff --git a/src/lib/pubkey/xmss/xmss_hash.h b/src/lib/pubkey/xmss/xmss_hash.h
index 7dcfb8465..16380f8f1 100644
--- a/src/lib/pubkey/xmss/xmss_hash.h
+++ b/src/lib/pubkey/xmss/xmss_hash.h
@@ -16,7 +16,7 @@ namespace Botan {
* A collection of pseudorandom hash functions required for XMSS and WOTS
* computations.
**/
-class XMSS_Hash
+class XMSS_Hash final
{
public:
XMSS_Hash(const std::string& h_func_name);
diff --git a/src/lib/pubkey/xmss/xmss_index_registry.h b/src/lib/pubkey/xmss/xmss_index_registry.h
index d7448693a..27a68631a 100644
--- a/src/lib/pubkey/xmss/xmss_index_registry.h
+++ b/src/lib/pubkey/xmss/xmss_index_registry.h
@@ -18,7 +18,7 @@ namespace Botan {
* A registry for XMSS private keys, keeps track of the leaf index for
* independend copies of the same key.
**/
-class XMSS_Index_Registry
+class XMSS_Index_Registry final
{
public:
XMSS_Index_Registry(const XMSS_Index_Registry&) = delete;
diff --git a/src/lib/pubkey/xmss/xmss_signature.h b/src/lib/pubkey/xmss/xmss_signature.h
index 493697d51..838aae2e8 100644
--- a/src/lib/pubkey/xmss/xmss_signature.h
+++ b/src/lib/pubkey/xmss/xmss_signature.h
@@ -17,7 +17,7 @@
namespace Botan {
-class XMSS_Signature
+class XMSS_Signature final
{
public:
/**
diff --git a/src/lib/pubkey/xmss/xmss_tools.h b/src/lib/pubkey/xmss/xmss_tools.h
index 564a40c52..306598187 100644
--- a/src/lib/pubkey/xmss/xmss_tools.h
+++ b/src/lib/pubkey/xmss/xmss_tools.h
@@ -19,7 +19,7 @@ namespace Botan {
* Helper tools for low level byte operations required
* for the XMSS implementation.
**/
- class XMSS_Tools
+ class XMSS_Tools final
{
public:
XMSS_Tools(const XMSS_Tools&) = delete;
diff --git a/src/lib/pubkey/xmss/xmss_verification_operation.h b/src/lib/pubkey/xmss/xmss_verification_operation.h
index 1b42bb158..6e8469392 100644
--- a/src/lib/pubkey/xmss/xmss_verification_operation.h
+++ b/src/lib/pubkey/xmss/xmss_verification_operation.h
@@ -24,9 +24,8 @@ namespace Botan {
* Provides signature verification capabilities for Extended Hash-Based
* Signatures (XMSS).
**/
- class XMSS_Verification_Operation
- final : public virtual PK_Ops::Verification,
- public XMSS_Common_Ops
+ class XMSS_Verification_Operation final : public virtual PK_Ops::Verification,
+ public XMSS_Common_Ops
{
public:
XMSS_Verification_Operation(
diff --git a/src/lib/pubkey/xmss/xmss_wots_addressed_privatekey.h b/src/lib/pubkey/xmss/xmss_wots_addressed_privatekey.h
index e18c69699..62beaaece 100644
--- a/src/lib/pubkey/xmss/xmss_wots_addressed_privatekey.h
+++ b/src/lib/pubkey/xmss/xmss_wots_addressed_privatekey.h
@@ -21,9 +21,9 @@ namespace Botan {
* needs to be stored together with the key and passed to the
* XMSS_WOTS_Signature_Operation() on creation.
**/
-class XMSS_WOTS_Addressed_PrivateKey
- final : public virtual XMSS_WOTS_Addressed_PublicKey,
- public virtual Private_Key
+class XMSS_WOTS_Addressed_PrivateKey final :
+ public virtual XMSS_WOTS_Addressed_PublicKey,
+ public virtual Private_Key
{
public:
XMSS_WOTS_Addressed_PrivateKey(const XMSS_WOTS_PrivateKey& private_key)
diff --git a/src/lib/pubkey/xmss/xmss_wots_parameters.h b/src/lib/pubkey/xmss/xmss_wots_parameters.h
index 0e16b900b..0c2825017 100644
--- a/src/lib/pubkey/xmss/xmss_wots_parameters.h
+++ b/src/lib/pubkey/xmss/xmss_wots_parameters.h
@@ -24,7 +24,7 @@ namespace Botan {
* https://datatracker.ietf.org/doc/
* draft-irtf-cfrg-xmss-hash-based-signatures/?include_text=1
**/
-class XMSS_WOTS_Parameters
+class XMSS_WOTS_Parameters final
{
public:
enum ots_algorithm_t
diff --git a/src/lib/pubkey/xmss/xmss_wots_publickey.h b/src/lib/pubkey/xmss/xmss_wots_publickey.h
index aa30bd304..1c7366f0b 100644
--- a/src/lib/pubkey/xmss/xmss_wots_publickey.h
+++ b/src/lib/pubkey/xmss/xmss_wots_publickey.h
@@ -32,7 +32,7 @@ typedef std::vector<secure_vector<uint8_t>> wots_keysig_t;
class BOTAN_PUBLIC_API(2,0) XMSS_WOTS_PublicKey : virtual public Public_Key
{
public:
- class TreeSignature
+ class TreeSignature final
{
public:
TreeSignature() = default;
diff --git a/src/lib/tls/tls_messages.h b/src/lib/tls/tls_messages.h
index 4370f6fe2..ac6c1e1ad 100644
--- a/src/lib/tls/tls_messages.h
+++ b/src/lib/tls/tls_messages.h
@@ -68,7 +68,7 @@ class BOTAN_UNSTABLE_API Hello_Verify_Request final : public Handshake_Message
class BOTAN_UNSTABLE_API Client_Hello final : public Handshake_Message
{
public:
- class Settings
+ class Settings final
{
public:
Settings(const Protocol_Version version,
@@ -182,7 +182,7 @@ class BOTAN_UNSTABLE_API Client_Hello final : public Handshake_Message
class BOTAN_UNSTABLE_API Server_Hello final : public Handshake_Message
{
public:
- class Settings
+ class Settings final
{
public:
Settings(const std::vector<uint8_t> new_session_id,
diff --git a/src/lib/utils/http_util/http_util.h b/src/lib/utils/http_util/http_util.h
index 528a4fae8..ea6122c07 100644
--- a/src/lib/utils/http_util/http_util.h
+++ b/src/lib/utils/http_util/http_util.h
@@ -19,7 +19,7 @@ namespace Botan {
namespace HTTP {
-class Response
+class Response final
{
public:
Response() : m_status_code(0), m_status_message("Uninitialized") {}
diff --git a/src/lib/utils/mutex.h b/src/lib/utils/mutex.h
index 46a652bba..6e24815bb 100644
--- a/src/lib/utils/mutex.h
+++ b/src/lib/utils/mutex.h
@@ -27,7 +27,7 @@ typedef std::mutex mutex_type;
namespace Botan {
template<typename Mutex>
-class lock_guard
+class lock_guard final
{
public:
explicit lock_guard(Mutex& m) : m_mutex(m)
@@ -41,7 +41,7 @@ class lock_guard
Mutex& m_mutex;
};
-class noop_mutex
+class noop_mutex final
{
public:
void lock() {}
diff --git a/src/tests/test_hash_id.cpp b/src/tests/test_hash_id.cpp
index 9a8565a16..e58c0a5e7 100644
--- a/src/tests/test_hash_id.cpp
+++ b/src/tests/test_hash_id.cpp
@@ -17,7 +17,7 @@ namespace Botan_Tests {
#if defined(BOTAN_HAS_HASH_ID) && defined(BOTAN_HAS_ASN1)
-class PKCS_HashID_Test : public Test
+class PKCS_HashID_Test final : public Test
{
public:
std::vector<Test::Result> run() override
diff --git a/src/tests/test_tls_cbc.cpp b/src/tests/test_tls_cbc.cpp
index b26f399ac..b8359d483 100644
--- a/src/tests/test_tls_cbc.cpp
+++ b/src/tests/test_tls_cbc.cpp
@@ -14,7 +14,7 @@ namespace Botan_Tests {
#if defined(BOTAN_HAS_TLS_CBC)
-class TLS_CBC_Padding_Tests : public Text_Based_Test
+class TLS_CBC_Padding_Tests final : public Text_Based_Test
{
public:
TLS_CBC_Padding_Tests() : Text_Based_Test("tls_cbc.vec", "Record,Output") {}