summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_ssl_session.c
AgeCommit message (Collapse)Author
2016-06-05openssl: adapt to OpenSSL 1.1.0 opaque structsrhe
* ext/openssl/extconf.rb: Check existence of accessor functions that don't exist in OpenSSL 0.9.8. OpenSSL 1.1.0 made most of its structures opaque and requires use of these accessor functions. [ruby-core:75225] [Feature #12324] * ext/openssl/openssl_missing.[ch]: Implement them if missing. * ext/openssl/ossl*.c: Use these accessor functions. * test/openssl/test_hmac.rb: Add missing test for HMAC#reset. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-28openssl: move SSLSocket#initialize to C extensionrhe
* ext/openssl/lib/openssl/ssl.rb (SSLSocket): Move the implementation of SSLSocket#initialize to C. Initialize the SSL (OpenSSL object) in it. Currently this is delayed until ossl_ssl_setup(), which is called from SSLSocket#accept or #connect. Say we call SSLSocket#hostname= with an illegal value. We expect an exception to be raised in #hostname= but actually we get it in the later SSLSocket#connect. Because the SSL is not ready at #hostname=, the actual call of SSL_set_tlsext_host_name() is also delayed. This also fixes: [ruby-dev:49376] [Bug #11724] * ext/openssl/ossl_ssl.c (ossl_ssl_initialize): Added. Almost the same as the Ruby version but this instantiate the SSL object at the same time. (ossl_ssl_setup): Adjust to the changes. Just set the underlying IO to the SSL. (ssl_started): Added. Make use of SSL_get_fd(). This returns -1 if not yet set by SSL_set_fd(). (ossl_ssl_data_get_struct): Removed. Now GetSSL() checks that the SSL exists. (ossl_ssl_set_session): Don't call ossl_ssl_setup() here as now the SSL is already instantiated in #initialize. (ossl_ssl_shutdown, ossl_start_ssl, ossl_ssl_read_internal, ossl_ssl_write_internal, ossl_ssl_stop, ossl_ssl_get_cert, ossl_ssl_get_peer_cert, ossl_ssl_get_peer_cert_chain, ossl_ssl_get_version, ossl_ssl_get_cipher, ossl_ssl_get_state, ossl_ssl_pending, ossl_ssl_session_reused, ossl_ssl_get_verify_result, ossl_ssl_get_client_ca_list, ossl_ssl_npn_protocol, ossl_ssl_alpn_protocol, ossl_ssl_tmp_key): Use GetSSL() instead of ossl_ssl_data_get_struct(). Use ssl_started(). (Init_ossl_ssl): Add method declarations of SSLSocket#{initialize, hostname=}. * ext/openssl/ossl_ssl.h (GetSSL): Check that the SSL is not NULL. It should not be NULL because we now set it in #initialize. * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_initialize): No need to check if the SSL is NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-25openssl: drop OpenSSL 0.9.6/0.9.7 supportrhe
* ext/openssl, test/openssl: Drop OpenSSL < 0.9.8 support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-03* ext/openssl/ossl.h: avoid to build failure of Windows environment.hsbt
* ext/openssl/ossl_ssl_session.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-03* ext/openssl/ossl.h: Make `SSL_SESSION_cmp` use `CRYPTO_memcmp`hsbt
[fix GH-591] Patch by @PiPeep * ext/openssl/ossl_ssl_session.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-12ossl_ssl_session.c: typed datanobu
* ext/openssl/ossl_ssl_session.c (ossl_ssl_session_type): use typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-12ossl_ssl.h: accessor macrosnobu
* ext/openssl/ossl_ssl.c (GetSSLCTX): accessor macro. * ext/openssl/ossl_ssl.h (GetSSL): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-23* ext/openssl/ossl_ssl_session.c (ossl_ssl_session_set_time): Check nahi
argument type with NUM2LONG if the arg is not a Time object. See #4919. * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_set_timeout): Check type with NUM2LONG. Time as an arg is not allowed. See #4919. * test/openssl/test_ssl_session.rb (test_session_time, test_session_timeout): Test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-22* ext/openssl/ossl_ssl_session.c: Respect T_BIGNUM time values. Patch byemboss
Tomoyuki Chikanaga. [ Ruby 1.9 - Bug #4919 ] [ruby-dev:43869] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-22* ext/openssl/ossl.h: Introduced OSSL_BIO_reset macro for PEM/DERemboss
fallback scenarios. * ext/openssl/ossl_pkey_dsa.c * ext/openssl/ossl_x509req.c * ext/openssl/ossl_pkey_rsa.c * ext/openssl/ossl_pkey_ec.c * ext/openssl/ossl_ssl_session.c * ext/openssl/ossl_x509crl.c * ext/openssl/ossl_pkey.c * ext/openssl/ossl_pkey_dh.c * ext/openssl/ossl_x509cert.c * ext/openssl/ossl_pkcs7.c: Use OSSL_BIO_reset. * ext/openssl/ossl_ssl.c * ext/openssl/ossl_cipher.c * ext/openssl/ossl_pkey_ec.c * ext/openssl/ossl_pkcs12.c * ext/openssl/ossl_ssl_session.c: Replace rb_raise occurences by ossl_raise. This automatically flushes OpenSSL's error queue. * ext/openssl/ossl_pkcs7.c: Raise error if DER fallback for parsing fails. * test/openssl/test_pkey_ec.rb * test/openssl/test_pkey_dsa.rb * test/openssl/test_pkey_rsa.rb: Add assertions that OpenSSL.errors is empty. * test/openssl/test_pkey_rsa.rb: Remove initial OpenSSL.errors call in test_new. [ Ruby 1.9 - Bug #4885 ] [ruby-core:37134] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-22* ext/openssl/ossl_ssl_session.c (ossl_ssl_session_to_der):nahi
OpenSSL::SSL::Session#to_der was broken. Fix buffer handling. * test/openssl/test_ssl_session.rb (test_session): Test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-11* ext/openssl/ossl_ssl_session.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-06Add toplevel documentation for OpenSSLdrbrain
Add additional documentation for OpenSSL::SSL::SSLContext and OpenSSL::SSL::SSLSocket. Move "let rdoc know about mOSSL" comments so they don't show up in output. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-26* ext/openssl/ossl_hmac.c (ossl_hmac_hexdigest, ossl_hmac_s_hexdigest),wanabe
ext/openssl/ossl_pkey_ec.c (ossl_ec_group_set_seed), ext/openssl/ossl_ssl_session.c (ossl_ssl_session_to_der), ext/openssl/ossl_pkcs7.c (numberof): suppress warnings. [ruby-core:31932] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-23* ext/openssl/ossl_ssl_session.c (SSL_SESSION_cmp): remove static forusa
loopy version of openssl (0.9.8l?). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-23* ext/openssl/ossl_config.c: OpenSSL 1.0.0 support.usa
* ext/openssl/extconf.rb: check some functions added/removed at OpenSSL 1.0.0. * ext/openssl/ossl_engine.c (ossl_engine_s_load): use engines which exists. * ext/openssl/ossl_ssl_session (SSL_SESSION_cmp): removed at 1.0.0, so implement compatible fuction here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22* ext/**/*.[ch]: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-13* ext/openssl/openssl_missing.h (i2d_of_void): cast for callbacks.nobu
[ruby-core:22860] * ext/openssl/ossl_engine.c (ossl_engine_s_by_id): suppress a warning. * ext/openssl/ossl_ssl.c (ossl_sslctx_flush_sessions): time_t may be larger than long. * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_get_time), (ossl_ssl_session_get_timeout): use TIMET2NUM() to convert time_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22* ext/openssl: suppress warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-05* ext/openssl/ossl_ssl_session.c (ossl_ssl_session_initialize):knu
Add a null check for ssl; submitted by akira yamada in [ruby-dev:34950]. * ext/openssl/ossl_ssl.c (Init_ossl_ssl): Define OP_NO_TICKET if SSL_OP_NO_TICKET is present; submitted by akira yamada in [ruby-dev:34944]. * test/openssl/test_ssl.rb (OpenSSL#test_server_session): Add a workaround for the case where OpenSSL is configured with --enable-tlsext; submitted by akira yamada in [ruby-dev:34944]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-26* ext/openssl/ossl_{ec,dh,dsa,rsa}.c: Remove useless warnings.technorama
* ext/openssl/ossl_asn1.c: Simplify code. * ext/openssl/ossl_ssl_session.c Fix compiler warnings. Undefine #id if SSL_SESSION_get_id is not supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-18* ext/openssl/{extconf.rb,ossl_ssl_session.c}:technorama
Fix ruby-Bugs-11513. * ext/openssl/ossl_pkey_ec.c New methods EC::Point.[eql,make_affine!,invert!,on_curve?,infinity?] By default output the same key form as the openssl command. * ext/openssl/ossl_rand.c New method Random.status? * test/openssl/test_ec.rb New tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-05 * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_alloc): shouldusa
return value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-02* ext/openssl/ossl_{ssl.[ch],ssl_session.c}},technorama
ext/openssl/lib/openssl/lib/openssl/ssl.rb: New SSL::Session class. Add session cb's, getter/setters, config, and statistics methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e