Skip to content

Commit 45d68b1

Browse files
committed
av: restore the strict sha256 check on vendored source tarballs
The corresponding-source archive must match the exact bytes pyav-ffmpeg built the shipped libraries from, so a hash mismatch stays a hard failure until the maintainers decide how to handle regenerated GitHub archives.
1 parent ad35bd0 commit 45d68b1

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

‎.github/workflows/build-av.yml‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,11 @@ jobs:
120120
)
121121
digest = hashlib.sha256(path.read_bytes()).hexdigest()
122122
if digest != package.sha256:
123-
message = (
123+
raise SystemExit(
124124
f"{package.name}: sha256 mismatch for {package.source_url}\n"
125125
f" expected {package.sha256}\n got {digest}"
126126
)
127-
# GitHub regenerates /archive/ tarballs on demand and their bytes are
128-
# not stable across git releases (the content is the same tag), so a
129-
# hash drift there is not evidence of tampering. Keep failing hard for
130-
# every other host, where the file is a fixed release artefact.
131-
if "github.com/" in package.source_url and "/archive/" in package.source_url:
132-
print(f"::warning::{message}")
133-
else:
134-
raise SystemExit(message)
135-
print(f"{package.name}: {name} ({path.stat().st_size} bytes, sha256 {digest[:12]})")
127+
print(f"{package.name}: {name} ({path.stat().st_size} bytes, sha256 ok)")
136128
return path
137129
138130

0 commit comments

Comments
 (0)