Wrap long lines in "Main" function and verify_cert()
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
parent
8afd07b20d
commit
ae10aee413
@ -3440,7 +3440,8 @@ No certificate found for the input: '$crt_in'"
|
|||||||
Input is not a valid certificate: $crt_in"
|
Input is not a valid certificate: $crt_in"
|
||||||
|
|
||||||
# Test SSL out
|
# Test SSL out
|
||||||
if easyrsa_openssl verify -CAfile "$ca_crt" "$crt_in" 1>/dev/null
|
if easyrsa_openssl verify -CAfile "$ca_crt" \
|
||||||
|
"$crt_in" 1>/dev/null
|
||||||
then
|
then
|
||||||
notice "\
|
notice "\
|
||||||
Certificate name: $file_name_base
|
Certificate name: $file_name_base
|
||||||
@ -3451,9 +3452,12 @@ Input is not a valid certificate: $crt_in"
|
|||||||
Certificate name: $file_name_base
|
Certificate name: $file_name_base
|
||||||
Verfication status: FAILED"
|
Verfication status: FAILED"
|
||||||
# Exit with error (batch mode), otherwise term msg only
|
# Exit with error (batch mode), otherwise term msg only
|
||||||
[ "$exit_with_error" ] && easyrsa_error_exit=1
|
if [ "$exit_with_error" ]; then
|
||||||
# Return error for internal callers (status reports)
|
easyrsa_error_exit=1
|
||||||
return 1
|
# Return error for internal callers (status reports)
|
||||||
|
# or command line in --batch mode
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
} # => verify_cert()
|
} # => verify_cert()
|
||||||
|
|
||||||
@ -5523,7 +5527,8 @@ case "$cmd" in
|
|||||||
init_pki "$@"
|
init_pki "$@"
|
||||||
;;
|
;;
|
||||||
build-ca)
|
build-ca)
|
||||||
[ "$alias_days" ] && export EASYRSA_CA_EXPIRE="$alias_days"; :
|
[ -z "$alias_days" ] || \
|
||||||
|
export EASYRSA_CA_EXPIRE="$alias_days"
|
||||||
build_ca "$@"
|
build_ca "$@"
|
||||||
;;
|
;;
|
||||||
gen-dh)
|
gen-dh)
|
||||||
@ -5533,23 +5538,28 @@ case "$cmd" in
|
|||||||
gen_req "$@"
|
gen_req "$@"
|
||||||
;;
|
;;
|
||||||
sign|sign-req)
|
sign|sign-req)
|
||||||
[ "$alias_days" ] && export EASYRSA_CERT_EXPIRE="$alias_days"; :
|
[ -z "$alias_days" ] || \
|
||||||
|
export EASYRSA_CERT_EXPIRE="$alias_days"
|
||||||
sign_req "$@"
|
sign_req "$@"
|
||||||
;;
|
;;
|
||||||
build-client-full)
|
build-client-full)
|
||||||
[ "$alias_days" ] && export EASYRSA_CERT_EXPIRE="$alias_days"; :
|
[ -z "$alias_days" ] || \
|
||||||
|
export EASYRSA_CERT_EXPIRE="$alias_days"
|
||||||
build_full client "$@"
|
build_full client "$@"
|
||||||
;;
|
;;
|
||||||
build-server-full)
|
build-server-full)
|
||||||
[ "$alias_days" ] && export EASYRSA_CERT_EXPIRE="$alias_days"; :
|
[ -z "$alias_days" ] || \
|
||||||
|
export EASYRSA_CERT_EXPIRE="$alias_days"
|
||||||
build_full server "$@"
|
build_full server "$@"
|
||||||
;;
|
;;
|
||||||
build-serverClient-full)
|
build-serverClient-full)
|
||||||
[ "$alias_days" ] && export EASYRSA_CERT_EXPIRE="$alias_days"; :
|
[ -z "$alias_days" ] || \
|
||||||
|
export EASYRSA_CERT_EXPIRE="$alias_days"
|
||||||
build_full serverClient "$@"
|
build_full serverClient "$@"
|
||||||
;;
|
;;
|
||||||
gen-crl)
|
gen-crl)
|
||||||
[ "$alias_days" ] && export EASYRSA_CRL_DAYS="$alias_days"; :
|
[ -z "$alias_days" ] || \
|
||||||
|
export EASYRSA_CRL_DAYS="$alias_days"
|
||||||
gen_crl
|
gen_crl
|
||||||
;;
|
;;
|
||||||
revoke)
|
revoke)
|
||||||
@ -5559,14 +5569,16 @@ case "$cmd" in
|
|||||||
revoke_renewed "$@"
|
revoke_renewed "$@"
|
||||||
;;
|
;;
|
||||||
renew)
|
renew)
|
||||||
[ "$alias_days" ] && export EASYRSA_CERT_EXPIRE="$alias_days"; :
|
[ -z "$alias_days" ] || \
|
||||||
|
export EASYRSA_CERT_EXPIRE="$alias_days"
|
||||||
renew "$@"
|
renew "$@"
|
||||||
;;
|
;;
|
||||||
rewind-renew)
|
rewind-renew)
|
||||||
rewind_renew "$@"
|
rewind_renew "$@"
|
||||||
;;
|
;;
|
||||||
rebuild)
|
rebuild)
|
||||||
[ "$alias_days" ] && export EASYRSA_CERT_EXPIRE="$alias_days"; :
|
[ -z "$alias_days" ] || \
|
||||||
|
export EASYRSA_CERT_EXPIRE="$alias_days"
|
||||||
rebuild "$@"
|
rebuild "$@"
|
||||||
;;
|
;;
|
||||||
import-req)
|
import-req)
|
||||||
@ -5609,13 +5621,11 @@ case "$cmd" in
|
|||||||
show_ca "$@"
|
show_ca "$@"
|
||||||
;;
|
;;
|
||||||
verify)
|
verify)
|
||||||
# using internal 'batch' mode, this can return an error
|
verify_cert "$@"
|
||||||
# Ignore the error here, catch the error if used internally
|
|
||||||
# eg. show-expire/expire_status
|
|
||||||
verify_cert "$@" || :
|
|
||||||
;;
|
;;
|
||||||
show-expire)
|
show-expire)
|
||||||
[ "$alias_days" ] && export EASYRSA_CERT_RENEW="$alias_days"; :
|
[ -z "$alias_days" ] || \
|
||||||
|
export EASYRSA_CERT_RENEW="$alias_days"
|
||||||
status expire "$@"
|
status expire "$@"
|
||||||
;;
|
;;
|
||||||
show-revoke)
|
show-revoke)
|
||||||
@ -5640,7 +5650,8 @@ case "$cmd" in
|
|||||||
print_version
|
print_version
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "Unknown command '$cmd'. Run without commands for usage help."
|
die "\
|
||||||
|
Unknown command '$cmd'. Run without commands for usage help."
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check for untrapped errors
|
# Check for untrapped errors
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user