[ruby/openssl] pkey: skip tests using invalid keys in the FIPS mode
Some checks failed
parse.y / make (check) (push) Failing after 55s
Windows / Windows 11-arm/Visual C++ (btest test-basic test-tool) (push) Waiting to run
Windows / Windows 2022/Visual C++ 2022 (check) (push) Waiting to run
Windows / Windows 2025/Visual C++ 2022 (check) (push) Waiting to run
Windows / Windows 2025/Visual C++ 2022 (test-bundled-gems) (push) Waiting to run
Windows / result (push) Blocked by required conditions
Ubuntu on WSL / wsl (push) Waiting to run
Annocheck / test-annocheck (push) Failing after 56s
Check Dependencies / Dependency checks (push) Failing after 59s
Update default gems list / Update default gems list (push) Has been skipped
CodeQL / Analyze (push) Failing after 55s
Cygwin / make (push) Waiting to run
MinGW / (UCRT64) (push) Waiting to run
BASERUBY Check / BASERUBY (push) Failing after 52s
Misc / Miscellaneous checks (push) Failing after 1m1s
bundled_gems / update (push) Failing after 1m52s
Compilations / omnibus compilations, trigger (push) Failing after 52s
Compilations / omnibus compilations, #4 (push) Has been skipped
Compilations / omnibus compilations, #5 (push) Has been skipped
Compilations / omnibus compilations, #6 (push) Has been skipped
Compilations / omnibus compilations, #7 (push) Has been skipped
parse.y / make (test-bundled-gems) (push) Failing after 55s
WebAssembly / make (map[debugflags: name:O2 optflags:-O2 wasmoptflags:-O2]) (push) Failing after 55s
parse.y / make (test-bundler-parallel) (push) Failing after 56s
Compilations / omnibus compilations, #1 (push) Has been skipped
Compilations / omnibus compilations, #2 (push) Has been skipped
Compilations / omnibus compilations, #3 (push) Has been skipped
Compilations / omnibus compilations, #12 (push) Has been skipped
Compilations / omnibus compilations, #8 (push) Has been skipped
Compilations / omnibus compilations, #9 (push) Has been skipped
Compilations / omnibus compilations, #10 (push) Has been skipped
Compilations / omnibus compilations, #11 (push) Has been skipped
Compilations / omnibus compilations, result (push) Successful in 1m7s

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 https://github.com/ruby/openssl/issues/926

25ad8f4bdb
This commit is contained in:
Kazuki Yamaguchi 2025-08-13 02:36:02 +09:00 committed by git
parent 4cf05ea77a
commit 507b1e4bde
2 changed files with 4 additions and 0 deletions

View file

@ -103,6 +103,8 @@ class OpenSSL::TestPKeyDH < OpenSSL::PKeyTestCase
end if !openssl?(3, 0, 0) end if !openssl?(3, 0, 0)
def test_params_ok? def test_params_ok?
omit_on_fips
# Skip the tests in old OpenSSL version 1.1.1c or early versions before # Skip the tests in old OpenSSL version 1.1.1c or early versions before
# applying the following commits in OpenSSL 1.1.1d to make `DH_check` # applying the following commits in OpenSSL 1.1.1d to make `DH_check`
# function pass the RFC 7919 FFDHE group texts. # function pass the RFC 7919 FFDHE group texts.

View file

@ -72,6 +72,8 @@ class OpenSSL::TestEC < OpenSSL::PKeyTestCase
end end
def test_check_key def test_check_key
omit_on_fips
key0 = Fixtures.pkey("p256") key0 = Fixtures.pkey("p256")
assert_equal(true, key0.check_key) assert_equal(true, key0.check_key)
assert_equal(true, key0.private?) assert_equal(true, key0.private?)