[Date Prev][Date Next]
Issues with OpenLDAP and Net::LDAP
I've run into a troublesome issue using Net::LDAP (using v0.19 and other
versions with OpenLDAP (was using 1.2.9, also tried 1.2.11).
The basic behaviour: After reaching message ID 128 on an open LDAP
connection, Net::LDAP returns Protocol errors.
With a few data dumps and tracing, I found that the response to message
128 came back with an ID of -128. There of course being no message -128,
Net::LDAP returned the protocol error message. The obvious thought was
that a data type overrun/interpretation failure was occurring.
Net::LDAP uses the module Convert::ASN1 to encode/decode messages, and
after comparing hex dumps of the messages to BER documentation referred to
in the OpenLDAP FAQ (ftp://ftp.rsasecurity.com/pub/pkcs/ascii/layman.asc),
I concluded that Convert::ASN1 was decoding correctly. The octets
representing the message ID in messages 127 and 128 were 02 01 7F and
02 01 80, respectively. According to the above document, these represent
127 and -128. To represent 128, the string should be 02 01 00 80.
Obviously, OpenLDAP and Net::LDAP disagree on how these integers are
encoded, the question is, who's right? Is there a bug in liblber? Or is
Net::LDAP making a decoding mistake? Or am I missing something? Btw this
is all on a Debian GNU/Linux 2.x system...
Thanks in advance for your help,