diff --git a/scripts/release/check-signing-key.sh b/scripts/release/check-signing-key.sh index 3b79946..20a8db2 100755 --- a/scripts/release/check-signing-key.sh +++ b/scripts/release/check-signing-key.sh @@ -25,8 +25,8 @@ fi [ -n "${SIGNING_PASSWORD:-}" ] || echo "check-signing-key: SIGNING_PASSWORD is empty (only right for a key without a passphrase)" # The passphrase's shape only: a pasted value often carries a line break or spaces the key was not # protected with, and Gradle uses the value as given. -python3 - <<'PY' -import os +python3 - <<'PY' || fail=1 +import os, sys p = os.environ.get("SIGNING_PASSWORD", "") print(f"password shape: {len(p)} characters, line breaks {p.count(chr(10))}, CR {p.count(chr(13))}," f" leading whitespace {'yes' if p[:1].isspace() else 'no'}, trailing whitespace {'yes' if p[-1:].isspace() else 'no'}," @@ -34,6 +34,7 @@ print(f"password shape: {len(p)} characters, line breaks {p.count(chr(10))}, CR if "-----BEGIN PGP" in p or len(p) > 1000: print("PROBLEM: SIGNING_PASSWORD holds a PGP key block (or something as long), not the passphrase." " Put in only the passphrase chosen when the key was made.") + sys.exit(1) PY home=$(mktemp -d)