Update for incoming ruby openSSL deprecations

Fixes #5031

See above issue for full context, this updates to the latest rubocop requirements for incoming ruby OpenSSL deprecations

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
This commit is contained in:
Nick Schwaderer 2020-05-18 15:52:49 +01:00
parent 5cf742055b
commit e882bc727e
5 changed files with 5 additions and 5 deletions

View file

@ -99,7 +99,7 @@ module Inspec::Fetcher
def cache_key
return resolved_ref unless @relative_path
OpenSSL::Digest::SHA256.hexdigest(resolved_ref + @relative_path)
OpenSSL::Digest.hexdigest("SHA256", resolved_ref + @relative_path)
end
def archive_path

View file

@ -104,7 +104,7 @@ module Inspec::Fetcher
return @archive_shasum if @archive_shasum
raise(Inspec::FetcherFailure, "Profile dependency local path '#{target}' does not exist") unless File.exist?(target)
@archive_shasum = OpenSSL::Digest::SHA256.digest(File.read(target)).unpack("H*")[0]
@archive_shasum = OpenSSL::Digest.digest("SHA256", File.read(target)).unpack("H*")[0]
end
def resolved_source

View file

@ -127,7 +127,7 @@ module Inspec::Fetcher
end
def sha256
@archive_shasum ||= OpenSSL::Digest::SHA256.digest(File.read(@archive_path || temp_archive_path)).unpack("H*")[0]
@archive_shasum ||= OpenSSL::Digest.digest("SHA256", File.read(@archive_path || temp_archive_path)).unpack("H*")[0]
end
def file_type_from_remote(remote)

View file

@ -559,7 +559,7 @@ module Inspec
# get all dependency checksums
deps = Hash[locked_dependencies.list.map { |k, v| [k, v.profile.sha256] }]
res = OpenSSL::Digest::SHA256.new
res = OpenSSL::Digest.new("SHA256")
files = source_reader.tests.to_a + source_reader.libraries.to_a +
source_reader.data_files.to_a +
[["inspec.yml", source_reader.metadata.content]] +

View file

@ -59,7 +59,7 @@ module Inspec::Resources
def fingerprint
return if @cert.nil?
OpenSSL::Digest::SHA1.new(@cert.to_der).to_s
OpenSSL::Digest.new("SHA1", @cert.to_der).to_s
end
def serial