diff options
author | Werner Koch <wk@gnupg.org> | 2013-12-11 16:59:41 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2013-12-11 17:01:15 +0100 |
commit | cd548ba2dc777b8b27d8d33182ba733c20222120 (patch) | |
tree | 58b2151b8e12bf23958e946554de4fd0ee86ee97 /random/random.h | |
parent | eae1e7712e1b687bd77eb37d0eb505fc9d46d93c (diff) | |
download | libgcrypt-cd548ba2dc777b8b27d8d33182ba733c20222120.tar.gz |
random: Add a feature to close device file descriptors.
* src/gcrypt.h.in (GCRYCTL_CLOSE_RANDOM_DEVICE): New.
* src/global.c (_gcry_vcontrol): Call _gcry_random_close_fds.
* random/random.c (_gcry_random_close_fds): New.
* random/random-csprng.c (_gcry_rngcsprng_close_fds): New.
* random/random-fips.c (_gcry_rngfips_close_fds): New.
* random/random-system.c (_gcry_rngsystem_close_fds): New.
* random/rndlinux.c (open_device): Add arg retry.
(_gcry_rndlinux_gather_random): Add mode to close open fds.
* tests/random.c (check_close_random_device): New.
(main): Call new test.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'random/random.h')
-rw-r--r-- | random/random.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/random/random.h b/random/random.h index aae07ab0..2bc8cabc 100644 --- a/random/random.h +++ b/random/random.h @@ -28,6 +28,7 @@ void _gcry_register_random_progress (void (*cb)(void *,const char*,int,int,int), void _gcry_set_preferred_rng_type (int type); void _gcry_random_initialize (int full); +void _gcry_random_close_fds (void); int _gcry_get_rng_type (int ignore_fips_mode); void _gcry_random_dump_stats(void); void _gcry_secure_random_alloc(void); |