Re: [certid] Need to define "most specific RDN"

Nelson B Bolyard <nelson@bolyard.me> Wed, 14 July 2010 15:47 UTC

Return-Path: <nelson@bolyard.me>
X-Original-To: certid@core3.amsl.com
Delivered-To: certid@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id DFD3B3A6B7F for <certid@core3.amsl.com>; Wed, 14 Jul 2010 08:47:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.67
X-Spam-Level:
X-Spam-Status: No, score=-1.67 tagged_above=-999 required=5 tests=[AWL=-0.930, BAYES_20=-0.74]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xuh-jPTAtAOH for <certid@core3.amsl.com>; Wed, 14 Jul 2010 08:47:37 -0700 (PDT)
Received: from smtpauth18.prod.mesa1.secureserver.net (smtpauth18.prod.mesa1.secureserver.net [64.202.165.31]) by core3.amsl.com (Postfix) with SMTP id 511493A6B73 for <certid@ietf.org>; Wed, 14 Jul 2010 08:47:34 -0700 (PDT)
Received: (qmail 29462 invoked from network); 14 Jul 2010 15:47:41 -0000
Received: from unknown (24.5.142.42) by smtpauth18.prod.mesa1.secureserver.net (64.202.165.31) with ESMTP; 14 Jul 2010 15:47:41 -0000
Message-ID: <4C3DDC18.4020808@bolyard.me>
Date: Wed, 14 Jul 2010 08:47:36 -0700
From: Nelson B Bolyard <nelson@bolyard.me>
Organization: Network Security Services
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b1pre) Gecko/20081004 Firefox/3.5 Firefox/3.5
MIME-Version: 1.0
To: certid@ietf.org
References: <201006301746.o5UHkIsE019133@fs4113.wdf.sap.corp> <4C2B843A.5010206@stpeter.im> <4C305B93.9090001@velox.ch> <201007061435.29786.ludwig.nussel@suse.de> <4C335CE5.1090608@edelweb.fr> <4C3421B3.3070404@velox.ch> <4C3B4F6E.80903@stpeter.im>
In-Reply-To: <4C3B4F6E.80903@stpeter.im>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Subject: Re: [certid] Need to define "most specific RDN"
X-BeenThere: certid@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Representation and verification of identity in certificates <certid.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/certid>, <mailto:certid-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/certid>
List-Post: <mailto:certid@ietf.org>
List-Help: <mailto:certid-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/certid>, <mailto:certid-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Jul 2010 15:47:42 -0000

On 2010-07-12 10:22 PDT, Peter Saint-Andre wrote:
> On 7/7/10 12:41 AM, Kaspar Brand wrote:
>> On 06.07.2010 18:42, Peter Sylvester wrote:
>>> X.500 defines a tree structure, the nodes are relative names put
>>> into a hierarchie represented by a DN. a prefix of the elements in
>>> the sequence defines thus a "subtree", and the relative name of a leaf
>>> is the rightmost element, In a tree the most specific element a leaf
>>> and moving backwards defined less specific.
>>>
>>> There is no need at all to talk about binary encoding, or DER or
>>> whatever. A DN is a sequence of relative names forming a tree
>>> structure when interpreted in the X.500 context. This is thus
>>> one clear interpretation of 'most specific'  (for a RDN).
>> I don't think that this is the issue here - it's the wording in RFC 2818
>> which is the source of all this... well, I'd say, mess:
>>
>>    If a subjectAltName extension of type dNSName is present, that MUST
>>    be used as the identity. Otherwise, the (most specific) Common Name
>>    field in the Subject field of the certificate MUST be used. Although
>>    the use of the Common Name is existing practice, it is deprecated and
>>    Certification Authorities are encouraged to use the dNSName instead.
>>
>>    Matching is performed using the matching rules specified by
>>    [RFC2459].  If more than one identity of a given type is present in
>>    the certificate (e.g., more than one dNSName name, a match in any one
>>    of the set is considered acceptable.)
>>
>> Reading "(most specific) Common Name field" as "Common Name in the most
>> specific RDN" is one interpretation, but I'm not sure if it's the only
>> one. And given the attention this issue received on the list so far, it
>> also seems somewhat ironic that this "requirement" is only appearing in
>> parentheses in an RFC which happens to be informational only, BTW...
> 
> Is there a good security reason for this "requirement"? I don't see one.
> 
>>> Anyway, since there is no good reason not to put a subjectAltName,
>>> I do not think that one shouls say anything more than
>>> "If you use a Common Name other than in the most simple case one
>>>   may run a risk not to be interpreted correctly."
>> A BCP document should say more that just state how implementations
>> currently behave, I think [1].
> 
> For sure.
> 
>> Leaving that "most specific", peculiar requirement from RFC 2818 aside,
>> I don't believe that there are really strong arguments against treating
>> multiple CNs in the subject different from a subjectAltName extension
>> with multiple dNSName entries - why not consider "a match in any one of
>> the set[s]" acceptable...? [2]
> 
> That seems eminently sensible to me. (Whether any given CA would issue
> such a certificate is a matter of CA policy...)
> 
>> Clarifying/fixing that blurry "(most specific)" statement from RFC 2818
>> would be highly desirable for the new BCP, IMO. If by this we can get
>> away with a term whose meaning isn't intuitively clear (compare this
>> e.g. to "left-most DNS label"), then I would definitely consider that a
>> plus.
> 
> Would removing all mention of "(most specific)" qualify as clarification?

<dilbert> Gaa! </dilbert>   Let's not open Pandora's box wider!!

One of the big weaknesses of PKI right now is the lack of effective use of
name constraints.  CAs do not constrain the names that their subordinate
CAs may issue.  And one of the big reasons for that is that name constraints
are not defined to apply to DNS names in Subject CNs, so they're ineffective.

Trying to apply DNS name constraints to subject CNs is a can of worms,
because subject CNs may legitimately contain things that are not DNS names
at all.  It's not correct to declare a cert chain invalid because the EE
cert contains CN="Peter Saint-Andre" and also CN="www.stpeter.im" but the
issuer CA is constrained to "*.stpeter.im".  There's no test that 100%
accurately answers the question "Is this string a DNS name or not?", and
so it is not generally possible to answer the question "Should this CN
be subjected to a DNS name constraint or not?".

SANs solve this whole problem.  They have a component that may ONLY contain
DNS names, and therefore is easily constrained.  DNS name constraints would
be effective if certs ONLY put DNS names into SANs.  But putting DNS names
into SANs effectively bypasses name constraints (at least, in
implementations I tested last year).

IMO, we should be attempting to drive a stake in the heart of DNS names in
subject CNs, and moving all CAs to use SANs exclusively for DNS names.

Let's close Pandora's box, not open it wider.