Skip to content

Commit 4ab9498

Browse files
committed
Remove redundant variable and password
1 parent 8aadc70 commit 4ab9498

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

imageroot/actions/upload-certificate/21validate_certificates

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ set -e
99

1010
CERT_FILE=uploaded_cert
1111
KEY_FILE=uploaded_key
12-
NO_PASSPHRASE_KEY=0
1312
VALID_KEY=0
1413
TYPE_KEY=""
1514

@@ -18,11 +17,7 @@ del_certs() {
1817
}
1918

2019
# checking if key has a passphrase
21-
if openssl pkey -in $KEY_FILE -passin pass:1234 >/dev/null 2>&1; then
22-
NO_PASSPHRASE_KEY=1
23-
fi
24-
25-
if [ $NO_PASSPHRASE_KEY -eq 0 ]; then
20+
if ! openssl pkey -in $KEY_FILE -passin pass: >/dev/null 2>&1; then
2621
echo "A key with a passphrase is not allowed." 1>&2
2722
echo "set-status validation-failed" >&${AGENT_COMFD:-2}
2823
printf '[{"field":"keyFile","parameter":"keyFile","value":"","error":"invalid_key"}]\n'

0 commit comments

Comments
 (0)