Skip to content

Commit

Permalink
Command sign-req: Verify $crt_type is valid, immediately
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Jun 16, 2024
1 parent 83eb846 commit 1a02841
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -2290,6 +2290,15 @@ sign_req() {
crt_type="$1"
file_name_base="$2"

# Verify $crt_type is valid
case "$crt_type" in
ca|server|serverClient|client|codeSigning|email|kdc)
: # All known types plus CA for self-sign
;;
*)
user_error "Type is not recognised: '$crt_type'"
esac

# Check argument sanity:
[ "$file_name_base" ] || user_error "\
Incorrect number of arguments provided to sign-req:
Expand Down

0 comments on commit 1a02841

Please sign in to comment.