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


Reply via email to