Skip to content

Commit 9526934

Browse files
committed
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` 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.
1 parent cdeda46 commit 9526934

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,12 @@ jobs:
135135
- name: test
136136
run: rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1
137137
timeout-minutes: 5
138+
if: ${{ !matrix.fips_enabled }}
139+
140+
# Run only the passing tests on the FIPS mode as a temporary workaround.
141+
# TODO Fix other tests, and run all the tests on FIPS mode.
142+
- name: test on fips mode
143+
run: |
144+
ruby -Ilib test/openssl/test_fips.rb && \
145+
ruby -Ilib test/openssl/test_pkey.rb
146+
if: matrix.fips_enabled

test/openssl/test_pkey.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ def test_hmac_sign_verify
8282
end
8383

8484
def test_ed25519
85+
# https://github.com/openssl/openssl/issues/20758
86+
pend('Not supported on FIPS mode enabled') if OpenSSL.fips_mode
87+
8588
# Test vector from RFC 8032 Section 7.1 TEST 2
8689
priv_pem = <<~EOF
8790
-----BEGIN PRIVATE KEY-----
@@ -127,6 +130,8 @@ def test_ed25519
127130
end
128131

129132
def test_x25519
133+
pend('Not supported on FIPS mode enabled') if OpenSSL.fips_mode
134+
130135
# Test vector from RFC 7748 Section 6.1
131136
alice_pem = <<~EOF
132137
-----BEGIN PRIVATE KEY-----
@@ -153,6 +158,8 @@ def test_x25519
153158
end
154159

155160
def test_compare?
161+
pend('Not supported on FIPS mode enabled') if OpenSSL.fips_mode
162+
156163
key1 = Fixtures.pkey("rsa1024")
157164
key2 = Fixtures.pkey("rsa1024")
158165
key3 = Fixtures.pkey("rsa2048")

0 commit comments

Comments
 (0)