Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenSSL::PKey.read that cannot parse PKey in the FIPS mode. #615

Merged
merged 3 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
CI: Add the test/openssl/test_pkey.rb on the FIPS mode case.
It's to test the `OpenSSL::PKey.read` in the `test/openssl/test_pkey.rb`.

I added the pending status to the following tests failing on the FIPS mode
case in the `test/openssl/test_pkey.rb`.

* `test_ed25519`
* `test_x25519`
* `test_compare?`
  • Loading branch information
junaruga committed Jun 1, 2023
commit 8149cdf6e874214f9349f1f236b003d9239228f9
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 149,7 @@ jobs:
# Run only the passing tests on the FIPS mode as a temporary workaround.
# TODO Fix other tests, and run all the tests on FIPS mode.
- name: test on fips mode
run: ruby -Ilib test/openssl/test_fips.rb
run: |
ruby -I./lib -ropenssl \
-e 'Dir.glob "./test/openssl/{test_fips.rb,test_pkey.rb}", &method(:require)'
if: matrix.fips_enabled
7 changes: 7 additions & 0 deletions test/openssl/test_pkey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 82,9 @@ def test_hmac_sign_verify
end

def test_ed25519
# https://github.com/openssl/openssl/issues/20758
pend('Not supported on FIPS mode enabled') if OpenSSL.fips_mode

# Test vector from RFC 8032 Section 7.1 TEST 2
priv_pem = <<~EOF
-----BEGIN PRIVATE KEY-----
Expand Down Expand Up @@ -127,6 130,8 @@ def test_ed25519
end

def test_x25519
pend('Not supported on FIPS mode enabled') if OpenSSL.fips_mode

# Test vector from RFC 7748 Section 6.1
alice_pem = <<~EOF
-----BEGIN PRIVATE KEY-----
Expand All @@ -153,6 158,8 @@ def test_x25519
end

def test_compare?
pend('Not supported on FIPS mode enabled') if OpenSSL.fips_mode

key1 = Fixtures.pkey("rsa1024")
key2 = Fixtures.pkey("rsa1024")
key3 = Fixtures.pkey("rsa2048")
Expand Down