From: Richard Levitte Date: Wed, 28 Jun 2000 16:09:54 +0000 (+0000) Subject: Make it possible for people to tell where the EGD socket is through X-Git-Tag: OpenSSL-engine-0_9_6-beta1~21^2~19 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=dffd72f171fba5ab14ca86aafc5d5eba131206ad Make it possible for people to tell where the EGD socket is through the RANDEGD environment variable. --- diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c index 02a0d86fa3..ad5385acaa 100644 --- a/crypto/rand/rand_egd.c +++ b/crypto/rand/rand_egd.c @@ -54,6 +54,7 @@ * */ +#include #include /* Query the EGD . @@ -83,12 +84,17 @@ int RAND_egd_bytes(const char *path,int bytes) int RAND_egd(const char *path) { + const char *s; int ret = -1; struct sockaddr_un addr; int len, num; int fd = -1; unsigned char buf[256]; + s=getenv("RANDEGD"); + if (s != NULL) + path = s; + memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; if (strlen(path) > sizeof(addr.sun_path)) @@ -115,12 +121,17 @@ int RAND_egd(const char *path) int RAND_egd_bytes(const char *path,int bytes) { + const char *s; int ret = 0; struct sockaddr_un addr; int len, num; int fd = -1; unsigned char buf[255]; + s=getenv("RANDEGD"); + if (s != NULL) + path = s; + memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; if (strlen(path) > sizeof(addr.sun_path))