diff options
author | rhe <rhe@ruby-lang.org> | 2016-06-05 12:46:05 +0000 |
---|---|---|
committer | rhe <rhe@ruby-lang.org> | 2016-06-05 12:46:05 +0000 |
commit | 6c18d7d746e31c0c8e1c4fd78b65d9647bb1a32a (patch) | |
tree | 6dfaab3bc3a174f6bfc7ae8c33d60265a68a441e /ext/openssl/ossl_x509store.c | |
parent | 6c32fb461b939b5e15026ad33099a8d29f4ece3f (diff) | |
download | ruby-openssl-history-6c18d7d746e31c0c8e1c4fd78b65d9647bb1a32a.tar.gz |
openssl: support OpenSSL 1.1.0's new multi-threading API
* ext/openssl/extconf.rb: Check absence of CRYPTO_lock() to see if the
OpenSSL has the new threading API. In OpenSSL <= 1.0.2, an application
had to set locking callbacks to use OpenSSL in a multi-threaded
environment. OpenSSL 1.1.0 now finds pthreads or Windows threads so we
don't need to do something special.
[ruby-core:75225] [Feature #12324]
Also check existence of *_up_ref(). Some structures in OpenSSL have
a reference counter. We used to increment it with CRYPTO_add() which
is a part of the old API.
* ext/openssl/openssl_missing.h: Implement *_up_ref() if missing.
* ext/openssl/ossl.c: Don't set locking callbacks if unneeded.
* ext/openssl/ossl_pkey.c, ext/openssl/ossl_ssl.c,
ext/openssl/ossl_x509cert.c, ext/openssl/ossl_x509crl.c,
ext/openssl/ossl_x509store.c: Use *_up_ref() instead of CRYPTO_add().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_x509store.c')
-rw-r--r-- | ext/openssl/ossl_x509store.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c index 767e30b..a98c182 100644 --- a/ext/openssl/ossl_x509store.c +++ b/ext/openssl/ossl_x509store.c @@ -98,7 +98,7 @@ DupX509StorePtr(VALUE obj) X509_STORE *store; SafeGetX509Store(obj, store); - CRYPTO_add(&store->references, 1, CRYPTO_LOCK_X509_STORE); + X509_STORE_up_ref(store); return store; } |