summaryrefslogtreecommitdiff
path: root/random/random-daemon.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2012-11-30 18:16:34 +0100
committerWerner Koch <wk@gnupg.org>2012-12-03 20:47:38 +0100
commitc324644aa14e54fc7051983b38222db32b8ab227 (patch)
treeb237ea9932a3990382ee0487b772293bcc897c2b /random/random-daemon.c
parentf851b9a932ee64fa5a06000d1ac763ba4349f07d (diff)
downloadlibgcrypt-c324644aa14e54fc7051983b38222db32b8ab227.tar.gz
Move nonce creation from csprng backend to random main module.
* random/random-csprng.c (_gcry_rngcsprng_create_nonce): Remove. (nonce_buffer_lock): Remove. (initialize_basics): Remove init of nonce_buffer_lock. * random/random.c: Add a few header files. (nonce_buffer_lock): New. (_gcry_random_initialize): Init nonce_buffer_lock. (gcry_create_nonce): Add code from _gcry_rngcsprng_create_nonce. * random/random-daemon.c (_gcry_daemon_create_nonce): Remove. -- The nonce generation code is useful for all RNG types and thus it should be in random.c. The only exception is the fips-mode, which requires the use of the fips nonce generator.
Diffstat (limited to 'random/random-daemon.c')
-rw-r--r--random/random-daemon.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/random/random-daemon.c b/random/random-daemon.c
index 9422e853..26d77f8c 100644
--- a/random/random-daemon.c
+++ b/random/random-daemon.c
@@ -345,17 +345,4 @@ _gcry_daemon_randomize (const char *socketname,
return err ? -1 : 0;
}
-
-/* Internal function to fill BUFFER with NBYTES of data usable for a
- nonce. Returns 0 on success. */
-int
-_gcry_daemon_create_nonce (const char *socketname, void *buffer, size_t length)
-{
- gcry_error_t err;
-
- err = call_daemon (socketname, buffer, length, 1, 0);
-
- return err ? -1 : 0;
-}
-
/* END */