diff options
author | Tim Smith <tsmith@chef.io> | 2019-06-22 02:37:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-22 02:37:07 +0100 |
commit | eed7359e6f0cfa453567fe84007aeff54b023cf1 (patch) | |
tree | 8991b0a9655abec94135cfe890bc01857e8a45ef | |
parent | 7cc4b8d0833b8f681f0d8d4ec73cbe4b96d508df (diff) | |
parent | 8bf253419558ffbed353a22171150f0dfff949c4 (diff) | |
download | ohai-eed7359e6f0cfa453567fe84007aeff54b023cf1.tar.gz |
Merge pull request #1381 from michel-slm/fix-fips-on-mac
[shard_seed] fix default_digest_algorithm on darwin
-rw-r--r-- | lib/ohai/plugins/shard.rb | 2 | ||||
-rw-r--r-- | spec/unit/plugins/shard_spec.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/ohai/plugins/shard.rb b/lib/ohai/plugins/shard.rb index 2909b088..f286e2a0 100644 --- a/lib/ohai/plugins/shard.rb +++ b/lib/ohai/plugins/shard.rb @@ -38,7 +38,7 @@ Ohai.plugin(:ShardSeed) do end def default_digest_algorithm - if fips["kernel"]["enabled"] + if fips && fips["kernel"]["enabled"] # Even though it is being used safely, FIPS-mode will still blow up on # any use of MD5 so default to SHA2 instead. "sha256" diff --git a/spec/unit/plugins/shard_spec.rb b/spec/unit/plugins/shard_spec.rb index f0ba40b6..5516b352 100644 --- a/spec/unit/plugins/shard_spec.rb +++ b/spec/unit/plugins/shard_spec.rb @@ -68,6 +68,7 @@ describe Ohai::System, "shard plugin" do context "with Darwin OS" do let(:os) { "darwin" } before do + plugin.data.delete("fips") # FIPS is undefined on Macs, make sure this still work plugin["hardware"] = { "serial_number" => serial, "platform_UUID" => uuid } end |