From 65f41af9889a94b988668a288d8d4184ce38e1c7 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 26 Jul 2017 11:26:34 -0500 Subject: fix compilation on openbsd (#3814) the getentropy fallback is only possible on macOS, wrap it in a define to remove it entirely on the BSDs. --- src/_cffi_src/openssl/src/osrandom_engine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_cffi_src/openssl/src/osrandom_engine.c b/src/_cffi_src/openssl/src/osrandom_engine.c index 034637c5..4fcd34fb 100644 --- a/src/_cffi_src/openssl/src/osrandom_engine.c +++ b/src/_cffi_src/openssl/src/osrandom_engine.c @@ -223,8 +223,10 @@ static int osrandom_rand_bytes(unsigned char *buffer, int size) { int res; switch(getentropy_works) { +#if defined(__APPLE__) case CRYPTOGRAPHY_OSRANDOM_GETENTROPY_FALLBACK: return dev_urandom_read(buffer, size); +#endif case CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS: while (size > 0) { /* OpenBSD and macOS restrict maximum buffer size to 256. */ -- cgit v1.2.3