summaryrefslogtreecommitdiff
path: root/lib/chef/digester.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-06-26 11:53:28 -0700
committerTim Smith <tsmith84@gmail.com>2020-06-26 11:53:28 -0700
commit078704e3d1e3d43f96b77376f09ffb3d54b73feb (patch)
treeb8661a0a6b57d43bb7e23277740c92289adab436 /lib/chef/digester.rb
parente23fe89f57148cbfb71a1f84b470c4b92b2ee0a7 (diff)
downloadchef-078704e3d1e3d43f96b77376f09ffb3d54b73feb.tar.gz
Replace OpenSSL::Digest with ::Digest for MD5
Avoid fips warnings where we're just checksumming files and also support changes in Ruby 3.0 Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/digester.rb')
-rw-r--r--lib/chef/digester.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/digester.rb b/lib/chef/digester.rb
index 2f6869728c..b9180ddd24 100644
--- a/lib/chef/digester.rb
+++ b/lib/chef/digester.rb
@@ -19,6 +19,7 @@
#
require "openssl" unless defined?(OpenSSL)
+require "digest" unless defined?(Digest)
require "singleton" unless defined?(Singleton)
class Chef
@@ -50,11 +51,11 @@ class Chef
end
def generate_md5_checksum_for_file(file)
- checksum_file(file, OpenSSL::Digest.new("MD5"))
+ checksum_file(file, ::Digest::MD5.new)
end
def generate_md5_checksum(io)
- checksum_io(io, OpenSSL::Digest.new("MD5"))
+ checksum_io(io, ::Digest::MD5.new)
end
private