Skip to content

Commit

Permalink
Merge pull request #785 from stanhu/sh-fips-hash
Browse files Browse the repository at this point in the history
Switch hash from MD5 to SHA256
  • Loading branch information
rafaelfranca authored Jun 27, 2022
2 parents 8c9817d + 0c01a18 commit 937c443
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/thor/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require_relative "group"

require "yaml"
require "digest/md5"
require "digest/sha2"
require "pathname"

class Thor::Runner < Thor #:nodoc:
Expand Down Expand Up @@ -91,7 +91,7 @@ def install(name) # rubocop:disable Metrics/MethodLength
end

thor_yaml[as] = {
:filename => Digest::MD5.hexdigest(name + as),
:filename => Digest::SHA256.hexdigest(name + as),
:location => location,
:namespaces => Thor::Util.namespaces_in_content(contents, base)
}
Expand Down
2 changes: 1 addition & 1 deletion spec/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def when_no_thorfiles_exist
allow(FileUtils).to receive(:touch)
allow(Thor::LineEditor).to receive(:readline).and_return("Y")

path = File.join(Thor::Util.thor_root, Digest::MD5.hexdigest(@location + "random"))
path = File.join(Thor::Util.thor_root, Digest::SHA256.hexdigest(@location + "random"))
expect(File).to receive(:open).with(path, "w")
end

Expand Down

0 comments on commit 937c443

Please sign in to comment.