Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce new global options: --ku-critical and --bc-critical #1063

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -4825,11 +4825,21 @@ create_legacy_stream() {
;;
easyrsa)
# This could be COMMON but not is not suitable for a CA
cat <<- "CREATE_X509_TYPE_EASYRSA"
basicConstraints = CA:FALSE
_ku='digitalSignature, keyEncipherment'
if [ "$EASYRSA_KU_CRITICAL" ]; then
_ku="${EASYRSA_KU_CRITICAL}, ${_ku}"
fi

_bc='CA:FALSE'
if [ "$EASYRSA_BC_CRITICAL" ]; then
_bc="${EASYRSA_BC_CRITICAL}, ${_bc}"
fi

cat <<- CREATE_X509_TYPE_EASYRSA
basicConstraints = $_bc
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
keyUsage = digitalSignature,keyEncipherment
keyUsage = $_ku
CREATE_X509_TYPE_EASYRSA
;;
serverClient)
Expand All @@ -4855,11 +4865,21 @@ create_legacy_stream() {
;;
ca)
# ca
cat <<- "CREATE_X509_TYPE_CA"
basicConstraints = CA:TRUE
_ku='cRLSign, keyCertSign'
if [ "$EASYRSA_KU_CRITICAL" ]; then
_ku="${EASYRSA_KU_CRITICAL}, ${_ku}"
fi

_bc='CA:TRUE'
if [ "$EASYRSA_BC_CRITICAL" ]; then
_bc="${EASYRSA_BC_CRITICAL}, ${_bc}"
fi

cat <<- CREATE_X509_TYPE_CA
basicConstraints = $_bc
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
keyUsage = cRLSign, keyCertSign
keyUsage = $_ku
CREATE_X509_TYPE_CA
;;
selfsign)
Expand Down Expand Up @@ -5222,6 +5242,9 @@ CREATE_SSL_CONFIG
*)
die "create_legacy_stream: unknown type '$1'"
esac

# Cleanup
unset -v _ku _bc
} # => create_legacy_stream()

# Version information
Expand Down