Skip to content

Commit

Permalink
CI: Add the test/openssl/test_pkey.rb on the FIPS mode case.
Browse files Browse the repository at this point in the history
It's to test the `OpenSSL::PKey.read` in the `test/openssl/test_pkey.rb` except
the `test_ed25519`, `test_x25519` and `test_compare?` on the FIPS mode case.

I added the pending status to these 3 tests above coming from other issues on
the FIPS mode.
  • Loading branch information
junaruga committed Apr 17, 2023
1 parent cdeda46 commit 9526934
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,12 @@ jobs:
- name: test
run: rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1
timeout-minutes: 5
if: ${{ !matrix.fips_enabled }}

# 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 && \
ruby -Ilib test/openssl/test_pkey.rb
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

0 comments on commit 9526934

Please sign in to comment.