You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Zheng, Kai" <ka...@intel.com> on 2013/10/29 13:00:33 UTC

A minor question about TLV class

Hi all,

I'm reading the codes preparing myself for development of some Kerberos related features. Just have a minor question as below.

According to DER rule, in the short form, the length octets consist of a single octet in which bits 7 to 1 encode the number of octets in the contents octets, and the form applies only for lengths between 0 and 127. Thus in the TLV class, the length of ONE_BYTE array should be 128 instead of 256. If I understand this correctly, then this should be only a minor coding issue, no bug exists here since the array is correctly used with check (length < 128).

Regards,
Kai

RE: A minor question about TLV class

Posted by "Zheng, Kai" <ka...@intel.com>.
Thanks for your confirm, Emmanuel.

-----Original Message-----
From: Emmanuel Lécharny [mailto:elecharny@gmail.com] 
Sent: Tuesday, October 29, 2013 8:37 PM
To: dev@directory.apache.org
Subject: Re: A minor question about TLV class

Le 10/29/13 1:00 PM, Zheng, Kai a écrit :
> Hi all,
>
> I'm reading the codes preparing myself for development of some Kerberos related features. Just have a minor question as below.
>
> According to DER rule, in the short form, the length octets consist of a single octet in which bits 7 to 1 encode the number of octets in the contents octets, and the form applies only for lengths between 0 and 127. Thus in the TLV class, the length of ONE_BYTE array should be 128 instead of 256. If I understand this correctly, then this should be only a minor coding issue, no bug exists here since the array is correctly used with check (length < 128).

You are 100% right.

I have fixed the code accordingly to your suggestion !

See http://svn.apache.org/r1536687


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: A minor question about TLV class

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 10/29/13 1:00 PM, Zheng, Kai a écrit :
> Hi all,
>
> I'm reading the codes preparing myself for development of some Kerberos related features. Just have a minor question as below.
>
> According to DER rule, in the short form, the length octets consist of a single octet in which bits 7 to 1 encode the number of octets in the contents octets, and the form applies only for lengths between 0 and 127. Thus in the TLV class, the length of ONE_BYTE array should be 128 instead of 256. If I understand this correctly, then this should be only a minor coding issue, no bug exists here since the array is correctly used with check (length < 128).

You are 100% right.

I have fixed the code accordingly to your suggestion !

See http://svn.apache.org/r1536687


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com