[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SOLVED] PRIVATE tags handling
From: |
Ivan Shmakov |
Subject: |
[SOLVED] PRIVATE tags handling |
Date: |
Tue, 09 Oct 2012 01:20:38 +0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
As it now became apparent to me, the whole difference between
GNU Libtasn1 and Convert::ASN1 was that for the latter,
IMPLICIT TAGS were used (as a never-overriden default), while
for the former, EXPLICIT TAGS were, well, explicitly requested.
With IMPLICIT TAGS chosen instead, GNU Libtasn seems to read my
(test) data perfectly.
(As per X.690 §8.14: “If implicit tagging […] was not used […]
the encoding shall be constructed […]” vs. “the encoding shall
be constructed if the base encoding is constructed, and shall be
primitive otherwise.” Now, all the my SEQUENCE members were
primitive…)
Consider, e. g. (where IMPLICIT TAGS have replaced EXPLICIT
within the solidstat1 schema):
$ printf
'\x30\x15\x80\x01\x01\x81\x01\x02\x82\x01\x03\x85\x01\x04\x86\x01\x05\x87\x01\x06\x88\x01\x07'
\
| asn1Decoding solidstat1 /dev/stdin Example.SolidStat1
Parse: done.
Decoding: SUCCESS
DECODING RESULT:
name:NULL type:SEQUENCE
name:inode type:INTEGER value:0x01
name:links type:INTEGER value:0x02
name:type type:INTEGER value:0x03
name:uid type:INTEGER value:0x04
name:gid type:INTEGER value:0x05
name:mode type:INTEGER value:0x06
name:size type:INTEGER value:0x07
$ printf
'\x30\x15\x80\x01\x01\x81\x01\x02\x82\x01\x03\x85\x01\x04\x86\x01\x05\x87\x01\x06\x88\x01\x07'
\
| openssl asn1parse -inform DER
0:d=0 hl=2 l= 21 cons: SEQUENCE
2:d=1 hl=2 l= 1 prim: cont [ 0 ]
5:d=1 hl=2 l= 1 prim: cont [ 1 ]
8:d=1 hl=2 l= 1 prim: cont [ 2 ]
11:d=1 hl=2 l= 1 prim: cont [ 5 ]
14:d=1 hl=2 l= 1 prim: cont [ 6 ]
17:d=1 hl=2 l= 1 prim: cont [ 7 ]
20:d=1 hl=2 l= 1 prim: cont [ 8 ]
$
--
FSF associate member #7257
- asn1Decoding(1) fails to decode a CHOICE?, Ivan Shmakov, 2012/10/04
- Re: asn1Decoding(1) fails to decode a CHOICE?, Nikos Mavrogiannopoulos, 2012/10/06
- Re: asn1Decoding(1) fails to decode a CHOICE?, Ivan Shmakov, 2012/10/06
- Re: asn1Decoding(1) fails to decode a CHOICE?, Nikos Mavrogiannopoulos, 2012/10/06
- Re: asn1Decoding(1) fails to decode a CHOICE?, Ivan Shmakov, 2012/10/06
- Re: asn1Decoding(1) fails to decode a CHOICE?, Nikos Mavrogiannopoulos, 2012/10/07
- Re: asn1Decoding(1) fails to decode a CHOICE?, Ivan Shmakov, 2012/10/07
- Re: asn1Decoding(1) fails to decode a CHOICE?, Nikos Mavrogiannopoulos, 2012/10/07
- PRIVATE tags handling, Ivan Shmakov, 2012/10/08
- [SOLVED] PRIVATE tags handling,
Ivan Shmakov <=
asn1Coding(1) a CHOICE, Ivan Shmakov, 2012/10/08