Skip to content

Commit 4af232e

Browse files
committed
Ensure 'critical' basicConstraint for CA cert
Fixes: #74 Signed-off-by: Stephen Gallagher <[email protected]>
1 parent 39908d4 commit 4af232e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/authority.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ create_private_CA (TALLOC_CTX *mem_ctx,
123123
sk_X509_EXTENSION_push (ca_certinfo->extensions, ex);
124124

125125
/* Mark it as a CA */
126-
ex = X509V3_EXT_conf_nid (NULL, NULL, NID_basic_constraints, "CA:TRUE");
126+
ex = X509V3_EXT_conf_nid (
127+
NULL, NULL, NID_basic_constraints, "critical,CA:TRUE");
127128
CHECK_MEM (ex);
128129
sk_X509_EXTENSION_push (ca_certinfo->extensions, ex);
129130

test/test_cert_validity.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ key_strength=$(openssl pkey -text -noout -in service-key.pem -passin pass:mypass
204204
test "$key_strength" -eq "$_arg_key_strength"
205205

206206
# Validate the certificates
207-
openssl verify -CAfile ca.crt service.pem
207+
openssl verify -x509_strict -CAfile ca.crt service.pem
208208

209209
popd # $TMPDIR
210210

0 commit comments

Comments
 (0)