forked from Homebrew/brew
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Homebrew#1451 from MikeMcQuaid/disable-sha1
compat/sha1: disable SHA-1 support.
- Loading branch information
Showing
1 changed file
with
9 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,29 @@ | ||
class Formula | ||
def self.sha1(val) | ||
odeprecated "Formula.sha1", "Formula.sha256" | ||
stable.sha1(val) | ||
def self.sha1(_val) | ||
odisabled "Formula.sha1", "Formula.sha256" | ||
end | ||
end | ||
|
||
class SoftwareSpec | ||
def sha1(val) | ||
odeprecated "SoftwareSpec#sha1", "SoftwareSpec#sha256" | ||
@resource.sha1(val) | ||
def sha1(_val) | ||
odisabled "SoftwareSpec#sha1", "SoftwareSpec#sha256" | ||
end | ||
end | ||
|
||
class Resource | ||
def sha1(val) | ||
odeprecated "Resource#sha1", "Resource#sha256" | ||
@checksum = Checksum.new(:sha1, val) | ||
def sha1(_val) | ||
odisabled "Resource#sha1", "Resource#sha256" | ||
end | ||
end | ||
|
||
class BottleSpecification | ||
def sha1(val) | ||
odeprecated "BottleSpecification#sha1", "BottleSpecification#sha256" | ||
digest, tag = val.shift | ||
collector[tag] = Checksum.new(:sha1, digest) | ||
def sha1(_val) | ||
odisabled "BottleSpecification#sha1", "BottleSpecification#sha256" | ||
end | ||
end | ||
|
||
class Pathname | ||
def sha1 | ||
require "digest/sha1" | ||
odeprecated "Pathname#sha1", "Pathname#sha256" | ||
incremental_hash(Digest::SHA1) | ||
odisabled "Pathname#sha1", "Pathname#sha256" | ||
end | ||
end |