Emmanuel Lecharny wrote:

Hi Alex, hi Stefan
<snip/>

I've tested an AddRequest with a PDU which contains a jpegPhoto and a
byte[] as its value, and I'm not sure that the
org.apache.ldap.common.berlib.asn1.decoder.add.AddAttributeValueRule.finish() 
method does the right thing when creating a String with the bytes it get.

the line before the last line is :

        ...
       // Add the attribute
       attrs.put( id, new String( octets ) ) ;
        ...

and should be ...
       // Add the value
       attrs.put( id, octets ) ;
        ...


If the bytes are above 128, you will just transform the bytes to a bad
Value. I think that the value, as it is supposed to be an OctetString,
should be stored directly without creating a new String.

wdyt Alex ?
Right and there will also be character encoding issues. Hmmm I think this switch from using a String to using a byte[] should be based on the attributeType definition. Question is how do we get that to the Rule in a safe and easy manner?

Alex

Reply via email to