mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

This prevents a downgrade attack. Closes Homebrew/homebrew#38433. Signed-off-by: Xu Cheng <xucheng@me.com>
27 lines
381 B
Ruby
27 lines
381 B
Ruby
class Formula
|
|
def self.md5(val)
|
|
stable.md5(val)
|
|
end
|
|
end
|
|
|
|
class SoftwareSpec
|
|
def md5(val)
|
|
@resource.md5(val)
|
|
end
|
|
end
|
|
|
|
class Resource
|
|
def md5(val)
|
|
@checksum = Checksum.new(:md5, val)
|
|
end
|
|
end
|
|
|
|
class Pathname
|
|
def md5
|
|
odie <<-EOS.undent
|
|
MD5 support has been dropped for security reasons.
|
|
Please switch this formula to SHA256.
|
|
EOS
|
|
end
|
|
end
|