indygreg / apple-platform-rs

Rust crates supporting Apple platform development
565 stars 38 forks source link

hash mismatch for apple-codesign-0.27.0-x86_64-unknown-linux-musl.tar.gz.sha256 #135

Closed discentem closed 6 months ago

discentem commented 6 months ago

https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.27.0/apple-codesign-0.27.0-x86_64-unknown-linux-musl.tar.gz.sha256 appears to have the wrong hash.

This is how I am invoking curl and verifying the checksum:

ASSET_NAME="apple-codesign-0.27.0-x86_64-unknown-linux-musl.tar.gz"
VERSION="0.27.0"
HARDCODED_CHECKSUM="a0e0c548b313026abf4f40a6e06554d352c6f4e1add6a87d626c94134a4ee564"
DOWNLOAD_URL="https://github.com/$REPO/releases/download/v$VERSION/$ASSET_NAME"

echo "Downloading $ASSET_NAME from version $VERSION..."
curl -LO "$DOWNLOAD_URL"
# Verify the checksum
echo "Verifying checksum for $ASSET_NAME..."
CHECKSUM_ACTUAL=$(sha256sum "$ASSET_NAME" | awk '{print $1}')

if [ "$HARDCODED_CHECKSUM" == "$CHECKSUM_ACTUAL" ]; then
    echo "Checksum verification of rcodesign was successful."
else
    echo "Checksum verification for rcodesign failed. Expected $HARDCODED_CHECKSUM but got $CHECKSUM_ACTUAL. Exiting."
    exit 1
fi
Downloading apple-codesign-0.27.0-x86_64-unknown-linux-musl.tar.gz from version 0.27.0...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100     9  100     9    0     0     47      0 --:--:-- --:--:-- --:--:--    47
Verifying checksum for apple-codesign-0.27.0-x86_64-unknown-linux-musl.tar.gz...
Checksum verification for codesign failed. Expected ae0c548b313026abf4f40a6e06554d352c6f41add6a87d626c94134a4ee564 but got 0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5.
Exiting.

It's totally possible I am corrupting the download somehow though

discentem commented 6 months ago

Weird:

% shasum -a 256 apple-codesign-0.27.0-x86_64-unknown-linux-musl.tar.gz
a0e0c548b313026abf4f40a6e06554d352c6f4e1add6a87d626c94134a4ee564  apple-codesign-0.27.0-x86_64-unknown-linux-musl.tar.gz
discentem commented 6 months ago

This is definitely user error somehow. I seem to be corrupting the download with curl.