mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-27 20:31:40 +01:00
41 lines
1.3 KiB
Diff
41 lines
1.3 KiB
Diff
diff --git a/lib/os.c b/lib/os.c
|
|
index fa53e04..a1408ed 100644
|
|
--- a/lib/os.c
|
|
+++ b/lib/os.c
|
|
@@ -543,6 +543,7 @@ BOOL os_random(struct ssl_config * ssl_config, void *buffer, unsigned long count
|
|
{
|
|
int fd;
|
|
|
|
+#ifndef OPENSSL_NO_EGD
|
|
if (ssl_config->egd_socket) {
|
|
if ((fd = os_connect_unix_socket(ssl_config->egd_socket)) < 0)
|
|
return (NIL);
|
|
@@ -564,6 +565,7 @@ BOOL os_random(struct ssl_config * ssl_config, void *buffer, unsigned long count
|
|
close(fd);
|
|
return (T);
|
|
}
|
|
+#endif
|
|
|
|
if ((fd = open("/dev/urandom", O_RDONLY)) < 0)
|
|
return (NIL);
|
|
diff --git a/lib/ssl.c b/lib/ssl.c
|
|
index 0e652c8..34b7167 100644
|
|
--- a/lib/ssl.c
|
|
+++ b/lib/ssl.c
|
|
@@ -78,6 +78,7 @@ static void os_initialize_prng(struct ssl_config *ssl_config)
|
|
int totbytes = 0;
|
|
int bytes;
|
|
|
|
+#ifndef OPENSSL_NO_EGD
|
|
if (ssl_config->egd_socket) {
|
|
if ((bytes = RAND_egd(ssl_config->egd_socket)) == -1) {
|
|
log_fatal("EGD Socket %s failed", ssl_config->egd_socket);
|
|
@@ -88,6 +89,7 @@ static void os_initialize_prng(struct ssl_config *ssl_config)
|
|
goto SEEDED; /* ditto */
|
|
}
|
|
}
|
|
+#endif
|
|
|
|
/* Try the good-old default /dev/urandom, if available */
|
|
totbytes += add_rand_file("/dev/urandom");
|