mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-09-06 01:01:47 +02:00
SHA2 support shouldn't be a pre-req for MD5 checksum verification
This commit is contained in:
parent
018357fefb
commit
abc69bd630
1 changed files with 5 additions and 3 deletions
|
@ -247,8 +247,6 @@ compute_md5() {
|
|||
}
|
||||
|
||||
verify_checksum() {
|
||||
# If there's no SHA2 support, return success
|
||||
[ -n "$HAS_SHA2_SUPPORT" ] || return 0
|
||||
local checksum_command="compute_sha2"
|
||||
|
||||
# If the specified filename doesn't exist, return success
|
||||
|
@ -256,7 +254,7 @@ verify_checksum() {
|
|||
[ -e "$filename" ] || return 0
|
||||
|
||||
# If there's no expected checksum, return success
|
||||
local expected_checksum=`echo "$2" | tr [A-Z] [a-z]`
|
||||
local expected_checksum="$(echo "$2" | tr [A-Z] [a-z])"
|
||||
[ -n "$expected_checksum" ] || return 0
|
||||
|
||||
case "${#expected_checksum}" in
|
||||
|
@ -264,6 +262,10 @@ verify_checksum() {
|
|||
[ -n "$HAS_MD5_SUPPORT" ] || return 0
|
||||
checksum_command="compute_md5"
|
||||
;;
|
||||
64) # SHA2 256
|
||||
[ -n "$HAS_SHA2_SUPPORT" ] || return 0
|
||||
checksum_command="compute_sha2"
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the computed checksum is empty, return failure
|
||||
|
|
Loading…
Reference in a new issue