Use digests and not digests.asc

This commit is contained in:
Salt 2020-12-02 19:20:45 -06:00
parent 1efc45ad5f
commit 56a34c9306

View File

@ -98,25 +98,25 @@ build-gentoo() {
| head -n 1
)"
stage3file="/tmp/tmp.$USER.$_name.stage3.tar.xz"
stage3sig="/tmp/tmp.$USER.$_name.stage3.tar.xz.DIGESTS.asc"
stage3sig="/tmp/tmp.$USER.$_name.stage3.tar.xz.DIGESTS"
for file in "$stage3file" "$stage3sig"; do
touch "$file"
chmod 0600 "$file"
done
trap "cleanup $stage3file" EXIT
# We grab the signature first to verify the integrity of any tarball leftover from a previous run
# We grab the checksums first to verify the integrity of any tarball leftover from a previous run
log "Downloading stage3 signature"
curl -s "$stage3.DIGESTS.asc" -o "$stage3sig"
curl -s "$stage3.DIGESTS" -o "$stage3sig"
if ! [ -f "$stage3file" ]; then
log "Downloading stage3"
curl -s "$stage3" -o "$stage3file"
elif ! openssl dgst -r -sha512 "$stage3file"; then
log "Signature verification failed; downloading new stage3"
log "Checksum verification failed; downloading new stage3"
curl -s "$stage3" -o "$stage3file"
fi
# At this point, we should have a new stage3 that matches our signature; die of not
if ! openssl dgst -r -sha512 "$stage3file"; then
error "stage3 signature verification failed" 50
error "stage3 checksum verification failed" 50
fi
log "Decompressing tarball; this will prompt for root privileges"
sudo tar xf "$stage3file" -C "$_optdest"