RT3662: Allow leading . in nameConstraints
authorDr. Stephen Henson <steve@openssl.org>
Tue, 6 Jan 2015 20:29:28 +0000 (15:29 -0500)
committerRich Salz <rsalz@openssl.org>
Sat, 10 Jan 2015 21:03:05 +0000 (16:03 -0500)
Change by SteveH from original by John Denker (in the RT)

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 77ff1f3b8bfaa348956c5096a2b829f2e767b4f1)

crypto/x509v3/v3_ncons.c

index a01dc64dd22e83443f03d883ed765e12d54c162e..3b0f1bd1bd0bec4f783c9b432456e217898779b5 100644 (file)
@@ -401,7 +401,7 @@ static int nc_dns(ASN1_IA5STRING *dns, ASN1_IA5STRING *base)
        if (dns->length > base->length)
                {
                dnsptr += dns->length - base->length;
-               if (dnsptr[-1] != '.')
+               if (*baseptr != '.' && dnsptr[-1] != '.')
                        return X509_V_ERR_PERMITTED_VIOLATION;
                }