Limit scope of CN name constraints
authorViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 16 May 2018 03:41:20 +0000 (23:41 -0400)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 23 May 2018 15:12:13 +0000 (11:12 -0400)
commitd02d80b2e80adfdde49f76cf7c7af4e013f45005
treee9e137e02f0751435765ff251b07d58f710213e0
parentde9f5b3554274e27949941cbe74a07c8a5f25dbf
Limit scope of CN name constraints

Don't apply DNS name constraints to the subject CN when there's a
least one DNS-ID subjectAlternativeName.

Don't apply DNS name constraints to subject CN's that are sufficiently
unlike DNS names.  Checked name must have at least two labels, with
all labels non-empty, no trailing '.' and all hyphens must be
internal in each label.  In addition to the usual LDH characters,
we also allow "_", since some sites use these for hostnames despite
all the standards.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
15 files changed:
crypto/asn1/a_strex.c
crypto/include/internal/asn1_int.h
crypto/x509v3/v3_ncons.c
test/certs/alt1-cert.pem
test/certs/alt1-key.pem
test/certs/badalt6-cert.pem
test/certs/badalt6-key.pem
test/certs/badalt7-cert.pem
test/certs/badalt7-key.pem
test/certs/badcn1-cert.pem [new file with mode: 0644]
test/certs/badcn1-key.pem [new file with mode: 0644]
test/certs/goodcn1-cert.pem [new file with mode: 0644]
test/certs/goodcn1-key.pem [new file with mode: 0644]
test/certs/setup.sh
test/recipes/25-test_verify.t