From: Chris R. <Chr...@me...> - 2000-05-10 12:56:08
|
On Wed, 10 May 2000 05:30:13 PDT, "Kurt D. Zeilenga" wrote: > At 02:59 AM 5/10/00 -0700, Pythagoras Watson wrote: > >This appears to be a decoding error on Net::LDAP's part. When the > >operation number (5th byte of response) reaches 128 (0x80), the > >resulting message code changes to two. > > > >To wit: > > searching 126 > > ... > > 30 38 02 01 7F 64 33 04 2F 75 69 64 3D 70 79 2C 08...d3./uid=py, > > ... > > 0002 02 1: INTEGER = 127 > > ... > > searching 127 > > ... > > 30 38 02 01 80 64 33 04 2F 75 69 64 3D 70 79 2C 08...d3./uid=py, > > ... > > 0002 02 1: INTEGER = -128 > > search failed: 2 > > > > 02 01 7F == 127 > 02 01 80 == -128 > > 02 INTEGER > 01 length of 1 > xx 2-complement base-256 value > > From RSA's Layman's Guide: > > Some example BER encodings (which also happen to be DER > > encodings) are given in Table 3. > > > > Integer BER encoding > > value > > 0 02 01 00 > > 127 02 01 7F > > 128 02 02 00 80 > > 256 02 02 01 00 > > -128 02 01 80 > > -129 02 02 FF 7F > > Appears to me that your server is broke. > Kurt is quite right. X.208 (BER) says: ------------ 8 Encoding of an integer value 8.1 The encoding of an integer value shall be primitive. The contents octets shall consist of one or more octets. 8.2 If the contents octets of an integer value encoding consist of more than one octet, then the bits of the first octet and bit 8 of the second octet a) shall not all be ones; and b) shall not all be zero. Note - These rules ensure that an integer value is always encoded in the smallest possible number of octets. 8.3 The contents octets shall be a two's, complement binary number equal to the integer value, and consisting of bits 8 to 1 of the first octet, followed by bits 8 to 1 of the second octet, followed by bits 8 to 1 of each octet in turn up to and including the last octet of the contents octets. ------------ So 0x80 is -128. This is a common encoding error made by Microsoft software. (Read http://www.cs.auckland.ac.nz/~pgut001/pubs/x509guide.txt and search for INTEGER.) Are you using an MS server, Pythagoras? Cheers, Chris |