Project

General

Profile

Bug #6938 ยป 0001-Use-higher-DH-key-moudlus-to-pass-test-with-FIPS-ena.patch

vo.x (Vit Ondruch), 08/28/2012 01:23 AM

View differences:

test/openssl/test_pair.rb
6 6
require_relative '../ruby/ut_eof'
7 7

  
8 8
module SSLPair
9
  DHParam = OpenSSL::PKey::DH.new(128)
10 9
  def server
11 10
    host = "127.0.0.1"
12 11
    port = 0
test/openssl/test_pkey_dh.rb
4 4

  
5 5
class OpenSSL::TestPKeyDH < Test::Unit::TestCase
6 6
  def test_new
7
    dh = OpenSSL::PKey::DH.new(256)
7
    dh = OpenSSL::PKey::DH.new(1024)
8 8
    assert_key(dh)
9 9
  end
10 10

  
11 11
  def test_new_break
12
    assert_nil(OpenSSL::PKey::DH.new(256) { break })
12
    assert_nil(OpenSSL::PKey::DH.new(1024) { break })
13 13
    assert_raises(RuntimeError) do
14
      OpenSSL::PKey::DH.new(256) { raise }
14
      OpenSSL::PKey::DH.new(1024) { raise }
15 15
    end
16 16
  end
17 17

  
18 18
  def test_to_der
19
    dh = OpenSSL::PKey::DH.new(256)
19
    dh = DHParam
20 20
    der = dh.to_der
21 21
    dh2 = OpenSSL::PKey::DH.new(der)
22 22
    assert_equal_params(dh, dh2)
......
24 24
  end
25 25

  
26 26
  def test_to_pem
27
    dh = OpenSSL::PKey::DH.new(256)
27
    dh = DHParam
28 28
    pem = dh.to_pem
29 29
    dh2 = OpenSSL::PKey::DH.new(pem)
30 30
    assert_equal_params(dh, dh2)
......
32 32
  end
33 33

  
34 34
  def test_public_key
35
    dh = OpenSSL::PKey::DH.new(256)
35
    dh = DHParam
36 36
    public_key = dh.public_key
37 37
    assert_no_key(public_key) #implies public_key.public? is false!
38 38
    assert_equal(dh.to_der, public_key.to_der)
test/openssl/utils.rb
238 238
    rescue Errno::EBADF, IOError, Errno::EINVAL, Errno::ECONNABORTED, Errno::ENOTSOCK, Errno::ECONNRESET
239 239
    end
240 240

  
241
    DHParam = OpenSSL::PKey::DH.new(128)
241
    DHParam = OpenSSL::PKey::DH.new(1024)
242 242
    def start_server(port0, verify_mode, start_immediately, args = {}, &block)
243 243
      ctx_proc = args[:ctx_proc]
244 244
      server_proc = args[:server_proc]
245
-