[ruby/openssl] test_pkey_dh.rb: Merge 2 test_new_break tests to one test.
Merge 2 test_new_break tests to one test because it's easy to maintain the test. https://github.com/ruby/openssl/commit/446ff3e11f
This commit is contained in:
parent
12e2dfdc56
commit
9ccba88160
@ -18,24 +18,19 @@ class OpenSSL::TestPKeyDH < OpenSSL::PKeyTestCase
|
|||||||
assert_key(dh)
|
assert_key(dh)
|
||||||
end if ENV["OSSL_TEST_ALL"]
|
end if ENV["OSSL_TEST_ALL"]
|
||||||
|
|
||||||
def test_new_break_on_non_fips
|
def test_new_break
|
||||||
omit_on_fips if !aws_lc?
|
unless openssl? && OpenSSL.fips_mode
|
||||||
|
|
||||||
assert_nil(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
|
assert_nil(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
|
||||||
assert_raise(RuntimeError) do
|
assert_raise(RuntimeError) do
|
||||||
OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise }
|
OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise }
|
||||||
end
|
end
|
||||||
end
|
else
|
||||||
|
|
||||||
def test_new_break_on_fips
|
|
||||||
omit_on_non_fips
|
|
||||||
return unless openssl? # This behavior only applies to OpenSSL.
|
|
||||||
|
|
||||||
# The block argument is not executed in FIPS case.
|
# The block argument is not executed in FIPS case.
|
||||||
# See https://github.com/ruby/openssl/issues/692 for details.
|
# See https://github.com/ruby/openssl/issues/692 for details.
|
||||||
assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
|
assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
|
||||||
assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise })
|
assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise })
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_derive_key
|
def test_derive_key
|
||||||
params = Fixtures.pkey("dh2048_ffdhe2048")
|
params = Fixtures.pkey("dh2048_ffdhe2048")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user