Skip to content

Commit

Permalink
mark some X.509 v3 certificate extension as critical
Browse files Browse the repository at this point in the history
critical keyUsage is required by RFC5280 §4.2.1.3
critical basicConstraints (for CA) is required by RFC5280 §4.2.1.9
critical extendedKeyUsage (for code signing) is required by macOS TN2206

Signed-off-by: Youfu Zhang <[email protected]>
  • Loading branch information
zhangyoufu committed Mar 29, 2022
1 parent 606cc48 commit 89b229a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ $(display_dn req "$req_in")

# Support a dynamic CA path length when present:
[ "$crt_type" = "ca" ] && [ -n "$EASYRSA_SUBCA_LEN" ] && \
print "basicConstraints = CA:TRUE, pathlen:$EASYRSA_SUBCA_LEN"
print "basicConstraints = critical, CA:TRUE, pathlen:$EASYRSA_SUBCA_LEN"

# Deprecated Netscape extension support, if enabled
if print "$EASYRSA_NS_SUPPORT" | awk_yesno; then
Expand Down
4 changes: 2 additions & 2 deletions easyrsa3/openssl-easyrsa.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ authorityKeyIdentifier=keyid:always,issuer:always

# This could be marked critical, but it's nice to support reading by any
# broken clients who attempt to do so.
basicConstraints = CA:true
basicConstraints = critical, CA:true

# Limit key usage to CA tasks. If you really want to use the generated pair as
# a self-signed cert, comment this out.
keyUsage = cRLSign, keyCertSign
keyUsage = critical, cRLSign, keyCertSign

# nsCertType omitted by default. Let's try to let the deprecated stuff die.
# nsCertType = sslCA
Expand Down
6 changes: 3 additions & 3 deletions easyrsa3/x509-types/ca
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# CA_PATH_LEN for CA path length limits. You could also do this here
# manually as in the following example in place of the existing line:
#
# basicConstraints = CA:TRUE, pathlen:1
# basicConstraints = critical, CA:TRUE, pathlen:1

basicConstraints = CA:TRUE
basicConstraints = critical, CA:TRUE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
keyUsage = cRLSign, keyCertSign
keyUsage = critical, cRLSign, keyCertSign
2 changes: 1 addition & 1 deletion easyrsa3/x509-types/client
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ basicConstraints = CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
extendedKeyUsage = clientAuth
keyUsage = digitalSignature
keyUsage = critical, digitalSignature
4 changes: 2 additions & 2 deletions easyrsa3/x509-types/code-signing
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
basicConstraints = CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
extendedKeyUsage = codeSigning
keyUsage = digitalSignature
extendedKeyUsage = critical, codeSigning
keyUsage = critical, digitalSignature
2 changes: 1 addition & 1 deletion easyrsa3/x509-types/server
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ basicConstraints = CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
extendedKeyUsage = serverAuth
keyUsage = digitalSignature,keyEncipherment
keyUsage = critical, digitalSignature, keyEncipherment
2 changes: 1 addition & 1 deletion easyrsa3/x509-types/serverClient
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ basicConstraints = CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
extendedKeyUsage = serverAuth,clientAuth
keyUsage = digitalSignature,keyEncipherment
keyUsage = critical, digitalSignature, keyEncipherment

0 comments on commit 89b229a

Please sign in to comment.