summaryrefslogtreecommitdiff
path: root/random/rand-internal.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2013-12-11 16:59:41 +0100
committerWerner Koch <wk@gnupg.org>2013-12-11 17:01:15 +0100
commitcd548ba2dc777b8b27d8d33182ba733c20222120 (patch)
tree58b2151b8e12bf23958e946554de4fd0ee86ee97 /random/rand-internal.h
parenteae1e7712e1b687bd77eb37d0eb505fc9d46d93c (diff)
downloadlibgcrypt-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/rand-internal.h')
-rw-r--r--random/rand-internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/random/rand-internal.h b/random/rand-internal.h
index f59a1027..79b23ace 100644
--- a/random/rand-internal.h
+++ b/random/rand-internal.h
@@ -44,6 +44,7 @@ void _gcry_random_progress (const char *what, int printchar,
/*-- random-csprng.c --*/
void _gcry_rngcsprng_initialize (int full);
+void _gcry_rngcsprng_close_fds (void);
void _gcry_rngcsprng_dump_stats (void);
void _gcry_rngcsprng_secure_alloc (void);
void _gcry_rngcsprng_enable_quick_gen (void);
@@ -64,6 +65,7 @@ void _gcry_rngcsprng_fast_poll (void);
/*-- random-fips.c --*/
void _gcry_rngfips_initialize (int full);
+void _gcry_rngfips_close_fds (void);
void _gcry_rngfips_dump_stats (void);
int _gcry_rngfips_is_faked (void);
gcry_error_t _gcry_rngfips_add_bytes (const void *buf, size_t buflen,
@@ -89,6 +91,7 @@ void _gcry_rngfips_deinit_external_test (void *context);
/*-- random-system.c --*/
void _gcry_rngsystem_initialize (int full);
+void _gcry_rngsystem_close_fds (void);
void _gcry_rngsystem_dump_stats (void);
int _gcry_rngsystem_is_faked (void);
gcry_error_t _gcry_rngsystem_add_bytes (const void *buf, size_t buflen,