Skip to content

Commit 25ad8f4

Browse files
committed
pkey: skip tests using invalid keys in the FIPS mode
In OpenSSL's master branch, importing/loading a key in the FIPS mode automatically performs a pair-wise consistency check. This breaks tests for OpenSSL::PKey::EC#check_key and DH#params_ok? as they use deliberately invalid keys. These methods would not be useful in the FIPS mode anyway. Fixes #926
1 parent dfbbac6 commit 25ad8f4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test/openssl/test_pkey_dh.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ def test_generate_key
103103
end if !openssl?(3, 0, 0)
104104

105105
def test_params_ok?
106+
omit_on_fips
107+
106108
# Skip the tests in old OpenSSL version 1.1.1c or early versions before
107109
# applying the following commits in OpenSSL 1.1.1d to make `DH_check`
108110
# function pass the RFC 7919 FFDHE group texts.

test/openssl/test_pkey_ec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def test_marshal
7272
end
7373

7474
def test_check_key
75+
omit_on_fips
76+
7577
key0 = Fixtures.pkey("p256")
7678
assert_equal(true, key0.check_key)
7779
assert_equal(true, key0.private?)

0 commit comments

Comments
 (0)