diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-02-01 03:34:00 +0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2017-01-31 14:34:00 -0500 |
commit | a840aa27992685129e0954b6e30a974123dda136 (patch) | |
tree | 1f412bb5e6a4ffa821cac31a18f15201c6ae8c95 /src/_cffi_src/openssl | |
parent | c7a2e72c6c1c36244ea8a82142570d69a78791ea (diff) | |
download | cryptography-a840aa27992685129e0954b6e30a974123dda136.tar.gz cryptography-a840aa27992685129e0954b6e30a974123dda136.tar.bz2 cryptography-a840aa27992685129e0954b6e30a974123dda136.zip |
make cryptography fallback to /dev/urandom on mac on macOS < 10.12 (#3354)
Diffstat (limited to 'src/_cffi_src/openssl')
-rw-r--r-- | src/_cffi_src/openssl/src/osrandom_engine.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/_cffi_src/openssl/src/osrandom_engine.h b/src/_cffi_src/openssl/src/osrandom_engine.h index d28ebf39..5abe8fc0 100644 --- a/src/_cffi_src/openssl/src/osrandom_engine.h +++ b/src/_cffi_src/openssl/src/osrandom_engine.h @@ -13,6 +13,7 @@ #ifdef __APPLE__ #include <sys/random.h> + #include <AvailabilityMacros.h> #endif #ifdef __linux__ @@ -33,8 +34,11 @@ #if defined(_WIN32) /* Windows */ #define CRYPTOGRAPHY_OSRANDOM_ENGINE CRYPTOGRAPHY_OSRANDOM_ENGINE_CRYPTGENRANDOM - #elif defined(BSD) && defined(SYS_getentropy) - /* OpenBSD 5.6+ or macOS 10.12+ */ + #elif defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 + /* macOS 10.12+ */ + #define CRYPTOGRAPHY_OSRANDOM_ENGINE CRYPTOGRAPHY_OSRANDOM_ENGINE_GETENTROPY + #elif defined(BSD) && defined(SYS_getentropy) && !defined(__APPLE__) + /* OpenBSD 5.6+ */ #define CRYPTOGRAPHY_OSRANDOM_ENGINE CRYPTOGRAPHY_OSRANDOM_ENGINE_GETENTROPY #elif defined(__linux__) && defined(SYS_getrandom) /* Linux 3.4.17+ */ |