Re: possible parsing problem with OSI-DS 23 (Distinguished Names)

Allan Cargille <Allan.Cargille@cs.wisc.edu> Thu, 04 February 1993 00:01 UTC

Received: from ietf.nri.reston.va.us by IETF.CNRI.Reston.VA.US id aa15531; 3 Feb 93 19:01 EST
Received: from CNRI.RESTON.VA.US by IETF.CNRI.Reston.VA.US id aa15527; 3 Feb 93 19:01 EST
Received: from haig.cs.ucl.ac.uk by CNRI.Reston.VA.US id aa28767; 3 Feb 93 19:01 EST
X400-Received: by mta haig.cs.ucl.ac.uk in /PRMD=uk.ac/ADMD=gold 400/C=gb/; Relayed; Wed, 3 Feb 1993 23:17:06 +0000
Date: Wed, 3 Feb 1993 23:17:06 +0000
X400-Originator: osi-ds-request@cs.ucl.ac.uk
X400-Recipients: non-disclosure:;
X400-MTS-Identifier: [/PRMD=uk.ac/ADMD=gold 400/C=gb/; haig.cs.uc.405:03.01.93.23.17.06]
Priority: Non-Urgent
DL-Expansion-History: osi-ds@cs.ucl.ac.uk ; Wed, 3 Feb 1993 23:17:06 +0000;
Sender: ietf-archive-request@IETF.CNRI.Reston.VA.US
From: Allan Cargille <Allan.Cargille@cs.wisc.edu>
Message-ID: <930203171241*/G=Allan/S=Cargille/OU=cs/O=uw-madison/PRMD=xnren/C=us/@MHS>
To: Steve Hardcastle-Kille <S.Kille@isode.com>
Cc: osi-ds@cs.ucl.ac.uk, "Allan C." <Allan.Cargille@cs.wisc.edu>
In-Reply-To: <9074.728771288@isode.com >
References: <9074.728771288@isode.com>
Subject: Re: possible parsing problem with OSI-DS 23 (Distinguished Names)

} OU="ba"d"  is illegal, as '"' is a special, and thus not in stringchar.
} The way to deal with this is OU="ba\"d".   Perhaps I should add some text
} on this.
} 
} Steve

Hi, maybe I'm being dense, but my reading of the BNF is that OU="ba"d" is
completely legal.  Here's the BNF from version 5:

    <string> ::= *( <stringchar> | <pair> )
	     | '"' *( <stringchar> | <special> | <pair> ) '"'
     | "#" <hex>


    <special> ::= "," | "=" | '"' | <CR> | "+" | "<" |  ">"
	     | "#" | ";"

    <pair> ::= "\" ( <special> | "\" )
    <stringchar> ::= any char except <special> or "\"

My understanding is that using the definition

    <string> ::= '"' *( <stringchar> | <special> | <pair> ) '"'

is that a <string> has a double-quote, then as many <stringchar>s,
<special>s, or <pair>s as I want (intermixed), and then another
double-quote.  In that case OU="ba"d" would be legal.  It could be
parsed as

    <string> ::= '"' <stringchar> <stringchar> <stringchar> <special>
    		     <stringchar> '"'

I also believe that under the current grammar, the value OU=""" would
also be valid (don't ask me why someone would use this!  Do you intend
for that to be valid?  I think we would want that represented as
OU="\"".

I believe that the grammar needs to be fixed in some way or another.
I think that one way to fix it would be to restrict the definition of
<string> that I'm using to

    <string> ::= '"' *( <stringchar> | <pair> ) '"'

However, that's nasty because it requires all the other special
characters to be quoted with backslashes (not nice).  I would prefer to
see us distinguish between "normal" special's and the double-quote.
    
You're right on a separate point,  I was misreading the rule for <pair>
(adding a trailing backslash as well).

Hope I'm not just being dense.  Am I right?  Or can someone explain this
to me in more detail?

Cheers,

allan