diff options
author | tenderlove <tenderlove@ruby-lang.org> | 2015-08-04 23:56:44 +0000 |
---|---|---|
committer | tenderlove <tenderlove@ruby-lang.org> | 2015-08-04 23:56:44 +0000 |
commit | 93b97202dce55c786b9c7da40fa19d008ea2b3e6 (patch) | |
tree | 2d4aafde47fae8b4120db885ff43b9fe31b035e1 /lib/openssl | |
parent | f5652e7c4bc1016567772833922aa7be16537f38 (diff) | |
download | ruby-openssl-history-93b97202dce55c786b9c7da40fa19d008ea2b3e6.tar.gz |
* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): extract callback
lookup to private Ruby methods. This means we can keep the default
DH callback logic hidden from consumers. Also, since the SSLSocket
always has a context, we can remove conditionals about that
instance.
* ext/openssl/ossl_ssl.c: move callback lookup methods to private Ruby
methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/openssl')
-rw-r--r-- | lib/openssl/ssl.rb | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lib/openssl/ssl.rb b/lib/openssl/ssl.rb index d50f058..cfa2a0c 100644 --- a/lib/openssl/ssl.rb +++ b/lib/openssl/ssl.rb @@ -92,7 +92,7 @@ module OpenSSL # The callback must return an OpenSSL::PKey::DH instance of the correct # key length. - attr_writer :tmp_dh_callback + attr_accessor :tmp_dh_callback # call-seq: # SSLContext.new => ctx @@ -125,10 +125,6 @@ module OpenSSL end return params end - - def tmp_dh_callback - @tmp_dh_callback || OpenSSL::PKey::DEFAULT_TMP_DH_CALLBACK - end end module SocketForwarder @@ -290,6 +286,26 @@ module OpenSSL ctx.ciphers = "aNULL" ctx.ciphers.include?(cipher) end + + def client_cert_cb + @context.client_cert_cb + end + + def tmp_dh_callback + @context.tmp_dh_callback || OpenSSL::PKey::DEFAULT_TMP_DH_CALLBACK + end + + def tmp_ecdh_callback + @context.tmp_ecdh_callback + end + + def session_new_cb + @context.session_new_cb + end + + def session_get_cb + @context.session_get_cb + end end ## |