Skip to content

Commit 937c443

Browse files
authored
Merge pull request #785 from stanhu/sh-fips-hash
Switch hash from MD5 to SHA256
2 parents 8c9817d + 0c01a18 commit 937c443

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/thor/runner.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require_relative "group"
33

44
require "yaml"
5-
require "digest/md5"
5+
require "digest/sha2"
66
require "pathname"
77

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

9393
thor_yaml[as] = {
94-
:filename => Digest::MD5.hexdigest(name + as),
94+
:filename => Digest::SHA256.hexdigest(name + as),
9595
:location => location,
9696
:namespaces => Thor::Util.namespaces_in_content(contents, base)
9797
}

spec/runner_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def when_no_thorfiles_exist
219219
allow(FileUtils).to receive(:touch)
220220
allow(Thor::LineEditor).to receive(:readline).and_return("Y")
221221

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

0 commit comments

Comments
 (0)