summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrevoke.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/revoke.sh b/revoke.sh
index cbee629..f45890e 100755
--- a/revoke.sh
+++ b/revoke.sh
@@ -22,15 +22,23 @@ else
echo "$0 [certfile|certname|serial] (configfile)"
exit 2
fi
-
+
+echo -n Enter the passphrase for "$CA"/ca/"$CA".key:\
+read -s PASS
+echo
+export PASS
+
# Gen signed key
echo Adding revocation to index...
-openssl ca -config "$OPENSSL_CONFIG" -revoke "$CERT"
+openssl ca -config "$OPENSSL_CONFIG" -passin env:PASS -revoke "$CERT"
echo Building and signing CRL...
-openssl ca -config "$OPENSSL_CONFIG" -gencrl -out "$CA"/ca/"$CA".crl
+openssl ca -config "$OPENSSL_CONFIG" -passin env:PASS -gencrl -out "$CA"/ca/"$CA".crl
echo
openssl crl -in "$CA"/ca/"$CA".crl -text -noout
echo
+
+export -n PASS
+
if [ -x ./post-revoke ]; then
./post-revoke "$CA"/ca/"$CA".crl "$CERT"
else