diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-03 08:53:02 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-03 08:53:02 -0800 |
commit | 09227432c7a8afeac633023abbeec2e9c14cbd1b (patch) | |
tree | 811fc939d4ccdaf66b0bf6bf7cdef10bb0172191 /chef-config | |
parent | ab63cd4be967b5d01f6ec856244e4b9af4e896d9 (diff) | |
parent | d1f9d3fe01da4620c983ee9b74cbd973abbff418 (diff) | |
download | chef-09227432c7a8afeac633023abbeec2e9c14cbd1b.tar.gz |
Merge pull request #4481 from chef/jdm/fips-58
Allow use of command line fips switch for knife
Diffstat (limited to 'chef-config')
-rw-r--r-- | chef-config/lib/chef-config/config.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb index 0f20a46040..4934955873 100644 --- a/chef-config/lib/chef-config/config.rb +++ b/chef-config/lib/chef-config/config.rb @@ -496,13 +496,7 @@ module ChefConfig # Initialize openssl def self.init_openssl if fips - ChefConfig.logger.warn "The `fips` feature is still a work in progress. This feature is incomplete." - OpenSSL.fips_mode = true - require "digest" - require "digest/sha1" - require "digest/md5" - Digest.const_set("SHA1", OpenSSL::Digest::SHA1) - OpenSSL::Digest.const_set("MD5", Digest::MD5) + self.enable_fips_mode end end @@ -910,5 +904,18 @@ module ChefConfig def self._this_file File.expand_path(__FILE__) end + + # Set fips mode in openssl. Do any patching necessary to make + # sure Chef runs do not crash. + # @api private + def self.enable_fips_mode + ChefConfig.logger.warn "The `fips` feature is still a work in progress. This feature is incomplete." + OpenSSL.fips_mode = true + require "digest" + require "digest/sha1" + require "digest/md5" + Digest.const_set("SHA1", OpenSSL::Digest::SHA1) + OpenSSL::Digest.const_set("MD5", Digest::MD5) + end end end |