Auto-create x509-types: Corrections to buld-ca and sign-req

build-ca:
* Replace 'print foo' with function create_x509_types_ca()
* Replace 'ignore' with function create_x509_type_COMMON()

sign-req:
* Replace 'ignore' with function create_x509_type_COMMON()

Note: x509-types/COMMON only has comments, no code.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2023-06-14 21:24:51 +01:00
parent 27c5973174
commit db9507626b
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -1878,18 +1878,14 @@ Raw CA mode
if [ -f "$EASYRSA_EXT_DIR/ca" ]; then
cat "$EASYRSA_EXT_DIR/ca"
else
print "\
basicConstraints = CA:TRUE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
keyUsage = cRLSign, keyCertSign"
create_x509_type_ca
fi
# COMMON file
if [ -f "$EASYRSA_EXT_DIR/COMMON" ]; then
cat "$EASYRSA_EXT_DIR/COMMON"
else
: # ok
create_x509_type_COMMON
fi
# User extentions
@ -2354,13 +2350,7 @@ to the latest Easy-RSA release."
# Begin output redirect
{
# Append COMMON and cert-type extensions
if [ -f "$EASYRSA_EXT_DIR/COMMON" ]; then
cat "$EASYRSA_EXT_DIR/COMMON"
else
: # ok
fi
# Append $cert-type extensions
if [ -f "$EASYRSA_EXT_DIR/$crt_type" ]; then
cat "$EASYRSA_EXT_DIR/$crt_type"
else
@ -2383,6 +2373,13 @@ to the latest Easy-RSA release."
esac
fi
# Append COMMON extensions
if [ -f "$EASYRSA_EXT_DIR/COMMON" ]; then
cat "$EASYRSA_EXT_DIR/COMMON"
else
create_x509_type_COMMON
fi
# Support a dynamic CA path length when present:
if [ "$crt_type" = "ca" ] && [ "$EASYRSA_SUBCA_LEN" ]
then