adapt signature check

This commit is contained in:
rootzoll 2021-09-21 18:02:49 +02:00
parent c0847a4255
commit 3734b8be4b

View file

@ -85,7 +85,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u admin wget -N https://github.com/guggero/chantools/releases/download/v${pinnedVersion}/${binaryName}
# check binary was not manipulated (checksum test)
sudo -u admin wget -N https://github.com/guggero/chantools/releases/download/v${pinnedVersion}/manifest-v${pinnedVersion}.txt.asc
sudo -u admin wget -N https://github.com/guggero/chantools/releases/download/v${pinnedVersion}/manifest-v${pinnedVersion}.txt.sig
sudo -u admin wget --no-check-certificate -N -O "${downloadDir}/pgp_keys.asc" ${PGPpkeys}
binaryChecksum=$(sha256sum ${binaryName} | cut -d " " -f1)
if [ "${binaryChecksum}" != "${SHA256}" ]; then
@ -105,8 +105,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
fi
gpg --import ./pgp_keys.asc
sleep 3
echo "# running: gpg --verify manifest-v${pinnedVersion}.txt.asc"
verifyResult=$(gpg --verify manifest-v${pinnedVersion}.txt.asc 2>&1)
echo "# running: gpg --verify manifest-v${pinnedVersion}.txt.sig"
verifyResult=$(gpg --verify manifest-v${pinnedVersion}.txt.sig 2>&1)
echo "# verifyResult(${verifyResult})"
goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c)
echo "# goodSignature(${goodSignature})"