kaitai-io / kaitai_struct_formats

Kaitai Struct: library of binary file formats (.ksy)
http://formats.kaitai.io
712 stars 203 forks source link

Add decoding of ASN.1 Basic Encoding Rules (BER) Tag-Length-Value (TLV) #638

Open JaLooNz opened 1 year ago

JaLooNz commented 1 year ago

Add decoding of ASN.1 Basic Encoding Rules (BER) Tag-Length-Value (TLV) *There is known problem with constructed BER-TLV not being restricted to the length specified by the length value. However, parsing of the BER-TLV is almost correct. i.e. for the following APDU, 90 00 should be on the upper-most level but the decoder places it on the lowest level due to stream size limitation not able to restrict to substream. 6F 2F 84 0E 32 50 41 59 2E 53 59 53 2E 44 44 46 30 31 A5 1D BF 0C 1A 61 18 4F 07 A0 00 00 00 03 10 10 50 0A 56 49 53 41 20 44 45 42 49 54 87 01 01 90 00