diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-07-26 11:26:34 -0500 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2017-07-26 12:26:34 -0400 |
commit | 65f41af9889a94b988668a288d8d4184ce38e1c7 (patch) | |
tree | 348e25aa4ef4b7834aee8baacc6a9515fd40595d /src/_cffi_src | |
parent | 45f2a42d9c1424b587ff834cfe2c6bec5c8919fe (diff) | |
download | cryptography-65f41af9889a94b988668a288d8d4184ce38e1c7.tar.gz cryptography-65f41af9889a94b988668a288d8d4184ce38e1c7.tar.bz2 cryptography-65f41af9889a94b988668a288d8d4184ce38e1c7.zip |
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.
Diffstat (limited to 'src/_cffi_src')
-rw-r--r-- | src/_cffi_src/openssl/src/osrandom_engine.c | 2 |
1 files changed, 2 insertions, 0 deletions
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. */ |