samba4/source/libcli/util/asn1.c integer

Love lha at stacken.kth.se
Tue Aug 31 07:47:14 GMT 2004


Volker.Lendecke at SerNet.DE writes:

> On Tue, Aug 31, 2004 at 12:53:20AM +0200, Love wrote:
>> samba4/source/libcli/util/asn1.c:asn1_write_Integer will only work for
>> small positive intergers (>= 0 <= 127). For test cases see
>> heimdal/lib/asn1/check-der.c.
>
> Thanks! Fixed in HEAD, to be merged to 4 :-)

You still need to catch the - high bit is set and need to be padded with
zero so it doesn't becomes negative - case, and your code doesn't negative
values; here are some value for you to test (they include the INTEGER and
length):

0	"\x02\x01\x00"
127	"\x02\x01\x7f"
128	"\x02\x02\x00\x80"
256	"\x02\x02\x01\x00"
-128	"\x02\x01\x80"
-129	"\x02\x02\xff\x7f"

Love

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 823 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20040831/b5dbb32a/attachment.bin


More information about the samba-technical mailing list