Merge branch 'TinCanTech-prohibit-cert-type-common'

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-08-15 13:48:43 +01:00
commit 4cd102764c
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -1563,14 +1563,18 @@ expected 2, got $# (see command help for usage)"
[ -e "$EASYRSA_EXT_DIR/$crt_type" ] || die "\
Unknown cert type '$crt_type'"
# Cert type must NOT be COMMON
[ "$crt_type" != COMMON ] || die "\
Invalid certificate type: '$crt_type'"
# Request file must exist
[ -e "$req_in" ] || die "\
No request found for the input: '$2'
Expected to find the request at: $req_in"
# Existing certificate file must NOT exist
# Certificate file must NOT exist
[ ! -e "$crt_out" ] || die "\
Cannot sign this request for '$2' because a certificate for it already exists
Cannot sign this request for '$2', a certificate already exists
at: $crt_out"
# Confirm input is a cert req