summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--random/random-csprng.c12
-rw-r--r--random/random-drbg.c5
2 files changed, 16 insertions, 1 deletions
diff --git a/random/random-csprng.c b/random/random-csprng.c
index 6d6c082e..f3ad48f3 100644
--- a/random/random-csprng.c
+++ b/random/random-csprng.c
@@ -358,7 +358,17 @@ _gcry_rngcsprng_close_fds (void)
#if USE_RNDLINUX
_gcry_rndlinux_gather_random (NULL, 0, 0, 0);
#endif
- pool_filled = 0; /* Force re-open on next use. */
+ pool_writepos = 0;
+ pool_readpos = 0;
+ pool_filled = 0;
+ pool_filled_counter = 0;
+ did_initial_extra_seeding = 0;
+ pool_balance = 0;
+ just_mixed = 0;
+ xfree (rndpool);
+ xfree (keypool);
+ rndpool = NULL;
+ keypool = NULL;
unlock_pool ();
}
diff --git a/random/random-drbg.c b/random/random-drbg.c
index d44d11db..500ae645 100644
--- a/random/random-drbg.c
+++ b/random/random-drbg.c
@@ -1875,6 +1875,11 @@ _gcry_rngdrbg_close_fds (void)
#if USE_RNDLINUX
_gcry_rndlinux_gather_random (NULL, 0, 0, 0);
#endif
+ if (drbg_state)
+ {
+ drbg_uninstantiate (drbg_state);
+ drbg_state = NULL;
+ }
drbg_unlock ();
}