aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common
diff options
context:
space:
mode:
authorToni Saario <toni.saario@qt.io>2023-11-29 09:54:03 +0200
committerToni Saario <toni.saario@qt.io>2024-01-31 19:07:03 +0000
commit137a747c5841486fea3efba9cd1fbc3b64e4cdaf (patch)
tree4198f4d22b38efe2e44b312fc26cc8c1fcd0d697 /coin/provisioning/common
parent02199c9f752e79525c0348f8dc23cf91f2359959 (diff)
Coin: check hash exists after calculation
When the catch all is hit the exit statement only returns from the case statement. Remove the exit statement. Check that some sha was returned, otherwise empty input sha will result in empty calculated sha, which causes false positive sha check. Pick-to: 6.7 Change-Id: Iddb9562cf7e12f695e21ca63b302c9217fc98aab Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Diffstat (limited to 'coin/provisioning/common')
-rwxr-xr-xcoin/provisioning/common/unix/DownloadURL.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/coin/provisioning/common/unix/DownloadURL.sh b/coin/provisioning/common/unix/DownloadURL.sh
index 7ee92646..c1c27cbb 100755
--- a/coin/provisioning/common/unix/DownloadURL.sh
+++ b/coin/provisioning/common/unix/DownloadURL.sh
@@ -47,10 +47,10 @@ VerifyHash () {
65) sha256sum "$file" ;;
97) sha384sum "$file" ;;
129) sha512sum "$file" ;;
- *) echo "FATAL! Unknown hash length: $hashLength" 1>&2 && exit 1 ;;
+ *) echo "FATAL! Unknown hash length: $hashLength" 1>&2 ;;
esac | cut -d ' ' -f 1`
- if [ ! "$expectedHash" = "$hash" ]
+ if [ -z $hash ] || [ ! "$expectedHash" = "$hash" ]
then
echo "FAIL! wrong file hash: $file $hash" 1>&2
return 1