Bug #6938 ยป 0001-Use-higher-DH-key-moudlus-to-pass-test-with-FIPS-ena.patch
test/openssl/test_pair.rb | ||
---|---|---|
require_relative '../ruby/ut_eof'
|
||
module SSLPair
|
||
DHParam = OpenSSL::PKey::DH.new(128)
|
||
def server
|
||
host = "127.0.0.1"
|
||
port = 0
|
test/openssl/test_pkey_dh.rb | ||
---|---|---|
class OpenSSL::TestPKeyDH < Test::Unit::TestCase
|
||
def test_new
|
||
dh = OpenSSL::PKey::DH.new(256)
|
||
dh = OpenSSL::PKey::DH.new(1024)
|
||
assert_key(dh)
|
||
end
|
||
def test_new_break
|
||
assert_nil(OpenSSL::PKey::DH.new(256) { break })
|
||
assert_nil(OpenSSL::PKey::DH.new(1024) { break })
|
||
assert_raises(RuntimeError) do
|
||
OpenSSL::PKey::DH.new(256) { raise }
|
||
OpenSSL::PKey::DH.new(1024) { raise }
|
||
end
|
||
end
|
||
def test_to_der
|
||
dh = OpenSSL::PKey::DH.new(256)
|
||
dh = DHParam
|
||
der = dh.to_der
|
||
dh2 = OpenSSL::PKey::DH.new(der)
|
||
assert_equal_params(dh, dh2)
|
||
... | ... | |
end
|
||
def test_to_pem
|
||
dh = OpenSSL::PKey::DH.new(256)
|
||
dh = DHParam
|
||
pem = dh.to_pem
|
||
dh2 = OpenSSL::PKey::DH.new(pem)
|
||
assert_equal_params(dh, dh2)
|
||
... | ... | |
end
|
||
def test_public_key
|
||
dh = OpenSSL::PKey::DH.new(256)
|
||
dh = DHParam
|
||
public_key = dh.public_key
|
||
assert_no_key(public_key) #implies public_key.public? is false!
|
||
assert_equal(dh.to_der, public_key.to_der)
|
test/openssl/utils.rb | ||
---|---|---|
rescue Errno::EBADF, IOError, Errno::EINVAL, Errno::ECONNABORTED, Errno::ENOTSOCK, Errno::ECONNRESET
|
||
end
|
||
DHParam = OpenSSL::PKey::DH.new(128)
|
||
DHParam = OpenSSL::PKey::DH.new(1024)
|
||
def start_server(port0, verify_mode, start_immediately, args = {}, &block)
|
||
ctx_proc = args[:ctx_proc]
|
||
server_proc = args[:server_proc]
|