An interpreter of object-oriented scripting language
Go to file
Jun Aruga e0deda71a3 ssl: use ffdhe2048 from RFC 7919 as the default DH group parameter
This commit fixes the following failures in OpenSSL FIPS using the
`OPENSSL_FORCE_FIPS_MODE=1` in CentOS stream 9 non-FIPS OS environment.

```
$ cat /etc/redhat-release
CentOS Stream release 9

$ rpm -q openssl
openssl-3.0.7-24.el9.x86_64

$ pwd
/builddir/build/BUILD/ruby-3.1.2

$ make runruby 'TESTRUN_SCRIPT= \
   -I/builddir/build/BUILD/ruby-3.1.2/tool/lib --enable-gems \
   /builddir/build/SOURCES/test_openssl_fips.rb /builddir/build/BUILD/ruby-3.1.2 --verbose'
...
  1) Failure:
OpenSSL::TestFIPS#test_fips_mode_get_with_fips_mode_set [/builddir/build/BUILD/ruby-3.1.2/test/openssl/test_fips.rb:38]:
assert_separately failed with error message
pid 2043890 exit 1
| /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/pkey.rb:132:in `initialize': could not parse pkey (OpenSSL::PKey::DHError)
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/pkey.rb:132:in `new'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/pkey.rb:132:in `new'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/ssl.rb:34:in `<class:SSLContext>'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/ssl.rb:20:in `<module:SSL>'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/ssl.rb:19:in `<module:OpenSSL>'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/ssl.rb:18:in `<top (required)>'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl.rb:21:in `require_relative'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl.rb:21:in `<top (required)>'
| 	from -:in `require'
  2) Failure:
OpenSSL::TestFIPS#test_fips_mode_get_is_true_on_fips_mode_enabled [/builddir/build/BUILD/ruby-3.1.2/test/openssl/test_fips.rb:12]:
assert_separately failed with error message
pid 2043891 exit 1
| /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/pkey.rb:132:in `initialize': could not parse pkey (OpenSSL::PKey::DHError)
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/pkey.rb:132:in `new'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/pkey.rb:132:in `new'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/ssl.rb:34:in `<class:SSLContext>'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/ssl.rb:20:in `<module:SSL>'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/ssl.rb:19:in `<module:OpenSSL>'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl/ssl.rb:18:in `<top (required)>'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl.rb:21:in `require_relative'
| 	from /builddir/build/BUILD/ruby-3.1.2/.ext/common/openssl.rb:21:in `<top (required)>'
| 	from -:in `require'

Finished tests in 0.154373s, 77.7337 tests/s, 369.2351 assertions/s.
12 tests, 57 assertions, 2 failures, 0 errors, 1 skips

ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
make: *** [uncommon.mk:1249: runruby] Error 2
```

Note that we obverved the issue in RHEL 9.4 Beta non-FIPS OS environment too.
The error happened by applying the patch
ruby-3.3.0-openssl-3.2.0-fips-fix-pkey-read-in-openssl-3.patch
rewriting the `ossl_pkey_read_generic` properly.
The error didn't happen without the patch.

```
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.4 Beta (Plow)

$ OPENSSL_FORCE_FIPS_MODE=1 bundle exec ruby -I./lib -e "require 'openssl'"
/builddir/work/ruby/openssl/lib/openssl/pkey.rb:132:in `initialize': could not parse pkey (OpenSSL::PKey::DHError)
  from /builddir/work/ruby/openssl/lib/openssl/pkey.rb:132:in `new'
  from /builddir/work/ruby/openssl/lib/openssl/pkey.rb:132:in `new'
  from /builddir/work/ruby/openssl/lib/openssl/ssl.rb:34:in `<class:SSLContext>'
  from /builddir/work/ruby/openssl/lib/openssl/ssl.rb:20:in `<module:SSL>'
  from /builddir/work/ruby/openssl/lib/openssl/ssl.rb:19:in `<module:OpenSSL>'
  from /builddir/work/ruby/openssl/lib/openssl/ssl.rb:18:in `<top (required)>'
  from /builddir/work/ruby/openssl/lib/openssl.rb:21:in `require_relative'
  from /builddir/work/ruby/openssl/lib/openssl.rb:21:in `<top (required)>'
  from -e:1:in `require'
  from -e:1:in `<main>'
