ruby-changes:39561
From: tenderlove <ko1@a...>
Date: Thu, 20 Aug 2015 00:00:19 +0900 (JST)
Subject: [ruby-changes:39561] tenderlove:r51642 (trunk): * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add OP_ALL to
tenderlove 2015-08-19 23:59:58 +0900 (Wed, 19 Aug 2015) New Revision: 51642 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51642 Log: * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add OP_ALL to existing options rather than just setting it. Some vendors apply custom patches to their versions of OpenSSL that set default values for options. This commit respects the custom patches they've applied. * test/openssl/test_ssl.rb (class OpenSSL): check that OP_ALL has been added to the options. Modified files: trunk/ChangeLog trunk/ext/openssl/lib/openssl/ssl.rb trunk/test/openssl/test_ssl.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 51641) +++ ChangeLog (revision 51642) @@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Aug 19 23:59:28 2015 Aaron Patterson <tenderlove@r...> + + * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add OP_ALL to + existing options rather than just setting it. Some vendors apply + custom patches to their versions of OpenSSL that set default values + for options. This commit respects the custom patches they've + applied. + + * test/openssl/test_ssl.rb (class OpenSSL): check that OP_ALL has been + added to the options. + Wed Aug 19 23:55:29 2015 Nobuyoshi Nakada <nobu@r...> * process.c (rb_f_spawn): [DOC] elaborate environment variable Index: ext/openssl/lib/openssl/ssl.rb =================================================================== --- ext/openssl/lib/openssl/ssl.rb (revision 51641) +++ ext/openssl/lib/openssl/ssl.rb (revision 51642) @@ -111,7 +111,7 @@ module OpenSSL https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/ssl.rb#L111 # You can get a list of valid methods with OpenSSL::SSL::SSLContext::METHODS def initialize(version = nil) INIT_VARS.each { |v| instance_variable_set v, nil } - self.options = OpenSSL::SSL::OP_ALL + self.options = self.options | OpenSSL::SSL::OP_ALL return unless version self.ssl_version = version end Index: test/openssl/test_ssl.rb =================================================================== --- test/openssl/test_ssl.rb (revision 51641) +++ test/openssl/test_ssl.rb (revision 51642) @@ -20,9 +20,9 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L20 } end - def test_options_defaults_to_OP_ALL + def test_options_defaults_to_OP_ALL_on ctx = OpenSSL::SSL::SSLContext.new - assert_equal OpenSSL::SSL::OP_ALL, ctx.options + assert_equal(OpenSSL::SSL::OP_ALL, (OpenSSL::SSL::OP_ALL & ctx.options)) end def test_setting_twice -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/