Skip to content

Commit ac3559e

Browse files
committed
Fix test_ssl.rb in FIPS.
test_post_connect_check_with_anon_ciphers: test_tmp_dh_callback: test_tmp_dh: DH missing the q value on unknown named parameters (ciphers) is not FIPS-approved, according to the FIPS-186-4 APPENDIX B: Key Pair Generation - B.1.1 Key Pair Generation Using Extra Random Bits, the inputs p, q, and g are required. However, TLS doesn't send q. https://csrc.nist.gov/pubs/fips/186-4/final OpenSSL has a special workaround to recover the missing "q" value for known named parameters, which is the reason why other tests that use the default parameters in `lib/openssl/ssl.rb` are working. Note that the test_post_connect_check_with_anon_ciphers test got the following error on `OpenSSL.debug = true` in FIPS. ``` /home/jaruga/var/git/ruby/openssl/lib/openssl/ssl.rb:551: warning: error on stack: error:0A0C0103:SSL routines:tls_construct_server_key_exchange:internal error ``` test_get_ephemeral_key: kRSA (PKCS1-v1_5 padding) is not allowed in FIPS according to the NIST SP 800-131A Rev. 2 - 6 Key Agreement and Key Transport Using RSA - Table 5: Approval Status for the RSA-based Key Agreement and Key Transport Schemes - PKCS1-v1_5 padding - Disallowed after 2023 https://csrc.nist.gov/pubs/sp/800/131/a/r2/final Note that the test_get_ephemeral_key test got the following error on `OpenSSL.debug = true` in FIPS. ``` test/openssl/test_ssl.rb:2326: warning: error on stack: error:1C8000A8:Provider routines:rsa_encrypt:invalid padding mode ```
1 parent cfa82ab commit ac3559e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Rake::TestTask.new(:test_fips_internal) do |t|
3434
'test/openssl/test_ns_spki.rb',
3535
'test/openssl/test_ocsp.rb',
3636
'test/openssl/test_pkcs12.rb',
37-
'test/openssl/test_ssl.rb',
3837
'test/openssl/test_ts.rb',
3938
'test/openssl/test_x509cert.rb',
4039
'test/openssl/test_x509crl.rb',

test/openssl/test_ssl.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,8 @@ def test_sslctx_set_params
685685
end
686686

687687
def test_post_connect_check_with_anon_ciphers
688+
# DH missing the q value on unknown named parameters is not FIPS-approved.
689+
omit_on_fips
688690
omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
689691

690692
ctx_proc = -> ctx {
@@ -1747,6 +1749,9 @@ def test_sync_close_without_connect
17471749
end
17481750

17491751
def test_get_ephemeral_key
1752+
# kRSA is not FIPS-approved.
1753+
omit_on_fips
1754+
17501755
# kRSA
17511756
ctx_proc1 = proc { |ctx|
17521757
ctx.max_version = OpenSSL::SSL::TLS1_2_VERSION
@@ -1863,6 +1868,8 @@ def test_fallback_scsv
18631868
end
18641869

18651870
def test_tmp_dh_callback
1871+
# DH missing the q value on unknown named parameters is not FIPS-approved.
1872+
omit_on_fips
18661873
omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
18671874

18681875
dh = Fixtures.pkey("dh-1")
@@ -2131,6 +2138,8 @@ def test_connect_works_when_setting_dh_callback_to_nil
21312138
end
21322139

21332140
def test_tmp_dh
2141+
# DH missing the q value on unknown named parameters is not FIPS-approved.
2142+
omit_on_fips
21342143
omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
21352144

21362145
dh = Fixtures.pkey("dh-1")

0 commit comments

Comments
 (0)