components/ruby/ruby-19/patches/10-dh-keysize-test.patch
author April Chin <april.chin@oracle.com>
Fri, 31 Jul 2015 13:11:47 -0700
changeset 4727 3ef0841967f5
permissions -rw-r--r--
21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4727
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
     1
Test adapted from fix to RubyGems test here:
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
     2
https://github.com/rubygems/rubygems/commit/71a4198783ebe3087f0cae7db8a4db8558e0f042
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
     3
to allow tests to be compatible when run with OpenSSL 1.0.1n+
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
     4
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
     5
--- ruby-1.9.3-p551-orig/test/openssl/test_pair.rb	2015-07-17 14:45:13.130116302 -0700
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
     6
+++ ruby-1.9.3-p551/test/openssl/test_pair.rb	2015-07-17 16:02:16.290182811 -0700
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
     7
@@ -6,7 +6,7 @@ require 'socket'
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
     8
 require_relative '../ruby/ut_eof'
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
     9
 
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    10
 module SSLPair
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    11
-  DHParam = OpenSSL::PKey::DH.new(128)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    12
+  DHParam = OpenSSL::PKey::DH.new(1024)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    13
   def server
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    14
     host = "127.0.0.1"
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    15
     port = 0
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    16
--- ruby-1.9.3-p551-orig/test/openssl/test_pkey_dh.rb	2015-07-17 14:45:13.136074567 -0700
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    17
+++ ruby-1.9.3-p551/test/openssl/test_pkey_dh.rb	2015-07-17 16:02:23.401606363 -0700
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    18
@@ -4,12 +4,12 @@ if defined?(OpenSSL)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    19
 
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    20
 class OpenSSL::TestPKeyDH < Test::Unit::TestCase
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    21
   def test_new
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    22
-    dh = OpenSSL::PKey::DH.new(256)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    23
+    dh = OpenSSL::PKey::DH.new(1024)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    24
     assert_key(dh)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    25
   end
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    26
 
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    27
   def test_to_der
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    28
-    dh = OpenSSL::PKey::DH.new(256)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    29
+    dh = OpenSSL::PKey::DH.new(1024)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    30
     der = dh.to_der
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    31
     dh2 = OpenSSL::PKey::DH.new(der)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    32
     assert_equal_params(dh, dh2)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    33
@@ -17,7 +17,7 @@ class OpenSSL::TestPKeyDH < Test::Unit::
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    34
   end
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    35
 
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    36
   def test_to_pem
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    37
-    dh = OpenSSL::PKey::DH.new(256)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    38
+    dh = OpenSSL::PKey::DH.new(1024)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    39
     pem = dh.to_pem
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    40
     dh2 = OpenSSL::PKey::DH.new(pem)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    41
     assert_equal_params(dh, dh2)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    42
@@ -25,7 +25,7 @@ class OpenSSL::TestPKeyDH < Test::Unit::
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    43
   end
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    44
 
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    45
   def test_public_key
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    46
-    dh = OpenSSL::PKey::DH.new(256)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    47
+    dh = OpenSSL::PKey::DH.new(1024)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    48
     public_key = dh.public_key
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    49
     assert_no_key(public_key) #implies public_key.public? is false!
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    50
     assert_equal(dh.to_der, public_key.to_der)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    51
--- ruby-1.9.3-p551-orig/test/openssl/utils.rb	2015-07-17 14:45:13.142812710 -0700
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    52
+++ ruby-1.9.3-p551/test/openssl/utils.rb	2015-07-17 16:02:26.797918170 -0700
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    53
@@ -238,7 +238,7 @@ aPgwHyJBiK1/ebK3tYcrSKrOoRyrAgEC
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    54
     rescue Errno::EBADF, IOError, Errno::EINVAL, Errno::ECONNABORTED, Errno::ENOTSOCK
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    55
     end
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    56
 
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    57
-    DHParam = OpenSSL::PKey::DH.new(128)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    58
+    DHParam = OpenSSL::PKey::DH.new(1024)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    59
     def start_server(port0, verify_mode, start_immediately, args = {}, &block)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    60
       ctx_proc = args[:ctx_proc]
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    61
       server_proc = args[:server_proc]
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    62
--- ruby-1.9.3-p551-orig/test/rubygems/test_gem_remote_fetcher.rb	2015-07-17 14:46:13.088741047 -0700
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    63
+++ ruby-1.9.3-p551/test/rubygems/test_gem_remote_fetcher.rb	2015-07-17 16:02:31.266871941 -0700
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    64
@@ -853,7 +853,7 @@ gems:
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    65
     end
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    66
 
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    67
     DIR = File.expand_path(File.dirname(__FILE__))
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    68
-    DH_PARAM = OpenSSL::PKey::DH.new(128)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    69
+    DH_PARAM = OpenSSL::PKey::DH.new(1024)
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    70
 
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    71
     def start_ssl_server(config = {})
3ef0841967f5 21466647 Ruby tests should be patched to fix test failures when using upgraded OpenSSL
April Chin <april.chin@oracle.com>
parents:
diff changeset
    72
       null_logger = NilLog.new