scripts: verify hash length

To make sure we've actually calculated the hash correctly, we make sure
it's 64 characters long.
This commit is contained in:
Oliver Gugger 2021-02-12 10:41:27 +01:00
parent 644424296b
commit 132d23c964
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -81,6 +81,16 @@ if [[ ! "$LND_VERSION" =~ $version_regex ]]; then
exit 1 exit 1
fi fi
# Make sure the hash was actually calculated by looking at its length.
if [[ ${#LND_SUM} -ne 64 ]]; then
echo "ERROR: Invalid hash for lnd: $LND_SUM!"
exit 1
fi
if [[ ${#LNCLI_SUM} -ne 64 ]]; then
echo "ERROR: Invalid hash for lncli: $LNCLI_SUM!"
exit 1
fi
# If we're inside the docker image, there should be a shasums.txt file in the # If we're inside the docker image, there should be a shasums.txt file in the
# root directory. If that's the case, we first want to make sure we still have # root directory. If that's the case, we first want to make sure we still have
# the same hash as we did when building the image. # the same hash as we did when building the image.