aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorrhe <rhe@ruby-lang.org>2016-06-09 10:46:46 +0000
committerKazuki Yamaguchi <k@rhe.jp>2016-06-19 23:25:32 +0900
commit20ee8b61ad9d8f3920623d3ce0d1bccce7ddaa92 (patch)
tree54d15db8d10cf29c3f89d7524456fd315577fc2e /test
parent3b8046d83ce3271d20c182054e44caf9270d4429 (diff)
downloadruby-openssl-20ee8b61ad9d8f3920623d3ce0d1bccce7ddaa92.tar.gz
openssl: fix build with OPENSSL_NO_EC
* ext/openssl/ossl_ssl.c: Add define guards for OPENSSL_NO_EC. SSL_CTX_set_ecdh_auto() is defined even when ECDH is disabled in OpenSSL's configuration. This fixes r55214. * test/openssl/test_pair.rb (test_ecdh_curves): Skip if the OpenSSL does not support ECDH. * test/openssl/utils.rb (start_server): Ignore error in SSLContext#ecdh_curves=. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/test_pair.rb7
-rw-r--r--test/utils.rb5
2 files changed, 10 insertions, 2 deletions
diff --git a/test/test_pair.rb b/test/test_pair.rb
index 88e52a71..3895a944 100644
--- a/test/test_pair.rb
+++ b/test/test_pair.rb
@@ -433,7 +433,12 @@ module OpenSSL::TestPairM
sock1, sock2 = tcp_pair
ctx1 = OpenSSL::SSL::SSLContext.new
- ctx1.ciphers = "ECDH"
+ begin
+ ctx1.ciphers = "ECDH"
+ rescue OpenSSL::SSL::SSLError
+ skip "ECDH is not enabled in this OpenSSL" if $!.message =~ /no cipher match/
+ raise
+ end
ctx1.ecdh_curves = "P-384:P-521"
ctx1.security_level = 0
s1 = OpenSSL::SSL::SSLSocket.new(sock1, ctx1)
diff --git a/test/utils.rb b/test/utils.rb
index 88a02391..5cd772e7 100644
--- a/test/utils.rb
+++ b/test/utils.rb
@@ -299,7 +299,10 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
ctx.cert = @svr_cert
ctx.key = @svr_key
ctx.tmp_dh_callback = proc { OpenSSL::TestUtils::TEST_KEY_DH1024 }
- ctx.ecdh_curves = "P-256"
+ begin
+ ctx.ecdh_curves = "P-256"
+ rescue NotImplementedError
+ end
ctx.verify_mode = verify_mode
ctx_proc.call(ctx) if ctx_proc