Add a FIPS mode configuration setting
For FIPS compliance, we have to make sure all the code code uses a FIPS-validated cryptographic module, such as RedHat's FIPS OpenSSL library. However, Ruby implements its own version of SHA256, SHA512, etc. in its Digest module.
For example, in many parts of the code (and gems), we call:
Digest::SHA256.hexdigest("some string")
We may need to switch to OpenSSL::Digest instead:
OpenSSL::Digest::SHA256.hexdigest("some string")
Note that on a FIPS-compliant OpenSSL library, OpenSSL::Digest::MD5 will fail.
We should introduce a configuration parameter, such as fips_mode, so that we can switch to the OpenSSL implementation if needed. We may also disable features that are not FIPS-compliant with this configuration setting.
Edited by Stan Hu