[1/3] downloadsource.sh: Change checksum algorithm to BLAKE2

Message ID 9a3bc372-db7a-24c2-478c-6bc481864672@ipfire.org
State Accepted
Commit b8764ff2265edb0d6b51a062ecfee76c04ecdab1
Headers
Series [1/3] downloadsource.sh: Change checksum algorithm to BLAKE2 |

Commit Message

Peter Müller April 8, 2022, 3:10 p.m. UTC
  Reported-by: Arne Fitzenreiter <arne.fitzenreiter@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 src/installer/downloadsource.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/src/installer/downloadsource.sh b/src/installer/downloadsource.sh
index c74f9e232..47086b2b7 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  <info@ipfire.org>                          #
+# Copyright (C) 2007-2022  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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