summaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-10-06 22:22:22 +0000
committerNick Mathewson <nickm@torproject.org>2005-10-06 22:22:22 +0000
commita89daaeca90b84bed9ab802965c13705a18ed1a9 (patch)
tree610e421147c221337d95dd2fa44625acc8812546 /src/common/crypto.c
parentcc35e1720f7dde775e2c8246c2f9b542954e401f (diff)
downloadtor-a89daaeca90b84bed9ab802965c13705a18ed1a9.tar.gz
tor-a89daaeca90b84bed9ab802965c13705a18ed1a9.zip
Once an hour (not just on startup) give OpenSSL some more entropy.
Add entropy in 512-bit chunks, not 160-bit chunks. (This latter change is voodoo.) svn:r5211
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 16d1734ac4..2c5b96f371 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1575,16 +1575,16 @@ crypto_dh_free(crypto_dh_env_t *dh)
/* random numbers */
-/** Seed OpenSSL's random number generator with DIGEST_LEN bytes from the
+/** Seed OpenSSL's random number generator with bytes from the
* operating system. Return 0 on success, -1 on failure.
*/
int
crypto_seed_rng(void)
{
+ char buf[64];
#ifdef MS_WINDOWS
static int provider_set = 0;
static HCRYPTPROV provider;
- char buf[DIGEST_LEN+1];
if (!provider_set) {
if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
@@ -1610,7 +1610,6 @@ crypto_seed_rng(void)
};
int fd;
int i, n;
- char buf[DIGEST_LEN+1];
for (i = 0; filenames[i]; ++i) {
fd = open(filenames[i], O_RDONLY, 0);