X-Git-Url: https://jfr.im/git/vpn-prov.git/blobdiff_plain/f7eeec090eedc570e3e457874583ec414a0bab51..02449cb16716b209d37a41b535d39dd149b3b064:/easy-rsa/revoke-full diff --git a/easy-rsa/revoke-full b/easy-rsa/revoke-full index 439f6a0..d3514e4 100755 --- a/easy-rsa/revoke-full +++ b/easy-rsa/revoke-full @@ -21,7 +21,15 @@ if [ "$KEY_DIR" ]; then export KEY_NAME="" # revoke key and generate a new CRL - $OPENSSL ca -revoke "$1.crt" -config "$KEY_CONFIG" + if [ -f "$1.crt" ]; then + crtname="$1.crt" + elif [ -f "$1.pem" ]; then + crtname="$1.pem" + else + echo "That certificate doesn't exist ($1.crt or $1.pem)" + exit + fi + $OPENSSL ca -revoke "$crtname" -config "$KEY_CONFIG" # generate a new CRL -- try to be compatible with # intermediate PKIs @@ -33,7 +41,7 @@ if [ "$KEY_DIR" ]; then fi # verify the revocation - $OPENSSL verify -CAfile "$RT" -crl_check "$1.crt" + $OPENSSL verify -CAfile "$RT" -crl_check "$crtname" else echo 'Please source the vars script first (i.e. "source ./vars")' echo 'Make sure you have edited it to reflect your configuration.'