Skip to content

Commit

Permalink
write_x509_type_tmp(): Verify x509-type before redirect
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 7, 2024
1 parent 4d9289a commit ca3c963
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -4558,17 +4558,24 @@ write_easyrsa_ssl_cnf_tmp: $ssl_cnf_type \

# Write x509 type file to a temp file
write_x509_type_tmp() {
type="$1"
shift
# Verify x509-type before redirect
case "$1" in
COMMON|ca|server|serverClient|client|email| \
codeSigning|kdc|selfsign)
: # ok
;;
*)
die "write_x509_type_tmp - unknown type '$1'"
esac

write_x509_file_tmp=""
easyrsa_mktemp write_x509_file_tmp || die \
"write_x509_type_tmp - easyrsa_mktemp write_x509_file_tmp"
write_x509_file_tmp=""
easyrsa_mktemp write_x509_file_tmp || \
die "write_x509_type_tmp - easyrsa_mktemp"

write "$type" > "$write_x509_file_tmp" || \
die "write_x509_type_tmp - write $type"
write "$1" > "$write_x509_file_tmp" || \
die "write_x509_type_tmp - write $1"

verbose ": write_x509_type_tmp: $type COMPLETE"
verbose ": write_x509_type_tmp: $1 COMPLETE"
} # => write_x509_type_tmp()

############################################################################
Expand Down

0 comments on commit ca3c963

Please sign in to comment.