From 1a02841ed5baec2ddb2b0da8aaca021b0f2ddfc3 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Sun, 16 Jun 2024 17:34:49 +0100 Subject: [PATCH] Command sign-req: Verify $crt_type is valid, immediately Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index d45d27c35..061171a76 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -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: