From: Peter Müller Date: Fri, 8 Apr 2022 15:10:37 +0000 (+0000) Subject: downloadsource.sh: Change checksum algorithm to BLAKE2 X-Git-Tag: v2.27-core167~5^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8764ff2265edb0d6b51a062ecfee76c04ecdab1;p=ipfire-2.x.git downloadsource.sh: Change checksum algorithm to BLAKE2 Reported-by: Arne Fitzenreiter Signed-off-by: Peter Müller --- diff --git a/src/installer/downloadsource.sh b/src/installer/downloadsource.sh index c74f9e232d..47086b2b70 100644 --- a/src/installer/downloadsource.sh +++ b/src/installer/downloadsource.sh @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2010 IPFire Team # +# Copyright (C) 2007-2022 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -48,17 +48,17 @@ if ! download -O "${OUTPUT}" "${URL}"; then exit 1 fi -# Download went well. Checking for MD5 sum -if download -O "${OUTPUT}.md5" "${URL}.md5" &>/dev/null; then +# Download went well. Checking for BLAKE2 sum +if download -O "${OUTPUT}.b2" "${URL}.b2" &>/dev/null; then # Read downloaded checksum - read -r md5sum rest < "${OUTPUT}.md5" - rm -f "${OUTPUT}.md5" + read -r b2sum rest < "${OUTPUT}.b2" + rm -f "${OUTPUT}.b2" # Compute checkum of downloaded image file - read -r md5sum_image rest <<< "$(md5sum "${OUTPUT}")" + read -r b2sum_image rest <<< "$(b2sum "${OUTPUT}")" - if [ "${md5sum}" != "${md5sum_image}" ]; then - echo "MD5 sum mismatch: ${md5sum} != ${md5sum_image}" >&2 + if [ "${b2sum}" != "${b2sum_image}" ]; then + echo "BLAKE2 checksum mismatch: ${b2sum} != ${b2sum_image}" >&2 exit 2 fi fi