From b7a908af3420d12a6471c5f2d9cbae7faa4451b8 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Fri, 21 Aug 2020 17:33:25 +0900 Subject: [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 --- ext/openssl/ossl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ext/openssl/ossl.c') 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 /* for ossl_raise */ -#include /* 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 +#endif /* * Data Conversion -- cgit v1.2.3