Subject: | BUG: Convert::ASN1 encode/decode for BIT STRING |
Date: | Tue, 27 Feb 2007 14:57:18 -0800 (PST) |
To: | ASN1ConvertBug Report <bug-Convert-ASN1 [...] rt.cpan.org> |
From: | Sileshi Kassa <sileshikassa [...] yahoo.com> |
I have found a bug with Convert::ASN1 encode/decode for BIT STRING.
I have compared ASN1::Convert encoding to BER standard spec exmample
encoding. Link to standard:
http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf
Section 8.6 specifically example 8.6.4.2 encodings for '0A3B5F291CD'H
and the Standrad example encodes it as:
03 07 04 0A 3B 5F 29 1C D0
The Java BinaryNotes encoder encodes exactly what the standrad example
indicates. Here is the sample testcase,BooleanArray.pl, output for '0A3B5F291CD'H:
**** Original Data ****
$VAR1 = '0A3B5F291CD';
**** ASN BER Encoded Data Dump ****
0000 7: BIT STRING
0002 : 00 0A 3B 5F 29 1C D0 __ __ __ __ __ __ __ __ __ ..;_)..
**** ASN BER Encoded Data HEX Dump ****
03 07 00 0A 3B 5F 29 1C D0 __ __ __ __ __ __ __ ....;_)..
According to stanadrad example encode, the third byte should be 04.
This indicate both the encode/decode for BIT SRING is incorrect
eventhough you can get correct result within perl encode/decode.
The problem shows up when it is passed to Java encode/decode.
Show quoted text
____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL