Skip to content

Commit

Permalink
sign-req: Typo and comment. Simplify check_unique_serial().
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Dec 23, 2024
1 parent ee363c6 commit 87a815b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -2428,7 +2428,7 @@ sign_req() {
Unrecognised x509-type: '$crt_type'

In order to sign a custom X509 Type certificate, there must be a
corresponding SSL configuration file in the 'x509-type' folder."
corresponding SSL configuration file in the 'x509-types' folder."
esac

# Check argument sanity:
Expand Down Expand Up @@ -2831,6 +2831,7 @@ source or that you have verified the request checksum \
with the sender.$NL"
fi

# Request FINAL user confirmation
confirm "Confirm requested details: " "yes" "\
${foreign_request}You are about to sign the following certificate:

Expand Down Expand Up @@ -2893,12 +2894,8 @@ check_serial_unique() {
user_error "Invalid serial number: '$1'"
esac

unset -v unique_serial_true

# Check for openssl -status of serial number
# Always errors out - Do not capture error
# unset EASYRSA_SILENT_SSL to capture all output
# Do NOT unset check_serial for sign-req error msg
check_serial="$(
"$EASYRSA_OPENSSL" ca -status "$1" 2>&1
)" || :
Expand All @@ -2910,17 +2907,15 @@ check_serial_unique() {
verbose "check_serial_unique: unique_serial=true"
;;
*)
: # Some other response
unique_serial_true=
verbose "check_serial_unique: unique_serial=false"
esac

# In batch mode return result only
if [ "$2" = batch ] || [ "$EASYRSA_BATCH" ]; then
if [ "$unique_serial_true" ]; then
unset -v unique_serial_true
return 0
else
unset -v unique_serial_true
return 1
fi
fi
Expand Down

0 comments on commit 87a815b

Please sign in to comment.