diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index ef601a1..4a8948f 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -33,7 +33,7 @@ Here is the list of commands available with a short syntax reminder. Use the sign-req build-client-full [ cmd-opts ] build-server-full [ cmd-opts ] - revoke + revoke [cmd-opts] gen-crl update-db show-req [ cmd-opts ] @@ -98,8 +98,16 @@ cmd_help() { opts=" nopass - do not encrypt the private key (default is encrypted)" ;; revoke) text=" - revoke - Revoke a certificate specified by the filename_base" ;; + revoke [reason] + Revoke a certificate specified by the filename_base, with an optional + revocation reason that is one of: + unspecified + keyCompromise + CACompromise + affiliationChanged + superseded + cessationOfOperation + certificateHold";; gen-crl) text=" gen-crl Generate a CRL" ;; @@ -846,6 +854,11 @@ Error: didn't find a file base name as the first argument. Run easyrsa without commands for usage and command help." crt_in="$EASYRSA_PKI/issued/$1.crt" + opts="" + if [ "$2" ]; then + opts="$opts -crl_reason $2" + fi + verify_file x509 "$crt_in" || die "\ Unable to revoke as the input file is not a valid certificate. Unexpected input in file: $crt_in" @@ -865,7 +878,7 @@ at: $crt_in" # make safessl-easyrsa.cnf make_ssl_config - "$EASYRSA_OPENSSL" ca -utf8 -revoke "$crt_in" -config "$EASYRSA_SAFE_CONF" || die "\ + "$EASYRSA_OPENSSL" ca -utf8 -revoke "$crt_in" -config "$EASYRSA_SAFE_CONF" "$opts" || die "\ Failed to revoke certificate: revocation command failed." notice "\