```

Related: RHEL-12724
2023-10-16 16:17:50 +02:00
.gitlab/merge_request_templates Add a merge-request (pull-request, PR) template to communicate more on a PR. 2022-08-16 17:25:30 +00:00
.gitignore .gitignore: Remove the setting to ignore any directories. 2022-08-16 17:25:30 +00:00
gating.yaml Add gating.yaml based on baseosci results 2022-02-14 08:40:39 +00:00
libruby.stp RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
macros.ruby RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
macros.rubygems Pass ldflags to gem install 2021-08-19 16:24:37 +02:00
operating_system.rb RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
ruby-1.9.3-mkmf-verbose.patch RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
ruby-2.1.0-always-use-i386.patch Adjust existing patch files to suppress Hunk lines. 2023-06-28 14:53:08 +02:00
ruby-2.1.0-custom-rubygems-location.patch Adjust existing patch files to suppress Hunk lines. 2023-06-28 14:53:08 +02:00
ruby-2.1.0-Enable-configuration-of-archlibdir.patch Upgrade to Ruby 3.0.2. 2021-08-19 16:24:35 +02:00
ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch Adjust existing patch files to suppress Hunk lines. 2023-06-28 14:53:08 +02:00
ruby-2.3.0-ruby_version.patch Adjust existing patch files to suppress Hunk lines. 2023-06-28 14:53:08 +02:00
ruby-2.7.0-Initialize-ABRT-hook.patch Merged update from upstream sources 2021-01-08 15:41:21 +00:00
ruby-2.7.1-Timeout-the-test_bug_reporter_add-witout-raising-err.patch Merged update from upstream sources 2021-01-08 15:41:21 +00:00
ruby-3.0.3-ext-openssl-extconf.rb-require-OpenSSL-version-1.0.1.patch Upgrade to Ruby 3.0.3. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Add-more-support-for-generic-pkey-types.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-addr2line-DW_FORM_ref_addr.patch Upgrade to Ruby 3.0.3. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Allocate-EVP_PKEY-on-initialize.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Allow-setting-algorithm-specific-options-in-sign-and-verify.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Deprecate-PKey-set_-and-PKey-DH-EC-generate_key.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Disable-test_no_private_exp-on-OpenSSL-3.0.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Don-t-query-RubyVM-FrozenCore-for-class-path.patch Prevent segfaults running with SystemTap. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Get-rid-of-type-punning-pointer-casts.patch Adjust existing patch files to suppress Hunk lines. 2023-06-28 14:53:08 +02:00
ruby-3.1.0-Ignore-DW_FORM_ref_addr.patch Upgrade to Ruby 3.0.3. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Implement-PKey-encrypt-decrypt-sign_raw-verify_raw-and-verify_recover.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Migrate-from-the-low-level-HMAC-API-to-the-EVP-API.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Miscellaneous-changes-for-OpenSSL-3.0-support-part-2.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Miscellaneous-changes-for-OpenSSL-3.0-support.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Properly-exclude-test-cases.patch Upgrade to Ruby 3.0.3. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Refactor-PEM-DER-serialization-code.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Support-GCCs-DWARF-5.patch Upgrade to Ruby 3.0.3. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-test_digest-do-not-test-constants-for-l.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-test_pkcs12-fix-test-failures-with-Open.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-test_pkey-use-EC-keys-for-PKey.generate.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-test_ssl-relax-regex-to-match-OpenSSL-s.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-utils-remove-dup_public-helper-method.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Use-EVP-API-in-more-places.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Use-high-level-EVP-interface-to-generate-parameters-and-keys.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Use-mmap-for-allocating-heap-pages-in-the-GC.patch Upgrade to ruby 3.0.4. 2022-08-02 11:42:55 +02:00
ruby-3.1.0-Use-OSSL_DECODER-to-load-encrypted-PEM-on-OpenSSL-3.0.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.1-ossl_ocsp-use-null.patch OpenSSL test suite fixes due to disabled SHA1. 2022-08-03 10:11:30 +02:00
ruby-3.1.2-ossl-tests-replace-sha1.patch OpenSSL test suite fixes due to disabled SHA1. 2022-08-03 10:11:30 +02:00
ruby-3.1.3-Fix-for-tzdata-2022g.patch Fix for tzdata-2022g. 2023-06-28 15:02:13 +02:00
ruby-3.2.0-git-2.38.1-fix-rubygems-test.patch Bypass git submodule test failure on Git >= 2.38.1. 2023-06-28 14:58:20 +02:00
ruby-3.3.0-openssl-3.2.0-fips-enable-tests.patch Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-10-13 13:23:14 +02:00
ruby-3.3.0-openssl-3.2.0-fips-fix-pkey-dh-require-openssl.patch ssl: use ffdhe2048 from RFC 7919 as the default DH group parameter 2023-10-16 16:17:50 +02:00
ruby-3.3.0-openssl-3.2.0-fips-fix-pkey-read-in-openssl-3.patch Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-10-13 13:23:14 +02:00
ruby-3.3.0-openssl-3.2.0-fix-fips-get-set-in-openssl-3.patch Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-10-13 13:23:14 +02:00
ruby-3.3.0-test-file-utime.patch Fix File.utime test. 2023-06-28 22:15:41 +02:00
ruby-exercise.stp RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
ruby-spec-Fix-tests-on-tzdata-2022b.patch Fix tests with Europe/Amsterdam pre-1970 time on tzdata version 2022b. 2023-06-28 15:00:26 +02:00
ruby.rpmlintrc Additional enhancement changes 2021-08-19 16:24:37 +02:00
ruby.spec ssl: use ffdhe2048 from RFC 7919 as the default DH group parameter 2023-10-16 16:17:50 +02:00
rubygems-3.2.30-Provide-distinguished-name-which-will-be-correctly-p.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
rubygems-3.2.33-Fix-loading-operating_system-rb-customizations-too-late.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
rubygems-3.3.1-Fix-compatibility-with-OpenSSL3.0.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
rubygems.attr RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
rubygems.con RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
rubygems.prov RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
rubygems.req RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
sources Upgrade to ruby 3.0.4. 2022-08-02 11:42:55 +02:00
test_abrt.rb RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
test_openssl_fips.rb Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-10-13 13:23:14 +02:00
test_systemtap.rb RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00