-
Notifications
You must be signed in to change notification settings - Fork 171
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
OpenSSL 3: OpenSSL.fips_mode returns false in FIPS enabled environment #605
Comments
This issue was fixed by #608 (and #621 fixing an issue by #608 in OpenSSL 1.1). I tested this issue with the latest ruby/openssl master branch Install OpenSSL from the source.
ruby/openssl
Check the linked libraries.
Here is the OpenSSL config file to run on the FIPS mode.
The command below returns the
Without specifying the OpenSSL config file, the command below returns the
|
FIPS is enabled in the kernel. It doesn't make sense to run kernel in FIPS mode but OpenSSL - not. Also it doesn't make sense to run openssl in FIPS mode but kernel not. This is because the system will not be FIPS compliant in either of these configurations. So I think that it makes more sense to check the kernel configuration and enable/disable FIPS in openssl based on this.
|
@akostadinov How did you know that FIPS is only enabled in the kernel? In my understanding, the Here is the upstream document about the FIPS mode. |
@junaruga , that was my guess but now I just checked Ubuntu FAQ [1] and it also does refers to I didn't know that the OpenSSL check for In either case I understand why the openssl gem may stay with upstream defaults. Thank you for the links. [1] https://ubuntu.com/security/certifications/docs/fips-faq |
Thank you for the link explaining the And yes, as you said, I guess that mixing FIPS and non-FIPS components doesn't happen in the real use case. In the case of Fedora and RHEL, according to the document in RHEL 9, the FIPS mode is enabled in the OS level by the commands below.
However, only enabling the OpenSSL FIPS mode in the non-FIPS mode OS is useful for a testing purpose like this case. In the Fedora specific patch above, the environment variable As a note, you can change the value of the |
Here is another FIPS specific issue with OpenSSL 3 on RHEL 9.1 with FIPS mode enabled. The reason is because the macro
OPENSSL_FIPS
is not used in OpenSSL 3 any more.The
OpenSSL.fips_mode
returns "false" in the environment.Here is the part of the code.
openssl/ext/openssl/ossl.c
Lines 417 to 428 in fbb24fd
Here is the gdb log.
It seems that
OPENSSL_FIPS
implementation was deleted at the commit openssl/openssl@b53338c.I checked the FIPS related documents on OpenSSL repository. We need to add an implementation to make the Ruby OpenSSL work with OpenSSL 3 with the FIPS enabled environment.
The
man 7 fips_module
: https://github.com/openssl/openssl/blob/master/doc/man7/fips_module.podThe
man 7 migration_guide
: https://github.com/openssl/openssl/blob/master/doc/man7/migration_guide.podThe text was updated successfully, but these errors were encountered: