aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng/stateful_rng
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-08-03 07:38:56 -0400
committerJack Lloyd <[email protected]>2017-08-03 10:37:02 -0400
commit6ce23f05c68f9c6b1b4742b8eb1f3068760fdd21 (patch)
tree99ba28ba5e9ef822b0fe0b4504ed71b3f82b0921 /src/lib/rng/stateful_rng
parentd1af646c365197de243c844d138f245d1dcac6ba (diff)
Add Stateful_RNG::reset_reseed_counter
Instead of giving subclasses access to the variable directly.
Diffstat (limited to 'src/lib/rng/stateful_rng')
-rw-r--r--src/lib/rng/stateful_rng/stateful_rng.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/rng/stateful_rng/stateful_rng.h b/src/lib/rng/stateful_rng/stateful_rng.h
index 0d59d396b..d02be5659 100644
--- a/src/lib/rng/stateful_rng/stateful_rng.h
+++ b/src/lib/rng/stateful_rng/stateful_rng.h
@@ -122,7 +122,11 @@ class BOTAN_DLL Stateful_RNG : public RandomNumberGenerator
protected:
void reseed_check();
- uint32_t last_pid() const { return m_last_pid; }
+ /**
+ * Called by a subclass to notify that a reseed has been
+ * successfully performed.
+ */
+ void reset_reseed_counter() { m_reseed_counter = 1; }
private:
// A non-owned and possibly null pointer to shared RNG
@@ -134,7 +138,6 @@ class BOTAN_DLL Stateful_RNG : public RandomNumberGenerator
const size_t m_reseed_interval;
uint32_t m_last_pid = 0;
- protected:
/*
* Set to 1 after a successful seeding, then incremented. Reset
* to 0 by clear() or a fork. This logic is used even if