diff options
author | djm <djm> | 2002-01-22 10:57:53 +0000 |
---|---|---|
committer | djm <djm> | 2002-01-22 10:57:53 +0000 |
commit | d49ae7c410f65f02109ffdabae87d353e1c4e361 (patch) | |
tree | d3afc112f33aa0c62a8bd642364db919e35257a7 /entropy.c | |
parent | 9851d455d22c17e054079861cad03dd1dfe84473 (diff) | |
download | openssh-d49ae7c410f65f02109ffdabae87d353e1c4e361.tar.gz |
- (djm) autoconf hacking:
- We don't support --without-zlib currently, so don't allow it.
- Rework cryptographic random number support detection. We now detect
whether OpenSSL seeds itself. If it does, then we don't bother with
the ssh-rand-helper program. You can force the use of ssh-rand-helper
using the --with-rand-helper configure argument
- Simplify and clean up ssh-rand-helper configuration
Diffstat (limited to 'entropy.c')
-rw-r--r-- | entropy.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -45,15 +45,17 @@ * XXX: we should tell the child how many bytes we need. */ -#define RANDOM_SEED_SIZE 48 - -RCSID("$Id: entropy.c,v 1.39 2001/12/23 14:41:48 djm Exp $"); +RCSID("$Id: entropy.c,v 1.40 2002/01/22 10:57:54 djm Exp $"); +#ifndef OPENSSL_PRNG_ONLY +#define RANDOM_SEED_SIZE 48 static uid_t original_uid, original_euid; +#endif void seed_rng(void) { +#ifndef OPENSSL_PRNG_ONLY int devnull; int p[2]; pid_t pid; @@ -121,6 +123,10 @@ seed_rng(void) RAND_add(buf, sizeof(buf), sizeof(buf)); memset(buf, '\0', sizeof(buf)); + +#endif /* OPENSSL_PRNG_ONLY */ + if (RAND_status() != 1) + fatal("PRNG is not seeded"); } void @@ -134,8 +140,11 @@ init_rng(void) fatal("OpenSSL version mismatch. Built against %lx, you " "have %lx", OPENSSL_VERSION_NUMBER, SSLeay()); +#ifndef OPENSSL_PRNG_ONLY if ((original_uid = getuid()) == -1) fatal("getuid: %s", strerror(errno)); if ((original_euid = geteuid()) == -1) fatal("geteuid: %s", strerror(errno)); +#endif } + |