CC: | <gbarr [...] pobox.com> |
Subject: | Problems with Convert::ASN1 |
Date: | Fri, 19 Nov 2010 12:13:32 +0100 |
To: | <bug-Convert-ASN1 [...] rt.cpan.org> |
From: | "Guenther Degenfelder - DATEV eG " <postdienste [...] datev.de> |
Hello!
I have weird problems with Convert::ASN1 and can not find any advice on the Internet.
Many names for elements are causing decode errors. For example
TransferMessage ::= SEQUENCE {
CHOICE {
putrequest Putrequest
}
}
works, but ' Transfermessage' (lower case 'm') works not. Also 'PutRequest' (upper case 'R') works not. The 'encode' method returns in both cases
decode error 30<=>61 0 8 at .../Convert/ASN1/_decode.pm line 106.
Even 'LDAPMessage', as in the example 'ldap' comming with the ASN1 package, works not!
I also can not have more than 5 elements in this 'CHOICE'. Otherwise I get also:
decode error 30<=>66 0 8 at .../Convert/ASN1/_decode.pm line 106.
And it is not possible to have more than one '*Message' sequence!
I am using Convert::ASN1 version 0.22 and tried this with Perl V 5.10.0 on openSUSE 11.1 and Windows XP Service Pack 3.
Below is a little example of code for trying the behaviour.
Hoping for your help!
Kind regards
Guenther Degenfelder
DATEV eG
Internet-Dienste | P532
Telefon +49(911)319-1539 | Telefax +49(911)14701707
E-Mail guenther.degenfelder@datev.de | www.datev.de
Paumgartnerstr. 6 - 14 | 90329 Nuernberg
-------------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
use Convert::ASN1;
use Convert::ASN1::Debug('asn_dump','asn_hexdump');
my $desc = <<'ESQ';
-- TransferMessage works, ControlMessage not:
-- decode error 30<=>61 0 8 at .../Convert/ASN1/_decode.pm line 106.
-- Controlmessage works, Transfermessage not, LDAPMessage not
Transfermessage ::= SEQUENCE {
id INTEGER,
CHOICE {
putrequest Putrequest
}
}
-- Putrequest works, PutRequest not:
-- decode error 30<=>61 0 8 at .../Convert/ASN1/_decode.pm line 106.
-- PutrEquest works, PutreQuest not
Putrequest ::= [APPLICATION 1] SEQUENCE {
filename OCTET STRING
}
ESQ
print "ASN1 VERSION(",$Convert::ASN1::VERSION,")\n";
my $asn=Convert::ASN1->new;
if(!$asn->prepare($desc)) {
die($asn->error);
}
my $macro=$asn->find('Transfermessage');
if(!defined($macro)) {
die($asn->error);
}
my $pdu=$macro->encode(
'id'=>47,
'putrequest'=>{
'filename'=>'filenameputrequest'
}
);
Convert::ASN1::asn_dump($pdu);
my $pduvals=$asn->decode($pdu);
if(!$pduvals) {
die($asn->error);
}
print "putrequest id(",$pduvals->{'id'},") filename(",$pduvals->{'putrequest'}->{'filename'},")\n";
------------------------------------
Diese E-Mail wurde mit einem Zertifikat der DATEV eG signiert. Damit können Sie sicher sein, dass die Nachricht so von uns gesendet wurde. Wenn Sie eine Meldung erhalten, dass die Signatur ungültig ist oder nicht geprüft werden kann, fehlt das Zertifikat zu dieser Signatur auf Ihrem Rechner. Informationen zu Zertifikaten und zur digitalen Signatur finden Sie unter www.datev.de/zertifikate im Internet.
DATEV eG
90329 Nürnberg | Telefon +49(911)319-0 | Telefax +49(911)319-3196
E-Mail info@datev.de | Internet www.datev.de
Sitz: 90429 Nürnberg, Paumgartnerstr. 6-14 | Registergericht Nürnberg, GenReg Nr.70
Vorstand
Prof. Dieter Kempf (Vorsitzender)
Dipl.-Kfm. Wolfgang Stegmann (stellvertretender Vorsitzender)
Dipl.-Kfm. Michael Leistenschneider
Jörg Rabe v. Pappenheim
Dipl.-Vw. Eckhard Schwarzer
Vorsitzender des Aufsichtsrates: Reinhard Verholen
Message body is not shown because sender requested not to inline it.
Message body not shown because it is not plain text.