[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: commit: ldap/libraries/libldap dntest.c Makefile.in getdn.c ldap-int.h schema.c



At 10:08 AM 2001-10-18, Pierangelo Masarati wrote:
>I'm committing this stuff because I haven't been able to work on it 
>for the last week, so maybe it's time I get some feedback while I
>work on other tasks.
>
>It works for simple cases; it should handle most of the "conventional"
>cases, but there's much to do on unicode and there's still a number of
>FIXME in the code (which means: am I doing right?).

I think there should only be two value types: string and binary
(BER).  No transliteration of the character encoding should be
done by either str2dn() or dn2str().  The fact that a HEXPAIR
was used to represent the value does not change the value, it's
still a string value.

Maybe it would help to understand the meaning of "string" vs
"binary".  String means the value is encoded as a sequence
of octets (which may or may not be characters) in a format
described by the LDAP syntax.  Binary means the value is
BER encoded per the ASN.1 syntax associated with the LDAP
syntax.

It should be noted that the string encoding is not restricted
to any particular character set.  DN hex pair escaping is used
when octets of the string encoding are outside the range allowed
by the DN string representation.

For example, say an attribute foo of syntax UCS4String whose
string representation was a sequence of UCS-4 characters had
a value of "X" (U+00000058) was used to name an entry.  This
RDN could be represented as "foo=\00\00\00\20".  When parsed by
str2dn, the value should be the four octets 00 00 00 58
and length 4 as that is the String encoding of the value.  And
callling dn2str with this LDAPDN would result in
"foo=\00\00\00\20" for both RFC 1777 and 2253 forms.

One cannot convert between String and Binary encodings of
values without knowledge of schema as without knowledge of
the LDAP syntax of the attribute, one does not know the String
encoding format nor the ASN.1 data definition.

Kurt