On 10/04/2012 08:09 AM, Ivan Shmakov wrote:
> It seems like asn1Decoding(1) (as of 2.13 debian 2; though there
> don't seem to be any relevant entries in the log [1] in between
> 2.13 and 2.14) fails to decode a CHOICE. Consider, e. g.:
>
> $ asn1Decoding \
> <(printf %s\\n \
> 'Example { } DEFINITIONS EXPLICIT TAGS ::=' \
> BEGIN \
> 'Foo ::= CHOICE { bar [0] INTEGER, baz [1] INTEGER }' \
> END) \
> <(printf '\x80\x01\x2a') \
> Example.Foo
> Parse: done.
Is the structure you have correct? Where is the actual integer stored?
> Also, the documentation doesn't seem to mention on how to encode
> a CHOICE with asn1Coding(1) [3], and just omitting the “unused”
> element(s) leads to a failure.
I also noticed. The asn1Coding tool is pretty primitive and needs a lot
of changes to be of any use.
regards,
Nikos