summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/bsd-getentropy.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2022-08-10 17:25:24 +1000
committerDarren Tucker <dtucker@dtucker.net>2022-08-10 17:36:44 +1000
commit7e2f51940ba48a1c0fae1107801ea643fa83c971 (patch)
treec68041342e100b4b3bde3a4a81f13854d425cf76 /openbsd-compat/bsd-getentropy.c
parent7a01f61be8d0aca0e975e7417f26371495fe7674 (diff)
Rename our getentropy to prevent possible loops.
Since arc4random seeds from getentropy, and we use OpenSSL for that if enabled, there's the possibility that if we build on a system that does not have getentropy then run on a system that does have it, then OpenSSL could end up calling our getentropy and getting stuck in a loop. Pointed out by deraadt@, ok djm@
Diffstat (limited to 'openbsd-compat/bsd-getentropy.c')
-rw-r--r--openbsd-compat/bsd-getentropy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-getentropy.c b/openbsd-compat/bsd-getentropy.c
index 1733e287..bd4b6695 100644
--- a/openbsd-compat/bsd-getentropy.c
+++ b/openbsd-compat/bsd-getentropy.c
@@ -41,7 +41,7 @@
#include "log.h"
int
-getentropy(void *s, size_t len)
+_ssh_compat_getentropy(void *s, size_t len)
{
#ifdef WITH_OPENSSL
if (RAND_bytes(s, len) <= 0)