diff options
author | Kazuki Yamaguchi <[email protected]> | 2020-08-21 17:33:25 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <[email protected]> | 2021-07-18 17:44:43 +0900 |
commit | b7a908af3420d12a6471c5f2d9cbae7faa4451b8 (patch) | |
tree | 1f6cd7b3347a2dcf8a5de8b5c058ce1e80fff217 /ext/openssl/ossl.c | |
parent | 88d64418ddb77118b17c20a1455aa0c6341e077a (diff) |
[ruby/openssl] ossl.c: do not set locking callbacks on LibreSSL
Similarly to OpenSSL >= 1.1.0, LibreSSL 2.9.0 ensures thread safety
without requiring applications to set locking callbacks and made
related functions no-op.
https://github.com/ruby/openssl/commit/7276233e1a
Diffstat (limited to 'ext/openssl/ossl.c')
-rw-r--r-- | ext/openssl/ossl.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c index 70b6a6a806..358b3b29f0 100644 --- a/ext/openssl/ossl.c +++ b/ext/openssl/ossl.c @@ -9,7 +9,13 @@ */ #include "ossl.h" #include <stdarg.h> /* for ossl_raise */ -#include <ruby/thread_native.h> /* for OpenSSL < 1.1.0 locks */ + +/* OpenSSL >= 1.1.0 and LibreSSL >= 2.9.0 */ +#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER >= 0x10100000 +# define HAVE_OPENSSL_110_THREADING_API +#else +# include <ruby/thread_native.h> +#endif /* * Data Conversion |