diff options
author | Jack Lloyd <[email protected]> | 2017-10-03 09:57:04 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-10-03 09:57:04 -0400 |
commit | 26517eb98af4c3bb1faf38653ab55ae0956578eb (patch) | |
tree | 61ebd8ee9568369a4f2e6ff1806d47213f20032d /src/lib/rng | |
parent | 698f78182485587b6aa7773a43beac9033064e89 (diff) |
Avoid empty methods, use =default or add a comment
Sonar
Diffstat (limited to 'src/lib/rng')
-rw-r--r-- | src/lib/rng/rdrand_rng/rdrand_rng.h | 2 | ||||
-rw-r--r-- | src/lib/rng/rng.h | 2 | ||||
-rw-r--r-- | src/lib/rng/system_rng/system_rng.cpp | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/rng/rdrand_rng/rdrand_rng.h b/src/lib/rng/rdrand_rng/rdrand_rng.h index c4cfbdc5c..377de419f 100644 --- a/src/lib/rng/rdrand_rng/rdrand_rng.h +++ b/src/lib/rng/rdrand_rng/rdrand_rng.h @@ -54,8 +54,6 @@ class BOTAN_PUBLIC_API(2,0) RDRAND_RNG final : public Hardware_RNG std::string name() const override { return "RDRAND"; } bool is_seeded() const override { return true; } - - void clear() override {} }; } diff --git a/src/lib/rng/rng.h b/src/lib/rng/rng.h index 75c5b4e78..34f62d1ff 100644 --- a/src/lib/rng/rng.h +++ b/src/lib/rng/rng.h @@ -178,6 +178,8 @@ typedef RandomNumberGenerator RNG; */ class BOTAN_PUBLIC_API(2,0) Hardware_RNG : public RandomNumberGenerator { + public: + virtual void clear() final { /* no way to clear state of hardware RNG */ } }; /** diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp index fe9ae0f28..cec3deab1 100644 --- a/src/lib/rng/system_rng/system_rng.cpp +++ b/src/lib/rng/system_rng/system_rng.cpp @@ -64,7 +64,7 @@ class System_RNG_Impl final : public RandomNumberGenerator } bool is_seeded() const override { return true; } - void clear() override {} + void clear() override { /* not possible */ } std::string name() const override { return "cryptoapi"; } private: HCRYPTPROV m_prov; @@ -103,7 +103,7 @@ class System_RNG_Impl final : public RandomNumberGenerator } bool is_seeded() const override { return true; } - void clear() override {} + void clear() override { /* not possible */ } std::string name() const override { return "crypto_ng"; } private: BCRYPT_ALG_HANDLE m_handle; @@ -123,7 +123,7 @@ class System_RNG_Impl final : public RandomNumberGenerator void add_entropy(const uint8_t[], size_t) override { /* ignored */ } bool is_seeded() const override { return true; } - void clear() override {} + void clear() override { /* not possible */ } std::string name() const override { return "arc4random"; } }; @@ -162,7 +162,7 @@ class System_RNG_Impl final : public RandomNumberGenerator void randomize(uint8_t buf[], size_t len) override; void add_entropy(const uint8_t in[], size_t length) override; bool is_seeded() const override { return true; } - void clear() override {} + void clear() override { /* not possible */ } std::string name() const override { return BOTAN_SYSTEM_RNG_DEVICE; } private: int m_fd; |