Subject: | indefinite sequences - again, simple example (at last) |
Date: | Wed, 27 May 2009 21:19:11 +0400 |
To: | bug-convert-asn1 <bug-convert-asn1 [...] rt.cpan.org> |
From: | Leo Cherepanov <grey.leo [...] gmail.com> |
Hello!
I've constructed the simple form, showing wrong parsing indefinite sequences.
use strict;
use warnings;
use Convert::ASN1;
use Data::Dumper;
my $b='30800201090000'; # hex
my $der= pack('H*',$b);
binmode(STDOUT);
my $asn = Convert::ASN1->new;
$asn->prepare(<<ASN1);
Test2 ::= ANY
Test1 ::= SEQUENCE OF ANY
ASN1
my $node;
for(1 .. 2){
$node=$asn->find("Test$_");
print Dumper($node->decode($der));
}
It prints /020109/ first time (and it's right!), but second one prints
/3080020109/ *without* trailing zeroes! That's why my step-by-step
parsing files with indefinite sequences (and indef. tagged blocks [0]
- A080XXXXXX0000) dies!
Would you repair this, Please ?
Thanx again!