diff options
Diffstat (limited to 'lib/ohai/plugins/windows/fips.rb')
-rw-r--r-- | lib/ohai/plugins/windows/fips.rb | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/lib/ohai/plugins/windows/fips.rb b/lib/ohai/plugins/windows/fips.rb index 56e5cdc7..085c7f2c 100644 --- a/lib/ohai/plugins/windows/fips.rb +++ b/lib/ohai/plugins/windows/fips.rb @@ -1,6 +1,6 @@ # # Author:: Matt Wrock (<matt@mattwrock.com>) -# Copyright:: Copyright (c) 2016 Chef Software, Inc. +# Copyright:: Copyright (c) 2016-2018 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,30 +28,11 @@ Ohai.plugin(:Fips) do collect_data(:windows) do fips Mash.new - # Check for new fips_mode method added in Ruby 2.5. After we drop support - # for Ruby 2.4, clean up everything after this and collapse the FIPS plugins. require "openssl" if defined?(OpenSSL.fips_mode) && OpenSSL.fips_mode && !$FIPS_TEST_MODE fips["kernel"] = { "enabled" => true } else - require "win32/registry" - # from http://msdn.microsoft.com/en-us/library/windows/desktop/aa384129(v=vs.85).aspx - if ::RbConfig::CONFIG["target_cpu"] == "i386" - reg_type = Win32::Registry::KEY_READ | 0x100 - elsif ::RbConfig::CONFIG["target_cpu"] == "x86_64" - reg_type = Win32::Registry::KEY_READ | 0x200 - else - reg_type = Win32::Registry::KEY_READ - end - - begin - Win32::Registry::HKEY_LOCAL_MACHINE.open('System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy', reg_type) do |policy| - enabled = policy["Enabled"] - fips["kernel"] = { "enabled" => enabled == 0 ? false : true } - end - rescue Win32::Registry::Error - fips["kernel"] = { "enabled" => false } - end + fips["kernel"] = { "enabled" => false } end end end |