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

Rakefile: Print FIPS information in the rake debug. #666

Merged
merged 1 commit into from Aug 24, 2023

Conversation

junaruga
Copy link
Member

I would like to add FIPS information to the rake debug. It is convenient to check if Ruby OpenSSL binding is running with the OpenSSL with a proper FIPS configuration properly. I need to install many OpenSSL versions or specific commit versions with the FIPS configuration file to debug or fix a FIPS related issue.


Add FIPS information (FIPS enabled, and providers) to the rake debug task, and run the rake debug in FIPS case to check if OpenSSL is running in FIPS.

Add FIPS information (FIPS enabled, and providers) to the `rake debug` task,
and run the `rake debug` in FIPS case to check if OpenSSL is running in FIPS.
puts <<~MESSAGE
OpenSSL::OPENSSL_VERSION: #{OpenSSL::OPENSSL_VERSION}
OpenSSL::OPENSSL_LIBRARY_VERSION: #{OpenSSL::OPENSSL_LIBRARY_VERSION}
OpenSSL::OPENSSL_VERSION_NUMBER: #{openssl_version_number_str}
OpenSSL::LIBRESSL_VERSION_NUMBER: #{libressl_version_number_str}
FIPS enabled: #{OpenSSL.fips_mode}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that the terminology "FIPS mode" was used in OpenSSL 1.0.x with the C APIs FIPS_mode() and FIPS_mode_set(). However, the terminology "FIPS mode" is not used anymore in OpenSSL 3. So, I think we need to remove some parts of the "fips mode" used in the comment. You can check openssl/openssl#21797 for details. And the "FIPS enabled" comes from the EVP_default_properties_is_fips_enabled used below.

enabled = EVP_default_properties_is_fips_enabled(NULL) ? Qtrue : Qfalse;

@junaruga
Copy link
Member Author

Non-FIPS case

openssl-head

https://github.com/ruby/openssl/actions/runs/5940938869/job/16110640631?pr=666#step:13:38

FIPS enabled: false
Providers: default

openssl-1.0.2u

https://github.com/ruby/openssl/actions/runs/5940938869/job/16110637136?pr=666#step:13:38

FIPS enabled: false
Providers: undefined

FIPS case

openssl-head fips

https://github.com/ruby/openssl/actions/runs/5940938869/job/16110640890?pr=666#step:14:31

FIPS enabled: true
Providers: fips, base

@rhenium rhenium merged commit 8273416 into ruby:master Aug 24, 2023
43 checks passed
@junaruga junaruga deleted the wip/rake-print-fips branch August 24, 2023 16:57
@junaruga
Copy link
Member Author

Thanks for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants