diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-08-31 21:39:36 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-09-02 23:36:22 +0900 |
commit | 4faee32e6b22f06b2f41e4a56d64b848e58fbfcf (patch) | |
tree | ad57bec495f3ac196958ef83f5d2485533c0d252 /ext/openssl | |
parent | 135f25653353edf1a7a7c960b3c7979b500cf1d6 (diff) | |
download | ruby-openssl-4faee32e6b22f06b2f41e4a56d64b848e58fbfcf.tar.gz |
ssl: don't store selected {EC,}DH parameter in an instance variable
The OpenSSL::PKey::{DH,EC} object is stored in an instance variable to
prevent the object from being GC'd (cf. r51460). However it turned out
to be unnecessary. The underlying object, DH and EC_KEY, have a
reference counter and OpenSSL increments it for the object returned by
the callback functions.
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/ossl_ssl.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 28a4633b..870d4f53 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -73,8 +73,6 @@ static VALUE eSSLErrorWaitWritable; #define ossl_ssl_set_ctx(o,v) rb_iv_set((o),"@context",(v)) #define ossl_ssl_set_sync_close(o,v) rb_iv_set((o),"@sync_close",(v)) #define ossl_ssl_set_hostname_v(o,v) rb_iv_set((o),"@hostname",(v)) -#define ossl_ssl_set_tmp_dh(o,v) rb_iv_set((o),"@tmp_dh",(v)) -#define ossl_ssl_set_tmp_ecdh(o,v) rb_iv_set((o),"@tmp_ecdh",(v)) static ID ID_callback_state; @@ -281,7 +279,6 @@ ossl_tmp_dh_callback(SSL *ssl, int is_export, int keylength) dh = rb_protect(ossl_call_tmp_dh_callback, args, NULL); if (!RTEST(dh)) return NULL; - ossl_ssl_set_tmp_dh(rb_ssl, dh); return EVP_PKEY_get0_DH(GetPKeyPtr(dh)); } @@ -315,7 +312,6 @@ ossl_tmp_ecdh_callback(SSL *ssl, int is_export, int keylength) ecdh = rb_protect(ossl_call_tmp_ecdh_callback, args, NULL); if (!RTEST(ecdh)) return NULL; - ossl_ssl_set_tmp_ecdh(rb_ssl, ecdh); return EVP_PKEY_get0_EC_KEY(GetPKeyPtr(ecdh)); } |