Commit abc69bd6 by Jason Karns

SHA2 support shouldn't be a pre-req for MD5 checksum verification

parent 018357fe
...@@ -247,8 +247,6 @@ compute_md5() { ...@@ -247,8 +247,6 @@ compute_md5() {
} }
verify_checksum() { verify_checksum() {
# If there's no SHA2 support, return success
[ -n "$HAS_SHA2_SUPPORT" ] || return 0
local checksum_command="compute_sha2" local checksum_command="compute_sha2"
# If the specified filename doesn't exist, return success # If the specified filename doesn't exist, return success
...@@ -256,7 +254,7 @@ verify_checksum() { ...@@ -256,7 +254,7 @@ verify_checksum() {
[ -e "$filename" ] || return 0 [ -e "$filename" ] || return 0
# If there's no expected checksum, return success # 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 [ -n "$expected_checksum" ] || return 0
case "${#expected_checksum}" in case "${#expected_checksum}" in
...@@ -264,6 +262,10 @@ verify_checksum() { ...@@ -264,6 +262,10 @@ verify_checksum() {
[ -n "$HAS_MD5_SUPPORT" ] || return 0 [ -n "$HAS_MD5_SUPPORT" ] || return 0
checksum_command="compute_md5" checksum_command="compute_md5"
;; ;;
64) # SHA2 256
[ -n "$HAS_SHA2_SUPPORT" ] || return 0
checksum_command="compute_sha2"
;;
esac esac
# If the computed checksum is empty, return failure # If the computed checksum is empty, return failure
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment