앞 커밋이 더한 「SIGNING_PASSWORD에 키 블록」 검사는 PROBLEM 줄만 내고 스크립트 종료 코드에 들어가지 않았다. 다른 검사가 같이 실패해 지금은 결과가 같지만, 이 검사만 걸리는 경우에는 통과로 보였을 것이다. 그 python 블록이 실패하면 fail=1이 되게 했다. 검증: 키 블록을 비밀번호로 준 경우 rc=1.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user