Skip to content

Commit 72ec9b6

Browse files
committed
fix: sha256 in update script for OpenSSL
OpenSSL changed the format of the sha256 file in its releases. Let's allow both format: `{sha256}` or `{sha256} {filename}`
1 parent 56aa0fb commit 72ec9b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/update_openssl_version.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def get_openssl_sha256(version: str, verbose: bool=False) -> str:
4040
f"https://github.com/openssl/openssl/releases/download/openssl-{version}/openssl-{version}.tar.gz.sha256"
4141
)
4242
with _log(f"Collecting SHA256 from '{files_base_url}'"):
43-
sha256 = requests.get(files_base_url).content.decode("ascii").strip()
43+
parts = requests.get(files_base_url).content.decode("ascii").strip().split()
44+
sha256 = parts[0]
45+
if len(parts) > 1:
46+
assert len(parts) == 2
47+
assert parts[1] == f"openssl-{version}.tar.gz"
4448
if verbose:
4549
print("got sha256:", sha256)
4650
return sha256

0 commit comments

Comments
 (0)