File tree 1 file changed +11
-16
lines changed
1 file changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -18,25 +18,20 @@ def test_new_generate
18
18
assert_key ( dh )
19
19
end if ENV [ "OSSL_TEST_ALL" ]
20
20
21
- def test_new_break_on_non_fips
22
- omit_on_fips if !aws_lc?
23
-
24
- assert_nil ( OpenSSL ::PKey ::DH . new ( NEW_KEYLEN ) { break } )
25
- assert_raise ( RuntimeError ) do
26
- OpenSSL ::PKey ::DH . new ( NEW_KEYLEN ) { raise }
21
+ def test_new_break
22
+ unless openssl? && OpenSSL . fips_mode
23
+ assert_nil ( OpenSSL ::PKey ::DH . new ( NEW_KEYLEN ) { break } )
24
+ assert_raise ( RuntimeError ) do
25
+ OpenSSL ::PKey ::DH . new ( NEW_KEYLEN ) { raise }
26
+ end
27
+ else
28
+ # The block argument is not executed in FIPS case.
29
+ # See https://github.com/ruby/openssl/issues/692 for details.
30
+ assert ( OpenSSL ::PKey ::DH . new ( NEW_KEYLEN ) { break } )
31
+ assert ( OpenSSL ::PKey ::DH . new ( NEW_KEYLEN ) { raise } )
27
32
end
28
33
end
29
34
30
- def test_new_break_on_fips
31
- omit_on_non_fips
32
- return unless openssl? # This behavior only applies to OpenSSL.
33
-
34
- # The block argument is not executed in FIPS case.
35
- # See https://github.com/ruby/openssl/issues/692 for details.
36
- assert ( OpenSSL ::PKey ::DH . new ( NEW_KEYLEN ) { break } )
37
- assert ( OpenSSL ::PKey ::DH . new ( NEW_KEYLEN ) { raise } )
38
- end
39
-
40
35
def test_derive_key
41
36
params = Fixtures . pkey ( "dh2048_ffdhe2048" )
42
37
dh1 = OpenSSL ::PKey . generate_key ( params )
You can’t perform that action at this time.
0 commit comments